libgdiplus-6.0.4+dfsg/0000755000175000017500000000000013545371077015332 5ustar directhexdirecthexlibgdiplus-6.0.4+dfsg/Makefile.am0000644000175000017500000000037013542672033017357 0ustar directhexdirecthexACLOCAL_AMFLAGS = -I m4 SUBDIRS = src tests DIST_SUBDIRS = src tests pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA= libgdiplus.pc DISTCLEANFILES= libgdiplus.pc EXTRA_DIST = libgdiplus.pc.in README.md LICENSE libgdiplus.sln winconfig.h.in libgdiplus-6.0.4+dfsg/libgdiplus.sln0000644000175000017500000000241513233636545020206 0ustar directhexdirecthex Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26403.7 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgdiplus", "src\libgdiplus.vcxproj", "{BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Debug|Win32.ActiveCfg = Debug|Win32 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Debug|Win32.Build.0 = Debug|Win32 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Debug|x64.ActiveCfg = Debug|x64 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Debug|x64.Build.0 = Debug|x64 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Release|Win32.ActiveCfg = Release|Win32 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Release|Win32.Build.0 = Release|Win32 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Release|x64.ActiveCfg = Release|x64 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal libgdiplus-6.0.4+dfsg/m4/0000755000175000017500000000000013545371076015651 5ustar directhexdirecthexlibgdiplus-6.0.4+dfsg/m4/ltoptions.m40000644000175000017500000003426213545371053020150 0ustar directhexdirecthex# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libgdiplus-6.0.4+dfsg/m4/lt~obsolete.m40000644000175000017500000001377413545371053020474 0ustar directhexdirecthex# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libgdiplus-6.0.4+dfsg/m4/ltsugar.m40000644000175000017500000001044013545371053017566 0ustar directhexdirecthex# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libgdiplus-6.0.4+dfsg/m4/libtool.m40000644000175000017500000112617113545371053017563 0ustar directhexdirecthex# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libgdiplus-6.0.4+dfsg/m4/ltversion.m40000644000175000017500000000127313545371053020136 0ustar directhexdirecthex# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libgdiplus-6.0.4+dfsg/install-sh0000755000175000017500000003546313256032133017333 0ustar directhexdirecthex#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # 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 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libgdiplus-6.0.4+dfsg/config.h.in0000644000175000017500000000630213545371063017351 0ustar directhexdirecthex/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* AIX or PASE */ #undef AIX /* OpenBSD */ #undef BSDOS /* Win32 */ #undef CYGWIN /* Define to 1 if you have the header file. */ #undef HAVE_BYTESWAP_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `FcFini' function. */ #undef HAVE_FCFINI /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if libexif is available. */ #undef HAVE_LIBEXIF /* Define to 1 if you have the `fontconfig' library (-lfontconfig). */ #undef HAVE_LIBFONTCONFIG /* Define if gif support is available */ #undef HAVE_LIBGIF /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define if jpeg support is available */ #undef HAVE_LIBJPEG /* Define if png support is available. Always defined. */ #undef HAVE_LIBPNG /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define if tiff support is available */ #undef HAVE_LIBTIFF /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* sigsetjmp is available */ #undef HAVE_SIGSETJMP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Support for the visibility ("hidden") attribute */ #undef HAVE_VISIBILITY_HIDDEN /* Define if x11 is available. */ #undef HAVE_X11 /* Linux */ #undef LINUX /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* OS X */ #undef OSX /* Unknown */ #undef OTHEROS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Solaris */ #undef SOLARIS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Use Pango to measure and draw text */ #undef USE_PANGO_RENDERING /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* For libc reentrancy */ #undef _REENTRANT libgdiplus-6.0.4+dfsg/LICENSE0000644000175000017500000000201113542674535016333 0ustar directhexdirecthexPermission 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.libgdiplus-6.0.4+dfsg/config.sub0000755000175000017500000010645013244306071017307 0ustar directhexdirecthex#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libgdiplus-6.0.4+dfsg/depcomp0000755000175000017500000005601713256032133016702 0ustar directhexdirecthex#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libgdiplus-6.0.4+dfsg/TODO0000644000175000017500000000422113542672033016012 0ustar directhexdirecthexThis file has a list of functionality not yet implemented or issues that have to be fixed in libgdiplus. ---- Functionality not implemented * Image formats - WMF and EMF. We have limited support metafiles. * Path - add missing implementation for - [path gradient brush](https://bugzilla.novell.com/show_bug.cgi?id=321034) - [path widen](https://bugzilla.novell.com/show_bug.cgi?id=320856) - [path warp](https://bugzilla.novell.com/show_bug.cgi?id=400775) ---- Not implemented / partially implemented functions * Handle functions Functions that use or create Win32 handles and are not yet implemented (except for window and device needed in System.Windows.Forms.) GdipCreateBitmapFromResource GdipCreateFontFromDC GdipCreateFromHWND * Generic functions GdipBeginContainer2 GdipBeginContainerI GdipGetPixelOffsetMode [2] GdipGetTextContrast [2] GdipSetPixelOffsetMode [2] GdipSetTextContrast [2] GdipTransformPoints GdipTransformPointsI * Image handling GdipSetImageAttributesThreshold GdipSetImageAttributesOutputChannelColorProfile GdipGetImageAttributesAdjustedPalette GdipSetImageAttributesOutputChannel GdipLoadImageFromStream GdipSaveImageToStream GdipSaveAdd GdipSaveAddImage * Functions related to paths GdipAddString [1] GdipAddStringI [1] GdipWindingModeOutline GdipWidenPath GdipWarpPath Notes [1] Partially implemented. LayoutRect and StringFormat are ignored. [2] Function exists (return Ok) but doesn't do anything (visually or not) [3] Function exists (return Ok) but only display a warning on the console [4] Partially implemented. GpGraphics is ignored. ---- Known Limitations * Maximum of 32bpp GDI+ supports bitmaps with more than 32bpp. http://bugzilla.ximian.com/show_bug.cgi?id=80693 * Coordinates limitations GDI+ supports 32bips of precision (Cairo is limited to 15bits) http://bugzilla.ximian.com/show_bug.cgi?id=79729 * Cairo doesn't support 8-bit pseudocolor visuals http://bugzilla.ximian.com/show_bug.cgi?id=77937 * Cairo doesn't implement cairo_stroke_to_path GdipWidenPath implementation depends on this feature. http://bugzilla.ximian.com/show_bug.cgi?id=78110 ---- last updated: August 9th, 2007 libgdiplus-6.0.4+dfsg/configure.ac0000644000175000017500000003706513545371046017627 0ustar directhexdirecthexAC_INIT(libgdiplus, [6.0.4], [https://github.com/mono/mono/issues/new]) AC_CONFIG_SRCDIR([README.md]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_SYSTEM AC_CANONICAL_HOST AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE AM_PROG_LIBTOOL m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_C_BIGENDIAN AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then AC_MSG_ERROR([You need to install pkg-config]) fi GLIB_REQUIRED_VERSION="2.2.3" PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION) GDIPLUS_LIBS="`$PKG_CONFIG --libs glib-2.0 `" GDIPLUS_CFLAGS="`$PKG_CONFIG --cflags glib-2.0 `" CAIRO_REQUIRED_VERSION="1.6.4" PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION) # Optional use of Pango's text rendering on top of Cairo AC_ARG_WITH(pango, [ --with-pango use Pango to measure and draw text],[text_v=pango],[text_v=default]) GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -std=gnu99" AC_ARG_ENABLE(warnaserror, AS_HELP_STRING([--enable-warnaserror],[Enable treating warnings as errors.]),[warnaserror=yes],[warnaserror=no]) if test $warnaserror = "yes"; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Werror -Wno-unknown-warning-option -Wno-clobbered -Wno-typedef-redefinition" fi AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan],[Enable address sanitizer.]),[asan=yes],[asan=no]) if test $asan = "yes"; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -fsanitize=address,signed-integer-overflow,undefined -g -O1" LDFLAGS="$LDFLAGS -fsanitize=address,signed-integer-overflow,undefined" fi AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage],[Enable code coverage.]),[coverage=yes],[coverage=no]) if test $coverage = "yes"; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS --coverage -g" LDFLAGS="$LDFLAGS --coverage" fi CAIRO_LIBS="`pkg-config --libs cairo `" CAIRO_CFLAGS="`pkg-config --cflags cairo `" cairo_info="`pkg-config --modversion cairo ` (system)" GDIPLUS_PKG_REQ="cairo" PANGO_REQUIRED_VERSION="1.40.14" PANGO_MAX_VERSION="1.43" if test $text_v = "pango"; then PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION) fi if test $text_v = "default"; then PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION, [text_v=pango], [text_v=cairo]) fi if test $text_v = "pango"; then PANGO_LIBS="`pkg-config --libs pangocairo `" PANGO_CFLAGS="`pkg-config --cflags pangocairo `" AC_DEFINE(USE_PANGO_RENDERING,1,[Use Pango to measure and draw text]) GDIPLUS_PKG_REQ="$GDIPLUS_PKG_REQ pangocairo-1.0" fi AM_CONDITIONAL(USE_PANGO_RENDERING, [test $text_v = "pango"]) GDIPLUS_LIBS="$GDIPLUS_LIBS $CAIRO_LIBS $PANGO_LIBS" GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS $CAIRO_CFLAGS $PANGO_CFLAGS" # Fall back to using fontconfig/freetype-config if their .pc is not found PKG_CHECK_MODULES(FONTCONFIG, fontconfig, [fontconfig_pkgconfig=yes], [fontconfig_pkgconfig=no]) if test "x$FONTCONFIG" = "xno"; then AC_PATH_PROG(FONTCONFIG_CONFIG, fontconfig-config, no) if test "x$FONTCONFIG_CONFIG" = "xyes"; then FONTCONFIG_CFLAGS="`fontconfig-config --cflags`" FONTCONFIG_LIBS="`fontconfig-config --libs`" fi fi AC_CHECK_LIB(fontconfig, FcInit) AC_CHECK_FUNCS(FcFini) PKG_CHECK_MODULES(FREETYPE2, freetype2, [freetype2_pkgconfig=yes], freetype2_pkgconfig=no]) if test "x$FREETYPE2" = "xno"; then AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) if test "x$FREETYPE_CONFIG" = "xyes"; then FREETYPE2_CFLAGS="`freetype-config --cflags`" FREETYPE2_LIBS="`freetype-config --libs`" fi fi GDIPLUS_LIBS="$GDIPLUS_LIBS $FONTCONFIG_LIBS $FREETYPE2_LIBS" GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS $FONTCONFIG_CFLAGS $FREETYPE2_CFLAGS" AC_CHECK_HEADERS(byteswap.h) AC_SEARCH_LIBS(sqrt, m) AC_MSG_CHECKING([host threading settings]) case "$host" in *-*-mingw*|*-*-cygwin*) AC_DEFINE_UNQUOTED(CYGWIN,1,[Win32]) AC_CHECK_LIB(intl, gettext) ;; *-*-*netbsd*) AC_DEFINE_UNQUOTED(BSDOS,1,[NetBSD]) ;; *-*-*freebsd*) AC_DEFINE_UNQUOTED(BSDOS,1,[FreeBSD]) CFLAGS="-D_THREAD_SAFE $CFLAGS" ;; *-*-*openbsd*) AC_DEFINE_UNQUOTED(BSDOS,1,[OpenBSD]) CFLAGS="$CFLAGS" LIBS="$LIBS" ;; *-*-linux*) AC_DEFINE_UNQUOTED(LINUX,1,[Linux]) AC_CHECK_LIB(pthread, pthread_create) ;; *-*-solaris*) AC_DEFINE_UNQUOTED(SOLARIS,1,[Solaris]) AC_DEFINE_UNQUOTED(_REENTRANT,1,[For libc reentrancy]) CFLAGS="-pthreads $CFLAGS" ;; *-*-aix*|*-*-os400) AC_DEFINE_UNQUOTED(AIX,1,[AIX or PASE]) # Specify a 64-bit build via GCC, as Mono is always 64-bit on AIX/PASE CFLAGS="-D_THREAD_SAFE -maix64 $CFLAGS" LDFLAGS="-maix64 $LDFLAGS" # Like mono, don't use `OBJECT_MODE=64`, but specify 64-bit mode IBM binutils # explictly instead. AR="/usr/bin/ar -X64" NM="/usr/bin/nm -X64" ;; *-*-darwin*) AC_DEFINE_UNQUOTED(OSX,1,[OS X]) no_libpng16=yes # workaround until we can upgrade the libpng used by bockbuild ;; *) AC_MSG_RESULT(Unrecognized host $host) AC_DEFINE_UNQUOTED(OTHEROS,1,[Unknown]) ;; esac # Apparently for BSD special handling needs to happen # See http://archives/neohapsis.com/archives/openbsd/2001-11/2142.html # by Miod Vallat AC_CACHE_CHECK( [if compiler recognizes -pthread], myapp_cv_gcc_pthread, ac_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -pthread" AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([#include ], [void *p = pthread_create;], myapp_cv_gcc_pthread=yes, myapp_cv_gcc_pthread=no) AC_LANG_RESTORE CFLAGS=$ac_save_CFLAGS ) if test $myapp_cv_gcc_pthread = yes then myapp_threads="" CFLAGS="$CFLAGS -pthread" else AC_CHECK_LIB(pthread,pthread_create,myapp_threads=-lpthread, [AC_CHECK_LIB(c_r,pthread_create,myapp_threads=-lc_r)]) fi # sigsetjmp is a macro on some platforms, so can't use AC_CHECK_FUNCS AC_MSG_CHECKING(for sigsetjmp) AC_TRY_LINK([#include ], [ sigjmp_buf env; sigsetjmp(env, 0); ], gdip_ok=yes, gdip_ok=no) AC_MSG_RESULT($gdip_ok) if test "$gdip_ok" = "yes"; then AC_DEFINE(HAVE_SIGSETJMP, 1, sigsetjmp is available) fi # when possible hide stuff we don't want to export AC_MSG_CHECKING(for visibility __attribute__) AC_TRY_COMPILE([], [ void __attribute__ ((visibility ("hidden"))) doit (void) {} void main () { doit (); } ], [ have_visibility_hidden=yes AC_MSG_RESULT(yes) ], [ have_visibility_hidden=no AC_MSG_RESULT(no) ]) case "$host" in i*86-*-*) case $host_os in solaris*) # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. have_visibility_hidden=no esac ;; powerpc-*-*) case $host_os in aix*|os400*) # XCOFF doesn't have this, but somehow it appears anyways have_visibility_hidden=no esac ;; esac if test "x$have_visibility_hidden" = "xyes"; then AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute]) fi AC_ARG_WITH(libexif, [AC_HELP_STRING([--without-libexif], [disable EXIF support])]) dnl If the user doesn't force a --prefix= then assume the OS default for resolcing libtiff etc case $prefix in NONE) prefix=$ac_default_prefix ;; esac dnl Test for libjpeg (this needs to be checked before libtiff, since libtiff depends on libjpeg) AC_ARG_WITH([libjpeg], AS_HELP_STRING([--with-libjpeg=PREFIX], [Prefix where libjpeg is installed, or 'no' to disable]), [libjpeg_prefix="$withval"], [libjpeg_prefix="${prefix}"]) if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then JPEG_CFLAGS="-I${libjpeg_prefix}/include" JPEG_LIBS="-L${libjpeg_prefix}/lib" save_cflags=$CFLAGS; CFLAGS=$JPEG_CFLAGS save_libs=$LIBS; LIBS=$JPEG_LIBS AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***)) if test "$jpeg_ok" = yes; then AC_MSG_CHECKING([for jpeglib.h]) AC_TRY_CPP( [#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include ], jpeg_ok=yes, jpeg_ok=no) AC_MSG_RESULT($jpeg_ok) if test "$jpeg_ok" = yes; then JPEG='jpeg'; LIBJPEG="-ljpeg" if test "$libjpeg_prefix" != "NONE"; then LIBJPEG="$LIBJPEG -L$libjpeg_prefix" fi else AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***) fi fi CFLAGS=$save_cflags LIBS=$save_libs fi if test x$JPEG != x; then GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBJPEG" AC_DEFINE(HAVE_LIBJPEG, 1, Define if jpeg support is available) else jpeg_ok="no (Get it from http://freshmeat.net/projects/libjpeg)" fi dnl Test for libtiff AC_ARG_WITH([libtiff], AS_HELP_STRING([--with-libtiff=PREFIX], [Prefix where libtiff is installed, or 'no' to disable]), [libtiff_prefix="$withval"], [libtiff_prefix="${prefix}"]) if test x$with_libtiff != xno && test -z "$LIBTIFF"; then TIFF_CFLAGS="-I${libjpeg_prefix}/include -I${libtiff_prefix}/include" TIFF_LIBS="-L${libjpeg_prefix}/lib -L${libtiff_prefix}/lib" save_cflags=$CFLAGS; CFLAGS=$TIFF_CFLAGS save_libs=$LIBS; LIBS=$TIFF_LIBS AC_CHECK_LIB(tiff, TIFFReadScanline, [AC_CHECK_HEADER(tiffio.h, TIFF='tiff'; LIBTIFF='-ltiff'; tiff_ok=yes, AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))], [AC_CHECK_LIB(tiff, TIFFWriteScanline, [AC_CHECK_HEADER(tiffio.h, TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz'; tiff_ok=yes, AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))], [AC_CHECK_LIB(tiff34, TIFFFlushData, [AC_CHECK_HEADER(tiffio.h, TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz'; tiff_ok=yes, AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))], AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -lz -lm)], -ljpeg -lz -lm)], -lm) CFLAGS=$save_cflags LIBS=$save_libs fi if test x$TIFF != x; then GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBTIFF" AC_DEFINE(HAVE_LIBTIFF, 1, Define if tiff support is available) else tiff_ok="no (Get it from http://www.libtiff.org/)" fi dnl Test for libgif or libungif AC_ARG_WITH([libgif], AS_HELP_STRING([--with-libgif=PREFIX], [Prefix where libgif is installed, or 'no' to disable]), [libgif_prefix="$withval"], [libgif_prefix="${prefix}"]) if test x$with_libgif != xno && test -z "$LIBGIF"; then GIF_CFLAGS="-I${libgif_prefix}/include" GIF_LIBS="-L${libgif_prefix}/lib" save_cflags=$CFLAGS; CFLAGS=$GIF_CFLAGS save_libs=$LIBS; LIBS=$GIF_LIBS AC_CHECK_LIB(gif, DGifOpenFileName, [AC_CHECK_HEADER(gif_lib.h, GIF='gif'; LIBGIF='-lgif'; gif_ok=yes, AC_MSG_WARN(*** GIF loader will not be built (giflibrary not found) ***))], AC_MSG_WARN(*** GIF loader will not be built (giflibrary not found) ***)) AC_CHECK_LIB(ungif, DGifOpenFileName, [AC_CHECK_HEADER(gif_lib.h, GIF='ungif'; LIBGIF='-lungif'; gif_ok=yes, AC_MSG_WARN(*** GIF loader will not be built (ungiflibrary not found) ***))], AC_MSG_WARN(*** GIF loader will not be built (ungiflibrary not found) ***)) CFLAGS=$save_cflags LIBS=$save_libs fi if test x$GIF != x; then GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBGIF" AC_DEFINE(HAVE_LIBGIF, 1, Define if gif support is available) else gif_ok="no (See http://sourceforge.net/projects/libgif)" fi dnl Test for libpng libpng_found=no AC_MSG_CHECKING(for libpng16) if test "x$no_libpng16" != "x"; then AC_MSG_RESULT(skipped) elif $PKG_CONFIG --exists libpng16 ; then AC_MSG_RESULT(yes) PNG='png' PNG_DEP_CFLAGS_PACKAGES=libpng16 LIBPNG=`$PKG_CONFIG --libs libpng16` libpng_found=yes else AC_MSG_RESULT(no) fi if test "x$libpng_found" != "xyes"; then AC_MSG_CHECKING(for libpng14) if $PKG_CONFIG --exists libpng14 ; then AC_MSG_RESULT(yes) PNG='png' PNG_DEP_CFLAGS_PACKAGES=libpng14 LIBPNG=`$PKG_CONFIG --libs libpng14` libpng_found=yes else AC_MSG_RESULT(no) fi fi if test "x$libpng_found" != "xyes"; then AC_MSG_CHECKING(for libpng12) if $PKG_CONFIG --exists libpng12 ; then AC_MSG_RESULT(yes) PNG='png' PNG_DEP_CFLAGS_PACKAGES=libpng12 LIBPNG=`$PKG_CONFIG --libs libpng12` libpng_found=yes else AC_MSG_RESULT(no) fi fi if test "x$libpng_found" != "xyes"; then AC_MSG_CHECKING(for png) AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)], AC_MSG_ERROR(*** libpng12 not found. See http://www.libpng.org/pub/png/libpng.html.), -lz -lm) if test "$png_ok" = yes; then AC_MSG_CHECKING([for png_structp in png.h]) AC_TRY_COMPILE([#include ], [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;], png_ok=yes, png_ok=no) AC_MSG_RESULT($png_ok) if test "$png_ok" = yes; then PNG='png'; LIBPNG='-lpng -lz' else AC_MSG_ERROR(*** libpng12 found, but it is too old. See http://www.libpng.org/pub/png/libpng.html.) fi else AC_MSG_ERROR(*** libpng12 not found. See http://www.libpng.org/pub/png/libpng.html.) fi fi GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBPNG" AC_DEFINE(HAVE_LIBPNG, 1, Define if png support is available. Always defined.) dnl dnl Test for X11. Allow compiling without x11 support using the without-x11 dnl flag dnl AC_ARG_WITH(x11, [AC_HELP_STRING([--without-x11], [Disable X11 support])], [disable_x11=yes]) if test x$disable_x11 != xyes; then AC_MSG_CHECKING(X11 support) if $PKG_CONFIG --exists x11 ; then GDIPLUS_LIBS="$GDIPLUS_LIBS `$PKG_CONFIG --libs x11`" GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS `$PKG_CONFIG --cflags x11`" x11_available=yes else AC_TRY_COMPILE( [#include ], [], [x11_available=yes], [x11_available=no]) fi if test "x$x11_available" != "xyes"; then AC_MSG_ERROR( [ Failed to compile with X11/Xlib.h include. You must fix your compiler paths ]) else AC_MSG_RESULT(yes) fi else x11_available=no fi if test x$x11_available = xyes; then AC_DEFINE(HAVE_X11, 1, Define if x11 is available.) fi AM_CONDITIONAL(HAVE_X11, test x$x11_available = xyes) dnl Test for libexif if test x$with_libexif != xno && test -z "$LIBEXIF"; then PKG_CHECK_MODULES(LIBEXIF, libexif, [libexif_pkgconfig=yes], libexif_pkgconfig=no]) if test x$libexif_pkgconfig = xyes ; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS $LIBEXIF_CFLAGS" GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBEXIF_LIBS" AC_DEFINE(HAVE_LIBEXIF, 1, Define if libexif is available.) else libexif_pkgconfig="No. Get it from http://libexif.sourceforge.net/" fi else libexif_pkgconfig="No. You disabled it." fi AM_CONDITIONAL(HAVE_LIBEXIF, test x$libexif_pkgconfig = xyes) GDIPLUS_PKG_LIBS="$GDIPLUS_LIBS" GDIPLUS_PKG_CFLAGS="$GDIPLUS_CFLAGS" AC_SUBST(GDIPLUS_LIBS) AC_SUBST(GDIPLUS_CFLAGS) AC_SUBST(GDIPLUS_PKG_LIBS) AC_SUBST(GDIPLUS_PKG_CFLAGS) AC_SUBST(GDIPLUS_PKG_REQ) AC_OUTPUT([ Makefile libgdiplus.pc libgdiplus0.spec src/Makefile tests/Makefile]) echo "---" echo "Configuration summary" echo "" echo " * Installation prefix = $prefix" echo " * Cairo = $cairo_info" echo " * Text = $text_v" echo " * EXIF tags = $libexif_pkgconfig" echo " * X11 = $x11_available" echo " * Codecs supported:" echo "" echo " - TIFF: $tiff_ok" echo " - JPEG: $jpeg_ok" echo " - GIF: $gif_ok" echo " - PNG: yes" echo "" echo " NOTE: if any of the above say 'no' you may install the" echo " corresponding development packages for them, rerun" echo " autogen.sh to include them in the build." echo "" echo "---" libgdiplus-6.0.4+dfsg/AUTHORS0000644000175000017500000000031312377405421016370 0ustar directhexdirecthexThe following people made libgdiplus happen: Alexandre Pigolkine Duncan Mak Jordi Mas Mark Steele Miguel de Icaza Ravindra Kumar Vladimir Vukicevic Sanjay Gupta Peter Bartok Hisham Mardam Bey libgdiplus-6.0.4+dfsg/libgdiplus.pc.in0000644000175000017500000000044012377405421020410 0ustar directhexdirecthexprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libgdiplus Description: GDI+ implementation Version: @VERSION@ Requires: glib-2.0 gmodule-2.0 gthread-2.0 Libs: -L${libdir} -lgdiplus @GDIPLUS_PKG_LIBS@ Cflags: -I${includedir} @GDIPLUS_PKG_CFLAGS@ libgdiplus-6.0.4+dfsg/tests/0000755000175000017500000000000013551133463016464 5ustar directhexdirecthexlibgdiplus-6.0.4+dfsg/tests/test.otf0000644000175000017500000134610013542672033020163 0ustar directhexdirecthex DSIGElGDEF_EtGPOSdH0eGSUB&tpOS/2}X`cmap3zJh,cvt Еb*fpgm&.? gasp#E\glyf -hhead(,6hhea @ d$hmtxK*locah *maxp name^x\4postq۸Ԑpprep5aJLbC+_<6=Mc^Qc  ;Ns/o f33f   P TST @^\` fXfff ff\fmfffBfofffff1fwf9ff9ffofVfmff-fffoffffffffff fff=f=f=f=f\fffffffffffff=f=f=fBffffffffffffoffff ff-fffffwfwfffffffff9ffffffffffofoffVfVffffffffffmffffffffffffmfffmfuf^effffffZff\ffmfff?ffBf%fFf;fffffffffffmfff)f)f=f)fffdfbfffffffffuffffffffffffffffffjfffff)fsffffffffffffffffff\ff'fffffffffff!fJf?f?ffffffffffffffffffffffPfPfffffffffffffffffffffHfHff5fRff5fPfffRfffff^fff^fffffbfffbf9f9ffffffffffffffffffffffffffffffffff;ffffff/ffffffhf9ff9f fYf fYfffffsffffffffffffffYf fYf fffffffffmf fff7ffofof2ffff1fwff9fuffofVffff?f+f ffmffff>fffPffbf?fmffffbfsfffBffFff\f+ff\ff?ff)f)f7fVf'ff)f)ffffffffffmfffffff ffff fffmfwffff1fof9fuff\fVf9ffffefTfJf#fRfffTf^ffffZfofffffffffRfff{ff9ffmf}ffffuffffff!f1ff\ffff^f;f)fFfffZfLf#fRfffTfVffffffffffffffZffff#f\fBfmfffyf@ffffff ff f fjf ffVf3fof}f}f\f+f7fff%f+fXfXfXffff+ff{fufwfdfXfXfXffff+ff{fufwfdffffff%ffffffffXfffffff%ffffffffXfffffff%fffffffffffTffhffTffffffffuff=f fqf{f=f7f+ff)fufRf(fffffffffff;f)fff;f)ffff f f ff f ff f f f ffffffffffff9f9f9ff9f9ff9fff9ff9fmfmflffflfflfffmfmfmffmfmffmfmfmfmffufuffuffufuffff\f\f\ff\f\ffHfffHffHfffmfffmffmf;ff;ffbf8ffffffff\fjfDffrfff{f.fNffdff!f$f)fff>f+fifffffffffffff2f2fffffff f2f2ffff3fffffffffffffffffffffffffRfffRfffRfffRffffRfffRfffRf2fwfwfwfVf?fffUf#f7flflf f0fUfOf_ff f2ffUff_f-f(f/ff fff2ffffffffffffffffffffrf`f`fvfvff`f`f`f`fsfsffnfffffffff-fffffffff*f*fffffmffqfqfffffffrffffffvfffffffFfzffffffffqfffffffflffvfvffff'f'f'f@f@ffffKfKf<f<fWfWf.f.fQfQfWfWfEfEfQfQfffKfKf;f;f!f!fffffffffffffffff#f#f$f$fKffffff ff\fffZff;fmffBfffffZff9ffffffoffVf+fmffofff0fOfOf}f}f<f<ffffffffffffBfff9fffOfOffZfgf2fffffffffffffffwfhfoffffffffff0ff"ffffff9fff ffffffmffmffffffff2ffoff4ffffffff(f2f2fff1ffwffffffffffffffofffffVfffmffffffff-fffffoffffffoffoffffff ffmfmf+fZffffJffBffdfff?f?f;fffff,f*f<fffffffffffvffffff2f\f ffff,ff4fffffffffffffffffffffffffmfhfffuffffffff?f<f<fNfff/f*ffHffHfmf'fIf'fDffIffff>fffmfFfffffmffmffff(f%fffPfPffMfffafffffffffffff5fffffffffffffZffffffffffffffff^ffbffffffxfffffffff?fffffffffBff%fffffffffff$fPffSff*f*ffffeffffCffmfffffmfmfvfvfAffffeffmfmffBfyfffffffffffff'fffZfZfZffff\f\fCf)f^f^f^ffffaffff{f{f{f7ff?ffIffBf%f;fEfffftf"f"f"ff9ffefff3f?ffmff"f,f,f,ffff ff7fffff6fffGf}ffHffffff9f1ffHf}f?f?ff'ff?f?ffkfkfwff4f4fMfBf%ffffZff1fffgf ffffff8f6fff,f#ff[ffffff(f(ffffffff)ffff*f*fRf9f@ffff'fff)ffffffffffff,fJfffff)fffFffmfffffff$fffff^f fffffffmfffffZfffff{fBfFffmfmfmfufffvfff{fff f'fff*fffRf4f1f!f9f9ff7ff_ffff4ffff3ffffffff-f-f-fOffff.ff ff fffSffffrfff/fYffffffffffffffff`f`f`f`fXfqff=f-ffTfAfAfAfAfAfffffCfCfCfCfCfCfCf/f/f/f/f/f/f%f%f%f%f%fffffffBfBfBfBfBfBfffffBfBfBfBfBfBfBf/f/f/f/f/f/f/f/f/f/f/f&f&f&f&f&f&fBfBfBfBfBfBfffffBfBfBfBfBfBf&f&f&f&f&f&f#f#f#f#f#f#f/f/f/f/f/f/fKfKfKfKfKfKfffffBfBfBfBfBfBfffffff$f$f$f$f$f$f/f/f/f/f/f/fNfNfNfNfNfNfffff@f@fff9fdfdfffnffffffvfvfvfvfffHfffff<f<ffffffffffffffffffffffffffffffffffffffffffffffffffsfsf9f\ff\ffSffff9fFfZfFf\fflfff f2ffffffoffCff\fuff;ffff2flfffdf`fff_frfhfff flfffnf`fff_ff?f7ff7f6fffxfffwfyfffwfOfrfofxfffwfyfffwff,f6fff,f6fffffffOfffOfffff6fff,ffaffffTffffTffffvf+ffTffffTffffffffffffffffPfffffffffffff'fffffffffffffffffffffffffffffffffffffffffXffffffffffffffffffffffffff2fffffffffffff'fff'ffffffffffffffffffffffffffffff!fffffffmfff$f#fofofdf9f\fVfffffefefnfffffffofofef;fffff;ffffffff9ffffffffffffZfSf+fffofBfVfmfff#ffBfffffff#fffdf\ff^fBfBfFf+ffffffff!ffff1fffXfffvffffffff\fffff;f)fffBfFfFfmf_f>fffffTff!ffffffffffff%fff>fff9fSfSffff1fRf\f+ffFffXffVff-ffBf2f2f\fffffffffffZflffffCfYfZflfNfff}fnffffffffff6f fffFfTf fPffKf<f?ffJf9fFff\fRfVf(f2ffKfxfVff]f\fRfffcffrffffffffffffffQffff@ff[ffzf8fffffUf>ffUfUfUffffffffffffffffzffffff*ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffVff.@@09@Z`z~Oh(4ou~/O?EMWY[]}  " & 4 : > D _ q ~  !!!!"!&!.!2!N!Z!^!!!"""""""")"+"H"a"e###!$s$$%%% %%%%%$%,%4%<%l%%%%%%%%%%%%%%%%%%%&<&@&B&`&c&f&k'6'~',l,w.!# 1:A[a{Pi)5tz0P? HPY[]_   & / 9 < C ^ p t  !!!!"!&!.!2!M!S![!!!"""""""")"+"H"`"d### $`$$$%% %%%%%$%,%4%<%P%%%%%%%%%%%%%%%%%%%&:&@&B&`&c&e&j'6'v',`,t.  7"llic-j!\ 99674 e505*.jQO0#,onic^XOLA6ݥݦݥݥݜݝݚݚwa!``  ( M>\fntH  B L T  . 8 \ ` n r `Qd[:PY^\ue[ZcRNKO<vLa]^Y`MGTaq^VI>}T~brd !"%(.2346ABCE0TWXYZ[_nopr}b#$'*+-,/1789:5;<=>?@DFGIHJKLMONQPRUSV\]^acedfgihkmqstuvwz~YZ[\]^_`abcd_efghijkl"mnop qz!r"s*tuv#w$xy%&{z'|}~{|(}~)*+,/0123456789:;<=>?ABC&)`DEFGHKNOPTXYjlZ[\]^_`abcdefghijklmnoptuy ,@B2IKRMUEP 2 3 4 5 6 7WD 8V 9 : ;&    !#$&()+-/13579;=?A 7@AB7:-./C<L1E5I0D2F4H  ;=?J(896K)3G>*+,     9:6478;<=@AB?>CD  E     !  "  #  $  %FG  &  '  (  )  *  +       9 } : ~ ; 5 < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | CEGHIKMOQSUVXxy{      !#$%&'()+,-./|0123MQOSNRPTbedgcfjnlpkomq}~                Z^\`[_]auyw{vzx|    !   "XWVUY 4 7 & * 3ihsrt , + - / . 0     2 1 ) $  #  % ( ' = >^ wy{ 6ghk ijl | ? <f R} B; => ? 4ZcU  d`eafb}gB z{~}|lnopV DY Eh5SUEFO     `Qd[:PY^\uehijklmnop[ZcR NKO<vL"%.3T[r]^|VTW>G(_`abda_qr]!Zawyijgh CYmn}kl 462BCEAXYWopn@EIKRMTPUB@Gd_^]\[ZYXUTSRQPONMLKJIHGFEDCBA@?>=<;:98765/.-,(&%$#" ,E#F` &`&#HH-,E#F#a &a&#HH-,E#F` a F`&#HH-,E#F#a ` &a a&#HH-,E#F`@a f`&#HH-,E#F#a@` &a@a&#HH-, <<-, E# D# ZQX# D#Y QX# MD#Y &QX# D#Y!!-, EhD ` EFvhE`D-, C#Ce -, C#C -,(#p(>(#p(E: -, E%EadPQXED!!Y-, EC`D-,CCe -, i@a ,b`+ d#da\XaY-,E+)#D)z-,Ee,#DE+#D-,KRXED!!Y-,%# `#-,%# a#-,%-, ` <<-, a <<-,CC -,!! d#d@b-,!QX d#d b@/+Y`-,!QX d#dUb/+Y`-, d#d@b`#!-,E#E`#E`#E`#vhb -,&&%%E#E &`bch &ae#DD-, ETX@D E@aD!!Y-,E0/E#Ea``iD-,KQX/#p#B!!Y-,KQX %EiSXD!!Y!!Y-,EC`c`iD-,/ED-,E# E`D-,E#E`D-,K#QX34 34YDD-,CX&EXdf`d `f X!@YaY#XeY)#D#)!!!!!Y-,CX%Ed `f X!@Ya#XeY)#D%% XY%% F%#B<%% F%`#B< XY%%)%%)%% XY%%CH%%`CH!Y!!!!!!!-,CX%Ed `f X!@Ya#XeY)#D%% XY%% F%#B<%%%% F%`#B< XY%%)) EeD%%)%% XY%%CH%%%%`CH!Y!!!!!!!-,% F%#B%%EH!!!!-,% %%CH!!!-,E# E P X#e#Y#h @PX!@Y#XeY`D-,KS#KQZX E`D!!Y-,KTX E`D!!Y-,KS#KQZX8!!Y-,KTX8!!Y-,CTXF+!!!!Y-,CTXG+!!!Y-,CTXH+!!!!Y-,CTXI+!!!Y-, #KSKQZX#8!!Y-, @%&Ia84-,F#F`#Fa#  Fab@@pE`h:-, #Id#SX<!Y-,KRX}zY-,KKTB-,B#Q@SZX TXC`BY$QX @TXC`B$TX C`BKKRXC`BY@TXC`BY@cTXC`BY@cTXC`BY@cTX@C`BYYYYY-,Eh#KQX# E d@PX|Yh`YD-,%%#>#> #eB #B#?#? #eB#B-, b`#b-,%XY%%% TX!Y!%\%ZX +Y %J%G%G`%Gca%UX%%IcY%XY%%I %\ %ZX +Y%Fca% UXc!Ya# UXc!YY+%\XiY% H#:&XY&X%/Y#2!!-,% %% %JSX% % %%Y%% %c#%c` @cSX!&& @ceQX&e&e &&%% .%% .%%YY UX%%%% % % & TX!Y%%% %I#%% % %Y QR#xa%%% % %Iab%% %#8%%%% % %İ%% % %I%T#y!!!!!!!!!!!!-,#TX@@YTX@@Y[+-,TX@@Y [+-, TX@@Y[+-,&& && [+-, EiD-e,KPXYD_^-f, EiD`-g,f*!-h, F%FRX#Y Id F had%F hadRX#eY/ SXi TX!@Yi TX!@eYY:-i, F%FRX#Y F jad%F jadRX#Y/-j,K &PXQXD@DY!! EPXD!YY-k, EiD` E}iD`-l,k*-m,K &SX@Y &SX#!#Y &SX#!#Y &SX#!#Y &SX#!@#Y &SX%EPX#!#!%E#!#!Y!YD-n,KSXED!!Y-e+g+@:- m+I:- m+L:- m+l+ E}iD  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J ߴ J ޴ J ݴ J ܴ J ۴ J ڴ J ٴ J ش J ״ J ִ J մ J Դ J Ӵ J Ҵ J Ѵ J д J ϴ J δ J ʹ J ̴ J ˴ J ʴ J ɴ J ȴ J Ǵ J ƴ J Ŵ J Ĵ J ô J ´ J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J ~ J } J | J { J y J x J w J v J t J s J r J o J n J m J l J k J j J i J h J g J f J e J d J c J b J a J ` J _ J ^ J ] J \ J [ J Y J X J W J V J U J T J R J Q J P J O J N J M J J J I J F J B J A J @ J ? J = J ; J 9 J 8 J 7 J 6 J 5 J 4 J 3 J 2 J 1 J 0 J / J . JA7dUdU/o/pdUP@p}dAU~A{|dA,|?|o||||_zz_yyxxoxxvdwUw w@urAoAnAi-hUg-fUe-dUc-bUa2`U/`?`_2^UZZpZZV-UU?UT-SU?SSSSR-QUP-OUpO/OHpHHoH@HF-EUD-CUB-AU@n Flk2@k Ff Fлs@q17F@q!F""((((((+++++++//////////////////888߲8޲8ݲ8ܲ8۲8ڲ8ٲ8ز8ײ8ֲ8ղ8Բ8Ӳ;Ҳ;Ѳ;в;ϲ;β;Ͳ;̲;˲;ʲ;ɲ;Ȳ;Dz;Ʋ;Ų;IJ;ò;²;;;;;;;;;;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGG~G}G|G{GzGyGxGwGvGuGtGsGrGqGpGoGnGmGlGkGjGiGhGgGfGeGdGcGbGaG`G_G^G]G\G[GZGYGXUWUVUUUTUSURUQUPUOUNUMULUKUJUIUHUGUFUEUDUCUBUAU@U?U>U=U<U;U:U9U8b7b6b5b4b3P2P1b0b/b.b-","+%*%)+(+'+&+%+$+#+"+!+ 555DDDDDDDDDDDDDDDD D K K K KKKKKKKKK@KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKRRRRRRRRRRRRRRRRRRRRR@RRRRRRRRRRRRRRR b b b b b b P b b b b b b b b b b b b b b b b@s ! o o o o o o o o o o o o   pp/?O/?@Fp,0F@""Fp@>BFTS++KRKP[%S@QZUZ[XYCTKQZXYBKSXYKSX@YKSXBY+stusu++sss+sutsst+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++s+++++++sssttss++sttu+t+st+s++++++++s+sssssssst+++st+sssstss+s+CTXAddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd~d}d|A}d{dydxdwdvdtdsdrdodndmdldkdjdidhdgdfdedddcdbdad`d_d^d]d\d[dYdXdWdVdUdTdRdQdPdOdNdMdJdIdFdBdAd@d?d=d;d9d8d7d6d5d4d3d2d1d0d/d.d++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Y++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++l7\Rfs3MsL)\ f)\f)@{)f7)MR_efjflpj\]^dipqstvyz{}nw{~nswyz{ 3=MNehst\^nuovs} -%39Lb\=L\\` 0  5  Wb*f  |X p ,  P  @\0p0H80H` 80H`xhx 8ppx 8 l !P!!""("@"X"p#x###$8$P$h$$$$$$%%&&&0&H&`&x&&&&&()D)*x+8+-.P/$/0X01223\34t5`56X6789T9999::(:@:X:p:<?$?<?T?l??@h@ABxBBBBBCC C8D`EEEEEFF0FGG(G@GXGpGGI0IJK4KLKdKtKKKMM,MDM\MtMMN<NTNlNNNNNNP P8QTRRR4RLRdR|RSSTU$U<UTVV V8VPVhVVVVVWWWWX X$X<XTXlXXXYPZ ZZ[[([@[X[p[\] ]^^^0^H^`^x^_`Ta@aabXbbbcpcddHd`dxedeff0fHf`ffgg(hhh4hLijkkXkllplm@mmnxnop8plpqq|r rsttxtuDu|uv vhvwDwxxyyz zz{{||}~ ~t4` l\8h@X(pp ,(P`p8HXTd0@PP`(@Xp||<T@dL00@\(4,D\tD(8 t`x D(4\\l$<@hP`(Ìäô,@PŘŨŸ`0ȰTʬ`( XD 8H`pψϠЄP`xҰdh< Xׄ׼|ڸXdpPx\lH00D D|hX 4H\pht$lp<d  4H\p      \DpH4$|L0p  !l"0"#t$d%&'( (8(P(h(((((()),)H)`)x)))))* *$*<*T*l*****++,,,4,L,d,|-,-D-\-t-----...4.L.d......//,/D/\/t/////00 080P0h0011111122,2233(3@3X3p333458568:|;@`@AAXAACpDE`F,FGGHhI IJKtKL LMMMN NPNNNO$OdOPPxPQ`RRXRS,SlSSST0TdTW^dLddeDeef4f|fgg`ghh|hiLijjpjk$ktl(lm<mn,nooop8pq(qqr\rs$ssw@wxxy4yLydyzz{d{|<|}X}~ ~~8DdL l8pldlHhH\ l,tTH TT\4Ht ptXH\l THl |8Ld8(8 t  4(PTh  tL8((L 4  L H@(|,X,<ddX<tİP`p T  $<Tl̈́͜ʹΰ0Мд\0H`xҐҨ 8Ԕլ<Tlքִ֜D\lT\tٌl0Ld|ܔ|ݔݬ \xސިh߸D\x4Ld|8PhXpHp0H`x,dDTD,tD,0P(@$d$|Tx,D\t4Ld|,D,D\t4Ld| $<TlD D \ t        8H`t L|lT 0Xp0 p0`x(xhD\t@  l !,!D!\!t!!!"H"`"x"""""## #8#P#h#####$$X$$%$%<%T%l%%%%&$&&&'L'd'|'''''( ($(<(T(()))4)L)|)**@*X*p+++,,-,-t.L//0\181234\556668 89:;L;<=>@>???@@,@D@\@l@@BDBCD\E<F<FGGHI8JJ(JKKL LM8MNhO P$PQ0QRS ST`U,VVTVWlWX`YXZ [8[\8\]L^8^_`ab@bbccd efDghik$l,mmnpnoppqrst0tuLuvw,wxxxxyDyz|{|}$~@~, T ,\44ht 4`hL|hx0`d4D4  4p l0pLd0H` 8P`x 8Ph8¼ðĨĸ8żD\Ǵ<Pɼ<|t8|ΐ\\ѐDӄ(pT |شL@۠ܨܸXݰސ 0p߰ <xLtDLhX\`$p0lH@X h$`8|Pd(d4|0t@t@<\0tDDXHP$h$`<T\T,p< H  `    `   4 p   < t   < L  (p  dx(`\,\ @` 0@P`p 0@P`p4p<P`p4p0Tlh( !!"P#l$d%x&h'4'D'T'|'())**+L, ,-$.T.x...//,/P/t////00,0X0001101\11112242X2|2223 303T3x33334$4P4|4445(5T5x55566,6P6t66667747X7|7778 808T8x88899 989\9999::4:X:|:::; ;8;d;;;<<(<@>$>@>\>x>>>>>? ?$?<?T?l??????@@,@D@\@t@@@@AA4ATAtAAAABBB4BLBdB|BBBBBC C$C<CTClCCCCCCDD,DDD\DtDDDDDEEE4ELEdE|EEEEEF F$F<FTFlFFFFFGGG8GTGpGGGGGHHxHIITIJTJKL@LMN\OP PPPPQQRRS(STTU4UVtVWhWXYYZ(Z8Z[`[\h] ]^|___`ha ab bcccccddddeeeeffffffggdg|h0hij jklmhnnoDp(pqrrs sttu uvdvw`wxyyzztz{{|x}}x~tHhh,D\l4Ld|0H`x(@Xp ,,\T<$h(@,,X@h$<Xhp@$l`< xDXl| ˜øżPǰt 8Dδ`DѤ<ԀԐԨָx؜,lـٔ٤ٴ,<L\lڴpxވ d`$$T$8P|Hp x p@xX$4d h P$(,D\t   ` Xpdp<D x!"#$& 'd'(,()p-h-h-h-h-hX1\#- 42@3@ (A (C??9//9/10!!##'3254.+5322#".54>JXk BgHdr*Lk@#)ie1%1  Ab-UA'-H3d3Qg3% fh)Enָe+#h+ui+Fh+h+A]A)9IYiy ]A&6FVfv ]A]+u9IF9FLFklF9pu9xu9F9u9uܸи/ии/F9EX/>Y h+h+.*i+A'7GWgw ]A]ии01%2>54.#"2#".54>!>32#&'.'.'.>54.'.'.'.546763635.54676'.>7;#267#"&'353.'4>73""#"&'.'.'#3467>3;&'&'&"353kRRkkRRku͙XXuuΙX(Jf~-A[[A   @<4 B5AP 6 AI)5S; ' NW }4
'   \ d@     @ ( AC?3/3/3/?39/]983/2/332}2}10!#!#3 \[\\E)C&  @* %%A&C??9/99/910#!! 4.+32>4.+326Iuver5_H*r\+;Dz O BD??]10%# 4>32.#"3267㝬R؆[HGZ\h8TG1AKD` ')Ey'#m (Ŵ  @  AC??]10#!! 4.+3 @f}Q2-4jl^yV/v5 1 @  A C??9/910)!!!!!5k> * @  AC??9/910!!!#!XB-)D!@ !*&)O&B D??]9/910.#"32>7!5!#".54>32I[ho;0fo,,))[_^,חQZXI;'+JsxF d T]"o 3 @ AACC???9/?/10!#!#3!3۲%X) ( @  CA?2?2/10!5!!!!5!--m(@  A  D??10#".'53265!5m2fh'QKB>JmvtTpB -4} F   @  AC?33?33/99898/3/3210!##33_@ AC??10)3!;}15p@  @ @@    A  C?33/3/?3339/98888839=/3329/3329/3310!# #' #3735 ={=@Ӱ97/9w 9 @ A  ACC?2??399}/|/?//29910!##33nk/m^s9/-'$@ (B#D??/10#".54>324.#"32>/Si~{323267#".4.#"32>hf2Ri~|=Dv\nd0]0OBJPc<#N{WTyN&$MzVTzO& f㊲Q[`Xk &{6.,WtLPgwKP$K@  ij  @ %    A CCC????99//9993310!#.+#!24&+32>.5?'T^ri1$GiD7M(Nw?eG'0?%2ZM=mYA_OihP9So-5F&-ij 6&'@ H'*-!B  D??99+10#".'532>54.54>32.#"Ls4g_T"KwVyM#;`{{`;8v!MOM!MH;`{{`;b]].   5L15K;14=SpMCe> fV5L<14>UrV@ AC??2/10!#!5!}}}m$ @ A AD???10#".5332653=vozk1BiLl{C@ueoMtN(_b1@  ACA??3?3399/232310 #3bDNPRq-9   ps@   @  ACCA????9/98888839=/]99//999910#'#37379X-/Z3?{=4ѕ;N F@*        AACC?.???//232310!# # 3 3Np+-of Eٷ @ ACA???9/999/910 #37f''`X-D"o 7@   AC?28?282210 !!5!5!eysh\{&=\{&?\{&A\&F\{&H\P&J\&L\&N\&O k!zv@ !    "#!@ (   A CE??33339?39/]98329/332}3}10#"&54>7!#3#3267 k=lo /'[\&$, +5'\H.4>&$7,' )E=`@  x@#    ACCC????99//2289/23}10)!#!!!!!= mF3O _1={&(?=={&?=={&A=={&C==&S=\+[l@  O BID?9??]999/10%##&4>32.#"3267㟠RBR؆[HGZ\h8TG1A')G` ')Ey'#{&C= @   CA??9/32/9/10! #!#5332654.+3#>1#>d}q1fk^yV/Zv5k0{&={&?{&A{&C{&HP&J&L&S#Rv # o @ $C  A C E???9/?99/910#"&54>7!!!!!!33267=lo /'5$, +5'\H.4>&k>$7,' )={& A==& L==& S=Bf-& V{& AHL @ A  ACC???9/2222?10#!##5353!5335!ٲnnoT;ٖ{& ={& ?{& A& F{& HP& J& L& S#Iv # o@ CA C E??2?2?9/9/10#"&54>7!5!!5!!!33267=lo /'--$, +5'\H.4>&햖$7,' )o6 ACD A????9/10%32653#"'#3+..\e-Z[eO l~GR`5o{& Af&V{&? &D f&V- Q@     @    AC??99//99999/9/10%!!573%'%ѴiZjk#7^&}){&?{&C&Fwf&Vw\G@  xx@F A AC??39??323910#33#7265{k8i^mw5ip:/{&=/{&?/{&A/&F/{&H/P&J/&Lf{&Q9)-&2@%)."'*+   '@3H+*."  BG G. DH?????99?99//999923}910#"&'#&54>327.#"4&'32>N{Ri8=L~|Ri>5@7?'TyN&8?(TyO&KܰQH7߮Q BQqDTQ)-{&_?F)+G++ %@ ,A B(DC????9/99//10)"#".54>323!!!!!.#"3267FJj+zu9Mb>=5q5J +PrI"$WPe7Qm8ô @   AC??99//1032+#4.+326PaP<~Ĉ*QtJ.cmPP?dG%є{&?{&Cf&V{&?{&A{&Co-7l7 %4l  +IJ8$%@ H%(+B@ DI??9/?99+9/9910#.'532>54.54>32.#"wT>)\_T"KwVyM#;`{{`;8v!MOM!MH;`{{`;L   5L15K;14=SpMCe> fV5L<14>UrN]iof-&V{&CVf&VV;@  @   AC??9/322/9/9/10#!5!!5!!! }} FFX{&={&?{&A&F{&HP&J&L&Nf{&Qm.P "(v# . . @/AA## D+E??9/??99//9910#"&54>7.53326533267=lo(!se.BiL)PtL$, ,4'\H+18"CtboMtN(_YtQ$7,' )9{&=9{&?9{&A9{&Hf{&=f{&?f{&Af{&H{&?{&C&Sm!?e+"//и/"и/A&6FVfv ]A]#EX / >YEX/>YEX/>YEX/>Y9A'7GWgw ]A] A]A(8HXhx ]01!'#".54>3273267.#"% XW+9w3d8^3M4BQ(e9Hol“V'T]2vt&1 @' P S"R?3??910#"&'3>324.#"32>ErY[KbVX,2N6!DIQ.3j032.#"3267DLJpN>AHCwZ4G>%wŠK"3`W m!4 @" R Q SP????999104>323#'#".73267.#"mFo0]-IcVW,kbBQ+h3ljG {jfH{vtu)@ )@*͏*$P R??9/]9/10!32>7#".54>326.#"?,XRK G`w9=ulio9 CdB9^D*+%2  FzjTByRCoP-,PpC?@    T Q??9/9329/10&#"!!#!5!5!2cHCh~7ɑse\1we+2//2и/A&6FVfv ]A]и/1и1/)1)93EX$/$>YEX(/(>YEX-/->YEX/>YEX/>YEX)/)>YA'7GWgw ]A]$ A ]A ( 8 H X h x ]-(9013267.#"3>75#".54>327#".'3M4BQ(e9\8';Nte XW+9w3d8 zzn+T]2vt8$ sHol“V'⭛<'EE/  @  PS QQ????910!#4&#"#3>32ǮWQ#=BN3)OOR,ts/PYEX/>Y i+!012#".54>;!"&5!532%%22%%2]f&12&&21&[ ')fX\h)D% **  V(@ @H O?+?910#"&'53265!52#".54>HYi+ 01!"&5!5!;]ffX8r')Z -H -% @ ./*P"P%OQ QQ????99??9/9910!4.#"#4.#"#3>32>32l"'/  '0!14;$QT.5@*/<#6YA{7D&4ZF{9P1jo4Q7%/ @ Q QPO????99103>32#4&#"#,ROR,XW =BM04E*qvq/P324.#"32> B|qlw?B|qlw?)LmCNoG!)LlDNoG!uËMC}uMC]]/=fJ]]/=ff%8  &@ & P O U#R????99/910#"&'#3>324.#"326Ki0_1 KcVX,2N6!DIQ.0j3ȄB \gSHzO^51Q<mf"4  @# $R U P P????99104>327#7#".73267.#"m9w3d8 XW+3M4BQ(e9l“V'h{HzT]2vt2@ Q PO???9/999103>32#6&#"#ɟYXSP#GKT0k`DŽw7V={5S,$$  6#$@ H$', P @  R?]?99+99//10#"&'532654.'.54>32.#"$>R]b/fRXV}x2i[DsT0'^x;NR6AY79fRYzL!5TA.D?+'*3F^@*dV9 #/,))9FX?-5 @  OR??32910%#"&5!5!7!!3267;~A=sp0r>  -lk- @ O ORQ????9910!#'#"&5332>73ǜ-QPQ- =CM04E*~/P=B9@  z@ QO?22/?398]9/332210373#B57vh%B@'     @     OQQO?2?3?3?39/98888839/3329/3393329/3333910#'#3737Bӑ!͑T+}-NflbVCF) ӱ#@## #   OOQQ?2/?3/?3/?3/3/322KRX @   #R+}Y8KRX @   #R+}YKRX @   #R+}Y8KRX  @   #R+}Y10!# # 3 3)~;`P@   Q @ 0VO?22/3?998?9989/332210 #"&'532>7375qc*40SJD o3:~<?dGh /@  OQ?28?282310)5!5!!7N}ݒ/&<&>&@&E}&GN&I&K&M&&M? d9[ H[@  H[0YOV HVHVVP?++44+++4m(7~e+)i+$i+A$$]A$)$9$I$Y$i$y$$$ ]1$91/и/1A)&)6)F)V)f)v))) ]A))]9EX / >YEX/>YEX/>Y!i+9и/.A.'.7.G.W.g.w... ]A..] 5A55]A5(585H5X5h5x555 ]01!'#".54>3273267#"&54>3267.#"% XW+9w3d8$, +5'=lo /!3M4BQ(e9Hol“V'$7,' )q\H.4>T]2vt?)8Cue+*i+2i+?i+29и/"?9A*&*6*F*V*f*v*** ]A**]>иEEX / >YEX/>YEX/>YEX(/(>Y?i+ 9(A'7GWgw ]A]" 9/и 6A66]A6(686H6X6h6x666 ]901%#".54>32>32!3267#"3267.'%"!6.=Z<(RP2J.,oINmE D]l9p*wk'9' 3Hok“]!:4A@tc66  T]2vt.Om?>mP.?&>)&>))&@)=&B=)&R) d }! ! @  PX@ pR?9/]??]99/9910#.54>32.#"3267RBJpN>AHCwZ4G>D'&wŠK"3`W &Dd9! &@2&@72:77777P! @H -R?S?]?99//]+9999?]99//99/9910.#"32>54&.'57'3%#".54>32*@TtG )Ie;EgD"50sR)IpL((Eg_jo:>xrT >iLW[.5_QVE#<'h=)eJ5wsiQ/GomÓVbf(I ""@)&P R  QS??9??2299/10!533##'#".54>325!3267.#"!HcVT*D~oaWdaBR+g3jfHpljG{vt&<&>&@&B}&GN&I&K&Ru7Bk+))81,@   !8B!@C8!!C=P ,*)$R4W??99?9/99//9/9910#"&54>7"#".54>32!32>732676.#"s=lo)!  w9=ulio9?,XRK 9E#+ +5'8 CdB9^D*\H+18"FzjTByk%2   $7,' )JCoP-,PpCS @H   TQQ???9/932+910!#!##5354632.#"!%ï{5?<<4= yz|eG    @ Q  T Q??9/932?99/10.#"3###5354632#: ծAO~| w \&@\&K\&R\&W&A3  H S?+4 !^  @) "  0@!OSQ Q???^]99?]9/329/10>32#4&#"##5353!!N)OOR,WQ#=BN3;æ1C*Pst/P=s&<&>&@&E}&GN&I&K:e+:h+!.i+A..]A.).9.I.Y.i.y... ].и7ܺ3.!9!<EX/>YEX/>YEX3/3>Y$+i+ i+3и$'и'/8012#".54>;3267#"&54>7#"&5!532%%22%%2$, +5'=lo /'|]f&12&&21&[ ')$7,' )q\H.4>&fXOe+h+ EX/>YEX/>Y 01;!"&5!5]f ')fXj\+?R",6 @1)@;'@H' OQV???3+229/1032653#"&'#4>32#".%4>32#".V9==jv8i^Ds&6&33&&33&y&33&&33&  &ip:i4&&44&&44&&44&&4\H(   @ VO??10#"&'53265!5HY i+01!"&55%!5!%;]ffXבÏ ')&})&>&B&Ef&V&X\8 @ VP O Q??9??9/9102654&#"#3>32#5mwXW =BM0,ROR,8i^uvq/P &@ &E }&G N&I &KN&P\) %1$)0".@!&'1%   @"21%&)  P Y RZ????9999//999932}9103#"'#7.54>3232>54&/.#"ےRq~A|r-+DRrA|r,/  NnF!=8 NnF!<;6zĉI7yÈJ'B*;DX+D+$+$<5@E<E%$!(RAP0 P:R????9/99//9910%#".54>32>32!3267#"&4.#"326.#";#sMNrL%(OxPNk)*6E,BhG&Y\^9k)-s=[r$4 #7&$8&"/EBU[:}‡zÉJTZ)A->xo%/ WgZ)+\deY)NnE f(4 ! @ ))P S U$R????910#"&'#3>324.#"32>Er0_1KbVX,2N6!DIQ.3j0&Bf&V&>&@&B6y| -@ %%%  7$%@ H%(-!P @  RX??9/]?99+99//999/10#.'532654.'.54>32.#"3Sl:T=TFXV}x2i[DsT0'^x;NR6AY79fRYzL!?`E+ D?+'*3F^@*dV9 #/,))9FXf&VCQ=!@ 6 66 +*@+D!$1T+Q R???999///10#"&'532>54.54>54&#"#4>32'Yg3T $*,5M14N\N4':D:'e`6V>!@r\U\/':D:'4O\O45hR4 "-/H@@K_@8P=/19'RJAfGjg2(JiA0/6&&>>@Pc! @  T Q??/10.#"#4>32DEAE|iBy -vt9J&DJ?f-&V?-P@$      OR??329/329///10%#"&=#53!5!7!!!!3267;~A={sp0r> s-elk&<&>&@&E}&GN&I&K&MN&P,J&&  @-& !Q OOR Q)W??????9999/10#"&54>7'#"&5332>733267=lo /'-QPQ- =CM0$, +5'\H.4>&4E*~/P=$7,' )B&<B&>B&@B}&G`&<`&>`&@`}&G&>&B&RPL@#    T Q?2?9/329///10&#"!!!!5!!5!5!2cHK"Ch~č<P1+Q @$"" - ,"  #( (+(TR??9/999329/10.#"!!3267#".5!5!54>321 DC@;bE&+HM*P %]4>lP/'=sh5> =]=jc "M{Ydd3'F @ '(! (@ @H  O'$R??+999/102#".54>#".5!5!3267/2%%22%%2%_4HxW1[Y*R"&21&&12&w "M{Y%djc &<&>&@&E}&GN&I&K*>^:0$$ ?+(@5@H5 O  R'W??9/?99+9/999/10#"&54>7.5!5!326732672#".54>=lo*"ErS.[Y*R"#+ +5';2%%22%%2\H,19#%MyV%djc $7,' )&21&&12&- @    OR??999/10%#".5!5!3267%_4HxW1[Y*R" "M{Y%djc 3F/%45 (@*@H*P R??+9/103267#".54&#"5>322#".54>[Z*Q %_4HxW1ZZ*S#&`5GyX1^2%%22%%2Pjc "M{Ykjc "M|Y&21&&12&&<&>&@&E}&GN&I&KJ`"JDD@:44KL;:7>D4.>(@  >P.JG.R&W??9?]999/102#".54>3267#"&54>7.54&#"5>323267/2%%22%%2#+ +5'=lo*"ErS.ZZ*S#&`5GyX1YY*R"&21&&12&w$7,' )q\H,19#%MyVkjc "M|Yjc 4@ ! P R??999/103267#".54&#"5>32[Z*Q %_4HxW1ZZ*S#&`5GyX1Pjc "M{Ykjc "M|YH\s#9I4)# :$(@/////P V??]10%#"&'532654.#"5>32+".54>3HAzoQ>"NSU)~!Bb@32HAzoQ>"NSU)~!Bb@7;J^f6t|DED!.ah  R&"?R) HS?+4&"D5f&"VP`    @     SR??99//9999999/9/10%#".=573%32>7;J^f6Vt|DED!.ahsrqꮞ‰  _&"} 4@ ! T R??999/103267#".54&#"5>32[Z*Q %_4HxW1ZZ*S#&`5GyX1Pjc "M{Ykb "M{YR&(?R)$ H$$S?+4p&(Df&(V'p@ &&$@()'&%$%@%%% T R??99//9999999/9/9/103267#".55%4&#"5>32%[Z*Q %_4HxW1ZZ*S#&`5GyX1Pjc "M{YRkb "M{Yђ'(}2^A @ Q  @ PO???929/99/10>32.#"!!53#5$KVd=0c(0n-5SLJ,+N+C. 1M6Պ&.>&.B^f&.Vk- Q  PO???99103>32.#"#ɟ,ZdtG;<8 FA7@l_S'5M1 "=S1&2>&2Bf&2Vb0P -$@ 12$*- @.*PP R???9999//99/10"327#".54&#"562327>32./5TLK,[ZSB#Z5HxW1VL  5_N;'NWe=0c(0nd1N6jc "M{Ykjc.H4.F0 &6>&6Bbf&6V9fh)6G?@21C&'BB!@ 7777))*@H1'/ )&C2:S/ RQQ????9/993999999//933}10#'#".54>7'.54>326'3274&#">40XGfaf5(DY187.YTQzR)3Sk8,"?[9b"9)TH(=*(,+L9!UmJKU.>$6]8#1;G9h:Y#5ʵ&-&-@;#-:);,-0) R?/9/99/999//910"32>=7#".54>7.54632.#"3?HzY2#HkHIqM(:you=%B[6Z`._+1e03V>#(Hc;"EgE7`F))MlC/]}I:iYCz`C %g1I/;R4/@@O?]]/10#%3Vg{/@@@HA?^]+/10#%37/@@O?]]/10#7Dg{/@@@HA?^]+/10#7b{oD@ @O?]2]/9910#'#7{yygo{=@ @HA?^]2+9/2210#'#73oyffo=@ O?]]29/2210'373yyo{=@ @HA?^]+29/2210373#!{ggՋ1@W@@HO?]+]/10#mT'2)@  O?]/10>323267#".#"+mE:P>7"(=V,lE;O>7")<HI"("7+VHI!)"7+)@  A?^]/10>323267#".#"+mE:P>7"(=V,lE;O>7")<HI"("7+RHI"("7+{}'(0#    (O?]3/102#".54>!2#".54>\)))))))) }))))))))oy{#$$ز  $A?22/102#"&54>!2#"&54>X''-='((-='{('=-(('=-(9NO?/10!5!9 ɅNP@ A?]/10!5!N5˅+*P P@  O?]2/10#".533265+(CZ33ZC(8888]=[<<[=3>>3g=*F F@  A?^]2/10#".533265=+Ia55`J+C>>CL=W88W=3333 %&-8!8@ &&O?^]]/102#".54>"32>54.3-N:"":N--N:"":N-$:*$$ 8L++K8 8K++L8 j%*:$%y +66@   A?^]/102#".54>"32654&3+J66J++I66I+(22(*003F*)G33G)*F3f/)(22()/#$_ #!""77"@H"pH H $A r??++q+/9/102#".54>"32654&#72.P9 9O-/M; ;M.+55+,33_2/B'&C//C'&A/_,%%..%%,N}NE@@O?]]/10#7!#7gf{C@@A?^]2]2/10#7!#7ߵ{#'@   O?]/102#".54>31$$10$$0$00$$00$_ !A?/104>32#"."..##.."L.##..##.}XQ??/10!#VB'   QW??/10#"&54>733267=lo /'$, +5'\H.4>&$7,' )fyU?/10#XBs'#X@ O?]/103lT'٧= $///102>54.54>327) '1&2VtA) & & #-D/JtQ,9B +Q?//10>54.54>32#3`I,$!3##A1=yx+@)*4,2*.&54.54>32#2#".54>3`I,$!3##A1=yx98**8 7**7+@)*4,2*.&2#".54>38**8 7**7 8**8 7**7*8 7**7 8*#*8 7**7 8*;, R?/102#".54>+"=--="#<--<;.=#"<--<"#=.;+';:(2 <7%-R#%R%R???10%#".54>32#".54>32#".54>32),,,,,,,,,,,,f,! ,,! -,! ,,! -,! ,,! -^s//10!5!^VϤR^^# &RS??/10#2#".54>j0##00$$0q$10##01$f# &PU??/103".54>32k/$$/0$$0f$00##00$-a//.E **γ &@ % %RS??9/9/9/10#32>54.+5322#".54> u=R232˵ u=R2=lXea@0##00##0# 0E,IqN)&AXci$00##00$5-d/C3W@ '()*1322.$.2)-@ ..''.S)& R??9/99//910%2#".54>>54.'#&+532'30##00$$0| 7S7Fe"BydB 6EC2$10##01$*2K-Lu@;Xbi2 hy T?/10&#".54>3y3`I,$!3#$@154.54>32#3`I,$!3##A1=yx+@**4,2)-&;Z=SvFh#-3,$.@ )3TT??/10&#".54>3&#".54>3!,SA( 0!!<.9ol ,SA' 0!!<.8ol(<''0*/'+#8T9NnB(<''0*/'+#8T9NnB9#3,$.@ .3)TT??/10>54.54>32#%>54.54>32#F+T@( 0!!<.9ol,SA( 0!!<.9ol(=''/*0'*#7U9NnB(=''/*0'*#7U9NnBB +Q?//10>54.54>32#3`I,$!3##A1=yx+@)*4,2*.&54.54>32#%>54.54>32#F+T@( 0!!<.9ol,SA( 0!!<.9ol)<''0*/'+#8T9NoB)<''0*/'+#8T9NoB b !NN۲//10   %g~bYbF!NN۲//10% 7 Y%ۆg]]bAB  EmfYFEnf A M M RR  /32/10  ڊ:mFLH A M M QQ  /32/10%7 %7 LىPNEmjNHGHqpqfrfs)@ SY?3?3/3210 #R\ff]U??/10#3fm//10!5!\՘;wfjm//10!5!jn՘;jyfjmydf  //102#".54>3?oS00So??oS00Sof0So??oS00So??oS0- @H /+/102#".54>3"=--="#<--<->""<--<"">-C}f\\e+ i+A & 6 F V f v ]A ]/EX/>Y01$54%kᤤ\  \de+ i+A]A)9IYiy ]  /EX/>Y016$54$'5kgf;<EfEfYfF@ lU??/10!!!!FGfB f @ lU??/10!5!!5! Ef*YFf  ff&1"@&  l&U??9/9/10#"&54.+532>=4>;#";J7[E++I\4([iJ;;fX1M51L4T_3f&1&"@  U&l??9/9/1032;#"+532547&=4+J7\E++I]4(ZiJ<<1M51L4T_3Zff5G V@       S?99//9923339/332210%#'-73%D?3EFHwVuuV{ 0 @  S?9/23/39/10!#!5!3!׬)) L @  QS??99//3223/39/105!3!!!!#!5!)))׬) @DX^7'@ '//'@JT@Y./2EO$7,T \??99////10%#".'532654.54>7.54>32.#"'>54.'/ .NzG3PF@"%EFK*}y1QflfQ1,B,.'^xso?o8AW61PfkfP1-B. Jr>.HqR0SwM$  SI!:8:AJYjA'PKCQ60kZ<'6 ";::AJZkB(PKBA-23=aSM*,22=aUNm*@  \ S??9//10".54>3!#"&'73265#р6ǍZ;occIZ5Ir;CsWWrAHio:@:.:/ \AC??10#!}7/6@  CA?3?92229/23231073!% 7-ɘ}/oo 24-'+3(² *@ ,*((B#D??9/10#".54>324.#"32>%5!4Ui~~>Ti~~?&P}WT{Q('O|VT|R(|Q[Q\sLQitLQ; b/@  CAC?2?39?39/23231033# PRq15w E@    @  C A??9/]99//9910!5!!5!5!u}; V堠9/-u$@ ACC???10!#!#!|o <@     AC?2?929/323210%!!5 5!!Vy\h늢;Vf?o$/0n*%v@/$ 12$%/  /    1 ?  0/^]99//]]32329/3310#5.54>7533>54.'%pm5Ew\pn6Ex\EdBAdGEeB AeH{Ts Z݋V us [ۋV C R|Zc{M Q}Zb|M N?'C @ AA AC??9/32??9/10!#.533>53le1vzt|8ka Bm]"/asH +;-+O*ò+'@, "B*CC??29/3?99//10)5>54.#"!53&54>323;PBZ6#MzXTyN&8XAP{sQiz:o*mcjILe_o,Q M[鏺W &]&)m4& H& {& Hq&=>f&f{&H&RP?1L ' @  ' ' @2"R  Q O-P???99?99//99104>32737.'#".732>=4.#"P?q^9fV@$`MPI^=# 2zb`0{y6\E' ?\;=^@!|ƋJR4  ' - @ ?>'?.--9T U"R???9/99999/910#"&'#4>3232>54.+532>54.#" AweNy13gh[`13F(=eH(D8}E;dH)EoPT>=W86N26V:_uB%3QnA7`I4bO5<_|"*!EiK9`F($=R./Q:!%Db<b !?E;;1'1 @1@"6 ,6T,R??9/9999/10>54&#"32>54&#"%#".54>32Zp=PGDgI- (JkDMmF!%C&24eO0>xtlu=A}JvR,,A06:'3 #54.'.#"5632%I`90]i&"+E5* 2&";42;BG^e 4?Dvvdz\*Kxm+@f@?,@???@,;  ';1@'A?A6"R T??999//9}3310.54>32&#"#".54>32>54.'?:)R~KytH? 'Sa=+EfYoo7:bx4`T1&IiD@a? .H89h?0T:!"%!!$uHpuoF3sm_L*JahTN6^`N[21VqR-SYY02_ *!@%%3 $*3'''3@P2/R??]9/]999///910%#".54>7.54632.#";#"3267dXz8(E]66N4J^`UG_;Ѣ#N}ZDf)MlD:T9! .=D%3HKNE%=,y.M % %/ /@ )) W  S?2?9/999104>7!5!#>54.'.1WqGV!EkJeP!&#0UCrd-R|q4xüaCbI09H[8'E?<99=#.$ Ntf?@  QU PO????92104.'3>32#4&#"# 9ROR,XW =BM03x|{7EE*vq/P32.#"32>7?xqlv??xqlv?-Ie>DfE'+JhAIjF$ɞnX  oY[~u7Lbǀ=Visf*8H."4 @99'R4O+T??32?9/229/10332>54'#".54>323##"";.s"CeDKh?r=*TV"{9qqGU?j^| '?WA:S1H'KlE4fO1Ӓ#*&hblHH7!9(>gJ)- @  OR??99/10%#".5!5!3267%_4HxW1[Y*R" "M{Y%ejc ' B@    @ OOOQQ???99??329/3210!##33',)51B?(?@ (&' !$$)*!!$( 'QR T???9/9/9232310.#"5>323:7#".''#!%.A !T 3UJ?E   6*)?3*/5^/=$ 5bOg",  2P8{f5&A %"%$#@%''&O$URQ O?????9991032>73;#".'#"&'#N@?G, (#2G0 +POG!4Y"-O=O3D)/D*9I*%'F 5@   QOO?2??999/3323103673#F7kMf}Fh}yyBm#$) @=8B===@3C.Q8 =)3##WBS?2?9/9999?9////99105!#";#"#>54.'.54>7.54>7otd,uOtK%%IoJeP!&#0UCri1*EX/+B,5H+6R_*Y_&D[55P:*9H[8'E?<99=#.$ HeP>nX=-@L'-ZQ?\ +:%G @  %& OQ%Q???229///10#".4!#>5#5!#3267:53ZM/ 71;C! $*(;Gmrrm@]. f#/  @ $ P U!R???910#"&'#4>324.#"326I}[B{*4lqqe/<_Ew1}:ȆC":cKLpKa7)\?1<Ӷ  /%@ 2O P*R???9/9910#".54>323"&%."#"32>54&b9I4b TpD)Jh@Jf?O\9trOC}vËL CjB\]/?gGwy/E %*+% 0%+W @ P!Q???999/104.'.54>32.#"#>6\Cod,DpN>AHC}Z. 9ahaQ&#1/ MipC"-]PMuP92R\8'E?<99=?5@    OR??299////10%#".5!5!!3267+yA^V)=_p0l/ +WX lk #$ @ $ORO???10#"&54654'332>54&' ?vl1M88cI+ mmښSF{4̾*I:`?3jppn)f?"-T(# @" ./#"R p ?  S- PU??32?]]]?329/3310#&54>733>54.'Ew\pn6Ex\EdBAdGEeB AeHf ~H wKsG { Bc~FNa> Ac~GNb> )f?#1F)$@23$2U.#P?3?9/329/104>32#&54>7>54.#"2H.}!?[9R^4Ex\+NkA7EeB #7D"*"Nct?RPqH"JsF r g\ Ac~G]_0EU7\)/@F +/,-.-.)*/((.+-.O /( $PU V??3?9?399//933}339/103267#"./#.#"5>3273V%*58P>0b8:$*57Q=1O2='2 3O7z?'2 2P7}}{QVf%!C @ "# !"OSOU????9/329/10#.533>54&'3`e3ru>_?  2fkf7hkPИ =jhpnmm~ʔ\'?4^$ͳ%%2(!2 ͳ  @ 226335$O-RR O????99/9/9/9/1032654'3#".'#".547332>53A>AJ=2)8-TvH(H9$ -=H$?mO.7*4;#4".#}]bo|B6YA>X88w bbHzX29W;M?&)&))f&)&}&G& &&&}&G?&) ߲@O?/10#) Rm4 Ȳ@IA?/10#Z\/ #'(:$ڲ'& %{&' &(O?22/102#"&54>!2#"&54>'#((-='p((-='{No''=-'''=-'3JY}}Z T?/10>54&54632Jf@ ?6"1=rgF"HQ_8": 6G0?!Nx+DX //10#".547>7>' *H63g/.4=B!% DU63+$2#!AUmG \ 7  @   A C??9/9/1032#!!!4.+326Px{?Is$LvS͘9dN]h75V>!'}AC??10#! JN w @AI C I??22??910!)#!#32>7!/B-B  !@<5, x#O'cd{uw    Dzv  @  A A CCCA??????99/33299//310 3 ### 333Dͤ͸Cˮ/{Zbby{m+1b@ "% " "" 1*@ 12%/ /1/DHB?+?9/999///910732654.#!5!2>54.#"5>32#"'mK|+QtH=dH(>fNSWJrfq5_H*Iuʞ&y2O76R8(L:#j% /LgA^j97w @ @  ACCA?3??3?993/2/33103##)$%f&J.x @  A CC???9/10!#! #"'7>7!ɲ '*yL H115o 9/-u#@ ACC???10!#!#!|}\+V93[@"      C@ DA A A???3??9//39/23}3310732>73373#"&' 8(E?:&^FɼwEXsK#M+7533>54.'bu@Ex[iq NL 1 @  AA CI????10%#!3!3L ߲Ke. @ CA A???9/910#".5332673#F6Tzl1BiLO5?@veLMtN(HT 7v tv@  C AAA????29/1033333!TBttJXEA v v tv@ C I AAA?????29/103333333#JP tttV#!5 @CA??9/9/105!32#!4.+326#|y32#"&'53267!5P 7ccSGOX؏GKً[HGY fl7'# !WQ &*T?-.A %xx@/AC*D B????9/10>32#".'##34.#"32>+R|Ue~F!O``|H "@40?% #@52?$ َEZUVaȆEFǁLJFI^&P@   @#'C""C#A??9/999?3299//93310>7.54>3!##"#;#"+,/:\=3m~E'A5+ "BcA7@, x{&?$j@ ACK???103!#!Nó[h?E@   @A  C??9/2/9///1032'5>54.+##5!!b~HOT3`J-EpSN1cdk/CsY)XI/FZ-!I !IJ"@O B  D??9/]9/10!3267#".54>32.#" TGؔGPي[HGZ\e= '#AOX &*8leo-{&={&H {& Hm {&={&?^(\"x Dn @*)"/ A# C??99//]9/9102#!# "'76!4.+32>cV&} !3FSP'7K3 +K:X`4G+9fRu0 7}4YB%"@ZR^ !Kx # x@"AC!! C A??9/9/??9/104.+32>332#!##33+J9X`4G+B^cW&9Z?""@Z9fRb9; @ACC???9/2/99//1032#4.+##5!!mr:CnPN0iudTsGF3f&J{ 8 @ C AACI?????9/10#!3!3! ?9@ CA?2?9//99//10#5!!32#!4.+326y{>Ir$LvS9dN]h75V>!'}9/-)3$ò %@ *%BD??9/10#".54>322>7!"!./Si~{) $ ZL? )=U# 3'/Q<#m} ;> '22'@ '< "7-S"R??9/999/2104.#"32>>32#".54>7>7Z'AT./OLL+*Hc;FjG$FlVi;E}hmn8D{$ONH39=u\0WV*5R;f);a~lba?|unKKg Du"/G (@#0 ͠''' P+R??9/q99/910#"&'>324.#"3 4&+32>:zUY^pbc0YD)=cF?^.+1`>YsC%ErQ-  }Uz%;P#8(NO,<!@ OQ??99//10#!VDF  ~@O \ Q \??22??/9/10!)#!#32>7! +8"> $ &D:1' lVbjCwuhd@     ~@ Q  Q QOOO?????9?9/99//10333 ###11K٠پL>l@ */***4@ ?/Π%9>@9R %P?]?]9/]q99///910732>54.+532>54.#"5>32#".',db[$UqCApWLa8:`GN])_ba,v`(2M66\C'3t%Y_\( );%$;,&6#"5%  'F`9*K<* %=T6BqQ.  5@  OQQQO?????9933103##\J==o&I'!- @  O QQ???9/10!#!&'7>7! /BTal9(F<1( lVq3=s15d@3   A I OO O  O Q QQQ?????9/93???9/9/23339/+332310!#'#'#3735 ;?@//sߜ8O 3 @ O OQQ???9/?10!#!#3!3Ǯ5ˮDh\ $@ OQQ???10!#!#!Ǯ5'Tf^@  OQ??29/10!#!5!VV;`)f?"-P(# @" ./- . "#. SU??9/329/329/10#.4>733>54.'@tbno8Ex\Ej@AdGEh@#DdAf }D w?y{@ y =dHY]6 >32#"&'#5!\+]((Z*CfE"D(^/@xi]J}9XR*EkU|P& RR%D&' @$&# $O QOQ????9/999/10!34&#"32>>32#"&'3h2cl< :=P/$?"^^.6dd@J4OW0@W-QqBPyR* !2! @"!O R??9/99104.#"32>>32#"&'3DDlL0r33_9TpD24:"mU9*?++Dg "L @!#Џ!!! #@ pR  P?]?]9/]10.#"5>32#"&'53267!5+7[IQDJTŃBEXDGO DGzJ D|ƆA"T?*G!@ +ȰOQ& RP????9/]10>32#".'##34&#"32>-TzQ[zJ _zHH\)=)*=(+>(Duk3=~…@zo;XNб&ZmwV&ZV(P@ @ )  QQ$ P???39/99999/993310>7.54>32##"#;.#"!O&>#O@ OQ??103!#!N{ٰPh\23[2)/,,.@ .43+$ @ H 3P,2/0S+QV???22?}+9999//10!>32#52>=4.#"##5353&KNU1P}V-3J^rA'C8+.H1#=BN3-C+9j8 (PЕl./P=sO @Р Pp R?]?9/q]29/10!327# $54>32.#" HRK}XBGTL}\7D?DžC" %KtG&<}&G}&G\h&<'&>^1J!0 00(@(!0O)(QQ R????9//99//104.#"32>>32#"&'#'7>7!+J3*(6G*6[T'BG )8K^;1& 5=70C\/RrD Rr6 ;qZ^)L($%)""%@%*&O)"%Q!Q RO????9/?9/104.#"32>3>32#"&'##33+F3*(9G)B6[T'BG5'@,1B~-RrE >e`o&I 8 @ Q OOQ\?????9/10#'!3!3!ʮR#-+H**(+%"#@#,+"(!'%(O!Q R???39/29/104.#"32>>32#"&'#537!!\BiJ8\))U*UsD/)]9uo6A{s]J=3&<*0?R.RpAMwR+ R-\ %7" #@ &#͠PR??9/q10#".54>322>7!"!. B|qlw?B|qlw?)GgE*EfG+DuËMC}uMC2VtA1Rk9BB@@! OOQQ O????9?9/9332310>32&"#"#37':R; ' # w53!0M6 (hm-@A;.;1@ )A; 6$R  S??999/99910.54>3!!"#".54>32>54.'u,-_c8L.+RmB.IiYoh2'Fao{ BdD@gH&1Q<1;@!6_E( "%h/nv|=4nj_G*LeUuZ<1N[21UtC7^SI"fo* @   O?]2/10#".5332>5f-QrEPrI"!8*+9"9o;\A""A\;2''2}jf*sr@  A?^]2/10#"&5332>5j.SsE#9*+:$5f:Y<yt/!!/y5r@ A?299/9910# #3n @X&4 @  /]10#".#"#&>323265%"HkG7XK?=<";9#GkG7XK?=<"?6L^5%8B8%^eL_5%8B8%\fff&@  ]U??99//9/10#33fD+)@ SSYY????3210#3R\ffU?/10!5!fffS?9/10#+d&@  SS??9/10#!#b++ `XH[oS=U@ #GJH7[[IH/T@# #\J[IVLDHDV:47:D:D:*T V??99//92239/}32991032>54.#"3267#"&>32#"&5#"&54>327.#"32>7  2'$N}YDmY?#°YSRZ*Oq_wr7+NoDNL&X>^^ 2Id@&B %0%"  @T0;{SE}))&&~zŋMaIPDMG7~uY6  *FY^[$`T 4*-SSGTS3@) SO=OB(O(O.BR:R#.T???99//99/23103267.#"32>54.#"'>32#"&'#".54>7>327%%.Z26 .#1-" 2*" (V`G|jY$y0u^~? 4RrMV\:>? EY5*E3,vJ&LQp\sgMd:0UsHΎJ*H`6XFuU/^GzIbZ6H+5YwBL3,0% Z+'?[:[@ ,4?,?,?#YAY@@3471(?=*1*1* DB??99//99//102#".54>"32>54.# 4>32.#"3275̍KO|̍KO{Zj:9i\[j98isS[+OpE]K#J&RZYULE+gbgcMzrőRMzrőS!HN}Y0mfjc% Z+'6?^7[(.;91(1(1#YAY@@;2.=7=2=00=2 DB??9///999//102#".54>"32>54.+#324&+3265̍KO|̍KO{Zj:9i\[j:9i#JrN-8gO/F?=5EH+gbgcMzrőRMzrőS\*SB(1PA636j0D~@0"A ./ 160@, ,",",EF@H 'p;;;1E 1T?9/]29/+q999//910'.+#324&+326"32>54.'2#".54>J #eXhA1 R11-).8NG}]55]}GH|]55]|H^|HH|^_|HH|Ũ@P9@""n&"%8`IJ`88`JI`8fH{^_|HH|_^{H  \RB  A 5@  AA A???29332/9910#'#'#373###5!\% RO+uLPV VL-F9VL'iXiL-@    R?99///9/10&#"!3273!"5432!sohyyu;'ٔċV=!1r " j m!n* k@2% !!-/3/93910#"''7.5467'7>3274&#"32>&\6gK#'*(&\6fM#'*(j[4J1j[4K0#%[3VN8[%[3VN8[Y/K^.0K^3-3w@ 3*3*"51+(.@! 4 1@H1(?+O+++ !"%B D??9/]32+222222222299//103267#"&'#53&45467#53>32.#"!!! J?EN&ZbPA?P|&Z'# !܈&1iu? &)+,o)09@)*0 91Ų4-@$: ** )@149 0-))NM??99//92299//9/9933}103.'#7.'5.54>7>54.'P4i-7p69CiADzg!!Q6?[;A~c>4nt}s_^?{4M4 T=SrOTZ3:QnL>ya? _JEY% dV$9.(})2;@)*2 ;36-@$< ** )@36; 2-))NM??99//92299//9933}103.'#7.'5.54>7>54.'P4h473./G?:9Fk+-(L%*V,;gL+d[=1\#pKL 5YzL"\-!K!@"  # " ! BC?2?9/32/9///10!!!53#5354>32.#"bL7w;maj"ҏQel9K7o# "Ba@+%v@*"#!!$$$ #!&&@ T \??9/999932/99//9933}10#"&'53267!5!>32.#"!d? *Qf"D#D(RRF6$&Y# T*[]'J{3bh6ia  ggߏ75b @    ɳ @ A CA??2222?99/9/99/10 !!!!#5!5!5!5!5375X44̴35^dk?kf)%e+&//и/& и / A&6FVfv ]A]EX/>YEX/>Yi+i+и/#A##]A#(#8#H#X#h#x### ]01!5!/#".54>3273267.#"\e>[='SY$F(k(%6$.f:G(flf}1Y~KHd: JN9[?"PO= f)'F] ]@ ()# @  (c?99//^]9/10!5!#".54>324&#"32>\/ZRN}W.0ZSN{U.[W-B-aQ-B-fKa8,WWL`6,WYlj";O,ml!;P%Z- )^ ;$; = =@*' !B AAACCC????99???9/3210!##33!5!#"&54>324&#"326Xׅ)s5L1]e4K0^f'#"%%"#'wwp=jO->iM+RT\LQZ\+;ii@   J i@,   /?ACC???^]399//]3332223332229999//9910#####53#533!33#3!!%%%%$"!"####ooo^JJ^X-!/J" & 0&%@"&&+ce??99//993210#".54>324&'32>%.#"3T="BX-';<7-7-  <("@ 22c#e??9/99//10#".54>324.#"32>2#".54>324.#"32>54.#"'>32!RSh:6V54.+532>54&#"5>32FԍN|6>HbX(0WyH;aE%|BP"MML#hj6sd3cO1VqA  #B^;6P6:U6i`  -TxKp-0Kf+1 D@   @   bd??39/9323/9/32333310##!533 !1߲-o9!!aG!A] @  ""b  e??9/99//10#".'532>54&+!!32TtCB?6GPZ0r^Uas@ &Ge?zo"U{!5@,  @" 6,'6b1e??99/9/210#".54>;#">324.#"32>Axglp:?`cc2>_B&NKD$GhD9_E'ZuCEڕdc78fY)%-:gatyyw-!/Ct("@   0:@! D -55-(50 0:(": %c?e??9/9993999/9999//9910#".5467.54>324&#">4.'32>Dzakn8v4ikeh4u:dJ)}qp}?^Aqn>hPD]9'D^75^E(HSX.0VvGxGAg?v\7+PrFr<FVjcYWVV'B:85s%FDD$!ACH(-E0-Ed-3</%@4/*  cd??9/929/10+532>?#".54>32"32>74.\my}B?`cc2BwdaxD68_E(=`B%OKD&Hg׿T4e])%-:hT[uD@$%GhC=`C$ i,X+O$#   ,$#@ $$'ge??99//99910#".54>324&'32>%.#"@|ue|E@|uh{C v^CkL) v\DlK(Bz٢_Hޖzס^Jܟ?yJZ5l|=JZ7mX';G-77 @  <(/(((#@ 22g#e??9/]9/10#".54>324.#"32>%2#".54>@|ue|E@|uh{CCpTDlK(CpUCkL)."".-""-Bz٢_Hޖyء^JܟX|J7mkV|L5l#.-""-.#X'$@ (g#e??10#".54>324.#"32>@|ue|E@|uh{CCpTDlK(CpUCkL)Bz٢_Hޖyء^JܟX|J7mkV|L5l 9 @  f d?2?9/9/310)5!'%3!P@$!!8! @" g d?2?999//10)5>54.#"'>32!LQe88S7Q9^KpUi;"KvU` @bTR1,P<#C8qMT1]T>vtw@!4P@ 0-$$- @ 5%$!(0(g i??9/999///910%#"&'532>54.+532>54&#"5>32H8m654&+!!32V/d*38:cc2r^Ua}G.Om?{o}#T{f3@* @4*%j/e??9/99/210#"4>;#">324.#"32>AxgCnۏÂE_B&MIC"EgE9_E'ZuC%dǷtBOY&6@oatPw#5G,$@;1;11; 6>@# H1;;1'6>$,k;keCe???9/9?999/999=////9910#".54>7.54>324&#">4.'32>E|eli4=nX}4ikeh4CmM*{q7X=!9Y?3X?$=fLz~%D_:(ZK1RP_58^~E+^ab0Aw@e?3YyGiB"P`q]n4I-'E@?!?BE:(MKJ%DP3N50Jd)"6<2 (@72- #g h??9/99/210+532>?#".54>32"32>74.3K2UD`C%MJB%Ff7W6^XK~Y)3AoT[uD@#%GhC324.#"32>5_TJ^54`TJ]62A$&A12A$&B0di6-akdi6-arQh<AeHQh<Ae)o@ 0 @` ^?2?9/9/310!53'%33o:8בlz)sH9 @ a^?2?9/99//31057>54&#"'>32!:I*CB3\%V6T?mO.9T7r׏-@3-.<% j6;>[54.#"5>32^2a`:4,"o<[l/N:RL1B( 7(6n-;?AB;&=,8^C%94''  kXGY +:)7 @@    d@   `^??39/93222/32310##5!5333dXF\%b75a@ ` _??9//9/10%#"&'532654.+!!32b9gU%a41a0gb1N8FEyY4!AbC"  =6' 1Zw7)7$@`'_??9/9/9/210%#"&54>;#">324&#"326w1WxH,iuE];[/FL+(" JMDL>bC#eu@+?' |{0> l[A)`7 @`^^???2/9/3210 #!5!`V``wujH!.@L'c"c@  f/9g@94,"$a<_??9/99//9910#"&54>7.54>324#">4.'32>j0TtC-9 4)&KqKP?":*BG*9"6@ /= /"NE7'8T8jd'>1'".<'-M9 f]B\ &1@^J%%# ='  '-+ ")sH!37/%@*"a^??9/9/29/10%+532>?#".54>32%"32>74.sOY}G_<(-/9kS21WwGGwV0EJ'6 +*% ";Ꭽ^*>)7^H=aD$!RpA1)  )G4J # @   /32/10%!#!5!3!Ȭ78ff//10%!5!f@ //10!5!!5! X)y7!  n o??/10.54>7%ss:0nPaY),[^)._W7)oOVm&)7!  o n??/10'>54.'Bss90nOaX),[]7.^W7)oOVm&os^%bw`jsR@ SQQS????//3310 #Rf{R d `@ b@"   Q TSQQS??????9/9322//33/2/9/333210 # '73##5!533'3RfJ7ZZ{Zt!mmzRR$+a)%b*( a$#@$('&%*S# QSQQS?????92?//33/9//210 #!57>54.#"'>323'73RfH/! 7&C.3;#,N;")A/>7{{}#3  e 0G/558!+ZtR<w*h@ 7:%70%77%0! `@%   :&%%&-4T  QQS???9/9322?9/9/3332/9///910 ###5!533'3#"&'532654&+532654&#"5>32RfZZ$GiF@=?506ZT/#%-6"K-di&*8:{mmzR*F4w%"q#! q LA4@ BR';KSA (_<D_2_ _@?7G-R# TSQQS??????//33//10 # #".54>324&#"32>#".54>324&#"32>Rf&Ge>=aE%&Ge>=aE%@9-@9-'Ge>=aE%&Ge>=bE%A9-@9- {AoQ/&KnH@oR.&JnMXT.?%XT.?AnR.&JoH@oR.&KnLXT.?%XT.?f#5AUaAB?V\?L$?6<?.??@YQ?)))0))@H@H 93T_!G R?32?99//++|]]q}22///10 5 #".54>324&#"326#".54>324&#"326#".54>324&#"326ff#A[76W>"#AZ76X>"52245134Z#A[76W>"#AZ7l52245134#A[76W?!#@[76X>"52245134}?iL*"EhG?iM*"EiKTM\ESM[?iM*"EiG?iL*SM[ETM\?iL*"EhG?iM*"EiKTM\ESM[T= % @   /329/10!#!5!3!wwhkm//10!5!\՘h 9  @  Q?9/329/10!#!5!3!!5!ww\{| >@    /999/9910  ' 7 1uj-u/-Ru1k-/u-T++2' ,-&"&/9/10!5!2#".54>".54>32B0##00$$00$$00##0՘$10##01$$00##00$*@ //10!5!!5!\\DU@*       QQ??29/3222/32}10!!!##5!7!5!3PBww7Pyvwɓ*ɓ+Z/,@ $#,' / '//10#".#"'>323267#".#"'>3232677yG7a^^40T#D6{G6b]_30U#C7yG7a^^40T#D6{G6b]_30U#2;!)!-q1=!("+3324.#"3264^OSX-4^OSW--G2-F0.G2ZbHH}\50WyIH}\50WyO+I64J-+J6n='3@(&' @+'+''R.T??9/99/9/1074>3232>7#".=>54&#"=-RuG@r["32>324#"32%&#"32>Z!A`>-IEF*.KEG*7Z@#%C_9!?ER4-JGF)3ZB'r(/7"&=2'lIjq +=)FxX23N48O1-RrEFxX3,RB5N3$Lv[&;)4A$ !@q 4@в0&5@!0 T+R??9/9929/10#".54>32.#"5>32"32>5.ag6?r_Ey-;^YN O*~іSZA_?:Y>?_@ 5rbdo;$"dNgy(If=:iO/1o"{\(@  T V??99/10#"&'532654632&#"+\#aOXX+[$aPWY- q`Z q_=79@ SQQS???9/93?//9/333310 #777B=3<{O7/+;-f5))= + @  SY?3?22/10#!##5!#V=Ùu) : Ѷ  ݷS Y?2?2/9/10!5 5!! !=@-ׁLR !շ AC??99/10!# 3% o$l(>377456@3\755764563/+'$1-)%$ "$ @#! @&Z #$'(+30/,#+,,+#//9/////+/////9/9+10 @TX #a`# HH`#a #xY @TX #a`# HH`#a #xY#!#3!33#3#3#3##!#5#535#535#535#53vr~҂P,,,``ddddddddddddddrzFv*QH8 R@%0Hdt6FV///]9/]]]+/9/+10#'32654&+532LIZ2( P@ HhF!nEQ^"(-k#6COZ8 R@1H0HdtFV@ H0?/]]]]9/+]]++/9/10#'32654&+532LIZ2( P@ HhF!EQ^"(-k#6Cj k@ @   @# HYi  @`//]]3]9/]]+/999/10#'#7%#7t۟wߍyykj q@ @   @( HYi  @?/]]]3]9/]]+/999/10#'#7%#7t۟wߍyykJ h @  @# HYi  @`//]]3]9/]]+/999/10#'#7%#'oۚ֠yykJ n @  @( HYi  @?/]]]3]9/]]+/999/10#'#7%#'oۚ֠yyk 8 8@ @@ Yi HV f U e  гH @,HF  P ` p  @`//]]3]9/q]9/]++]q+]/999/910#'#7%#'32654&+532t۟=<R) 323267#".#"#'#7+mE:P>7"(=V,lE;O>7")<\HI"("7+VHI!)"7+323267#".#"#'#7+mE:P>7"(=V,lE;O>7")<\*9:&V9:&>3)QqyPP@ r#&H@4H?O  @  0   /]qr^]^]q2]++?]/9/10#7#".533265Qߍ+Ia55`J+C>>Cq=W88W=3333+t3PP@` /  /]]2/9/10#'#".533265栍(CZ33ZC(8888t=[<<[=3>>3=p}PP@ r#&H@7H?O  @  0   /]qr^]^]q2]q++?]/9/10#'#".533265栍#+Ia55`J+C>>Cp=W88W=3333;+&8!8@!! P P@ Vf@+He[@ H !!   `//]]]2]9/+]]+q/9/910#".5332657#'32654&+532+(CZ33ZC(8888.=<R) >38AKj,6)=&ݲ  P&P8 8@- +$ ###$#####H#@>C6A`j+5=W88W=3333)WP P@) ))!&@ ! `//]]2]]]//10#".533265%>323267#".#"+(CZ33ZC(8888&+mE:P>7"(=V,lE;O>7")<=[<<[=3>>3HI"("7+VHI!)"7+))P #P"14H#&H@H "&323267#".#"#".533265+mE:P>7"(=V,lE;O>7")<+Ia55`J+C>>C 9:&V9:&H=W88W=3333v0' /]/102#".54>31$$10$$0$00$$00$ v\& \O& j&\& \& \&v\{&&A \q& \p& \& \&v\&&Lv&O&&Fj&&&&v{&&AO& v& 9v/-&9/O&9j&/&9/&9/&v/{&&A9';?#(2@<  -B7 D??9/9910#".54>32>54&546324.#"32>! Si~{54&546326gak^+5T=ql08,20++Lf<l{C@ueoMtN(_~/63$685CdC&{&?{&=lO&ƻ&Flv&vf&f&Fmv&m*& mj&&m&m&v&&@mt&mt&m&m&v&&Kuv&u*&&Euj&&u&u&v&&@*& v&\v &\ *&\j& &\ &\ &v &&@H%9D !!&0@ :+P5R??92/910#".54>32>54&546324.#"32>B|plw?B|qp<'),20+5J)LmCNoG!)LlDNoG!:VuËMC}uMHF-23$6859X@*]]/=fJ]]/=f&">&"<H*&"&"EHv&"v&*&m(> ('@) (OO!RQ????99910>54&54632#'#"&5332>73l08,20++Lf<$FJN,:&*<m*&*ű&*Emv&*ױ;`&.f3& ;`*& `&Ebf(,]@,,+ ""@)*+&P R  QS??9??2299/9/10!533##'#".54>325!3267.#"!5!!HcVT*D~oaWdaBR+g3bjfHpljG{vtL80/''$@#/Oo /]/10"32>54.'2#".54>3Kb99bKKb99bKiPPiiPP9bKKb99bKKb9PiiPPiiPfk! XX/2210!5!5!5!fffoR (3A)S@ !9$!19191 V4<V.Rb@ 9$1@!H11+n? m lok????/?9/+99/3/3/2/3//99=//99910 # '73#"&5467.54>32'4#">4.'326RfJ7$?U1ot7-(28T7gr,-% Q'*2* &$-,*$3{ZtI*>)NK:EA;!9*LE0D $/-$ & 'R.LWeҲfRR=MS@E:=]HUE=E]UEU]=/`V7XV/)@ "" @]H:U@!HUU4OBnc4p@"?&, #&l@ 0 ko??/3qr2?39/9qr2??9/+99/3/3/3/3/3///9=////99310 # #"&'532654&+532654&#"5>32#"&5467.54>32'4#">4.'326Rf=$GiF@=?506ZT/#%-6"K-di&*8:H$?U1ot7-(28T7gr,-% Q'*2* &$-,*$3{y*F4w%"q#! q LA4@ Ba*>)NK:EA;!9*LE0D $/-$ & 'R*7U8GGNNORL%R S@0(0((03V +V@KKQQ;NNLk?B;m@ 0(@!H(( "n5 pko????9/+99?2?q9/q/3/3//9=////99/2/2/10 ##"&5467.54>32'4#">4.'326#"&'532>54&+!#32Rf$?U1ps7-(28S8gr,-03Q'*2* &$-V$3HvS- =!* 2)NK:EA;!9*LE0DE-$ & '7af{ #MU &DR*7>@ 88;;<9::<<@?%R S@0(0((03V +V@ 8<<<>k9m@ 0(@!H(( "n5 pko????9/+99??q2/3/3//9=////999/3/3|/3/10 ##"&5467.54>32'4#">4.'326#!5!Rf$?U1ps7-(28S8gr,-03Q'*2* &$-V$3^ɘ{*>)NK:EA;!9*LE0DE-$ & '77wU(6  @ c?3/322/39/2/103>32#4&#"#657gk13#&,Z) {}GKE ) E/CA !+ ߲&&R&RS?2?2?/10#2#".54>#2#".54>j0##00$$0[j0##00$$0q$10##01$q$10##01$\J@   @  A C??9/3222/33222/33/3/310!!!!!##535#53!MM刲Zj-)@"%%")+(( $@8))$'"    / 'C B?32?9/]q32_]]222/33223/339////10#535#5354>32.#"!!!!!!53 ;maj"LL7w~Fel9K7o# "Ba@TꔔD;T]Z2k+UB73LD@3+U&<<&U+^_G8QD8?211/-")D[[Y AC??9/?/32/2/?2999////////32210+#3232>54&'.'#3267#"=#53573>32.#"#"&'4&+326(T[_Hc;o) (7" ~,@+: -!.!! 4E%6]UYP[`>u]8[ Gs5 /<+ |r+!;+ x !&" &-6!6H,UQVm//10!!#VTmr   /////104>32#4.#"#r4>32#".732>54.#"#"&'53267'".54>32$$$$DACB0^YX^00^XY^0D)m??m)'n@@n';$$$$k!+,  ,+!ԋgfmloŔVVooQRx=FF=.55.s!+,  ,+!N-'5IN@%..((;;E;EKJ..((+`222#6 @/22/]2|/2/9//}/|/3/3}/10"32>54.4>32#".#"&'32672>54.#"''&&?{vv{??{vv{?*vEEv*-tDCu-6((&&}#//""//#gfml 2882BKKB*#.0""0.#W/>@&0+X!X //222323332/10%'#".54>3232>54.#"i+Q`I~``}II}`ME|/Sn??oS//So??nS/@o`~HH~``~H#]@oS//So@?oT00Tod2?@)434 3.X$Xo?222/9/3210%##5#535.54>32332>54.#"^ڢSf:I}``~I:gS/Sn??oS//So??nS/QyV`~HH~`VyQs@oS//So@?oT00ToG @ //339///10>32.54>3236N1[E)32#"&'##".54>32.54>3<]A!B6,M 5YA$%?T/;q=++=q;/T?%%@U1)P(6B!A]&@W0<@&CZ47Z?";88;"?Z73ZB&@<0W@&)=.@  //9/99///3210#"&'##".54>3ĂA$=O+Dt8++8tD+O=$A?5Q7L>@>L7Q5?*&@' +, "*//999/210>54.'#"&54>3232  32#"&54>32%)NrHGQ%C]95;)NrHGQ%C]95;u%K`8MB)SC**iK`8MB)SC*hi>'-A\@0(8C.)(B3'#" !  - , ))=/3|/9/9932|29/3210>75373#'#5.''7.'#53>7'32>54.#"U"N++N#TdT!no1TdTFV+M#RdR"nn!T*Ia77bI**Ib77aI*U!qq!TdT#N+TGSdS1pp RdR#M,,N#U8bI**Ib87bI++Ib+:6@      /9/3293310% %#' 76]F\]^^E^SR((i 2@  M`/q+2222/9910 !7!%ikAxo^/10!!^VNf$@  e/?99//10!!"32>54.f3?oS00So??oS00So h0So??oS00So??oS0TT) +*o%/?104>32#".732>54.#"'GcyKrǔUUrpƔVdEx]]yEEy]]xE2LycG'UrqƔUUq\zGGz\^zGGzff-)@$/.) /|/|||101!32>54.#"4>32#".fVprǔUUrKycG'dEx]]yEEy]]xEf2qƔUUqrǔU'GcyL^zGGz^\zGGzff/101!ffff//9=/101 33fff///9=/10 fffVX/10!VXEm///9=/10%!0hpm///9=/10!mk(@)/]]/_]9=/10k0hk&@)/]/]]9=/107p24;@$m_M/Bbr/]|/]]]]]9=/10% 4hh24;@$m_M/Bbr/]|/]]]]]9=/1072 0@     /2339///3310' #7ooha8a D .@  /3329///3310 7'3Oouuoa8aD6@      /3322229///3310 7'7' 'Pnuunnn`L``L`@@      /2222229/////3310 7'7' '!!SkuukkkX<]j]V]j]ߖR "@   /9=/10 7!!'=a8aiooR "@    /9=/107 '%!5!)a8a iQouuo \.@     /2299=//107 '7#' 73`n`˹ڹ`n`˹ڹ^buubbb24XXo?10)3!4j244/10!24Ff\fe??10!f ^f\f?10!fQ3\fe??10!!33 ^3f\ef??10!!33\fe?10!fQ'` \ #'+/37;?CGKOSW[_cgkosw{E@3x||lppu`ddiTXX]HLLQ<@@E0449$((-!  q rqr!q?""r-q'++/r9q377:rEq?CCGrQqKOORr]qW[[_riqcggjruqosswrq{rqrq/33232323232323232323]23232222333333333333333333333333103#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\N`f\ #'+/37;?CGKOSW[_cgkosw{ #'+/37A(#++''//773 (($$,,441   @ѫ{x||ckkggoowwr`hhddllttqKSSOOWW__[HPPLLTT\\Y3;;77??GGB08844<>BBEEI/333332333323333233332333323333233332333323333233332333323333233332333323333333333333333333333333333333333333333333333333333333333310!#3#3#3#3#3#3#3#3#3#3#3#3##5##5##5##5##5##35'35#3535!35!3535#353535#35#35#35#35#35#35735#35#35#35#35#35#35#353535#35#353535#35#35'35#3535%35#35%35#3535#3535#3535735#353535%35#3533535#35735#35!35%35#3533535#f\\\\\\\\\\\\\\\\\\\\\\\\\^^^^^^^^^^^N^^^^^^^*^*^^^^^^^^^^^x^^^^^^x^^^^^^^^^^^^^^^^^^^^^^^^^x^*^^^^^^^^^^^^*^^^*^^^^^^^^^^^^^^^^*^^^*^^^^^^^^^^^^*^*^^^^^^^^`\\\\\\\\\\\\\\\\\\\\\\\\\bbbbbbbbbbbJ\\\\\\ \\\\\\<\\\p\\\\4\\\\\\\\\\T\\T\\T\\\\p\\\4\\\p\\ \\h\\\\(\\ \\\\\\\\\\\\\<\\\\\\\\\\\@\\\\\\\\\\\\\\\\\\\\\\\\~\Xef??9/103 ^f\ 9 X@   A f Xbe??32?9/210!#!5!3!fbdd~\+X efXb???9/310!5!3ddf\+X feXb???9/210!#3!fb ^bf\2X@  fXb?2?9/3/10!5!3!fbdb~\$XfXb??9/10!5!3~bdbf\$XfXb??9/10!3!fbf+X eXb?3?9/10!5!!fd~$XeXb??9/10!5!~df$XeXb??9/10!#!f~bbfXb?10!5!ffbf\@  X XX c ef???32/2/3210!5!3!!#!5!ff2>2Ζ~\ 4 X A XX cef???/32210!5!3#!5~薖Ζf\ 4 X A eX Xcf???/32210!3!!#!f~d2>2df\ 2   XX X cf??2/2210!5!3!!5!ff2>~\ -  A XXXcf??/210!5!3!5!~~pf\ - A XX Xcf??/3210!3!!5!f~d2>f 4  A Xe X Xc?3?/2210!5!!!5!ffΖ2~ - A Xe XXc??/2210!5!!5!~~Ζf (  e XXc??2210!#!5!5!f~~2dR\&XXef?3?3103#!3R,\ ^f\ Y X X X A Xceeff?????3222/32222210!5!33!!!##!5RRd22dΖ\ F X X Af X Xceef?????/322103##!5%!5!3~R\dΖRf\ I  AXrX eXX cfef?????/22210#!3!!#!R\ ^d2>2df\ A  XX X Xcff???22/2210!5!33!!!RRfd2\ 8XX  A fXXcf???2105!3!5!3~R̖p,Rf\ 8 AXXff XXc???/2103!3!R~R,d2f ?@  X e XX ce??32?/2210#!5)!#!!~fbΖ2 8 AXX XX cee???/210#!5#!5pΖRf 8 AXX eXX ce???/210!#!!#f,Ԗ2f# XXc?2210!!!!fff\E  XX A Xb feef?????32/32103#!5!3!!RR,R\d ^\ 8 X XA Xbe f|?2?3?/3103#!5!3RR,\d ^Rf\ : AX X e fXbfe?????/2103!!3#~R> ^ ^bf\ 5 XX X bff???22/10333!!5!RRR\db\ 1 AXXfXbf??3?/103!5!3RR,\Rbf\ 3 AXXbffXb????/103!3#~R얖bf 5 XX X bee???33/10!!###!fdd 1 AXXeXbe??2?/10!#!3~dRf 1 AXXeeXb?2??/10!!#3#~Ԗ 24';Ocw@532#".54>32'#".54>32'#".54>327#".54>327#".54>324>32#".4>32#".74>32#".74>32#".'4>32#".".54>323       7   7     ,        7   7     k                       .   w-#2 !!@! D BA C???32?/3//2104.#"#3>32#526=5J+ KT\0,]_^,NZ15farm ?Z8/P<=4E*.[\ui1w\-#2 !!@! F BA C???32?/3//210%4.#"#3>32#526=5J+ KT\0,]_^,NZ15farm ?Z8/P<=4E*.[\Tui1w-+; &&@ &&)% D BA??32?323///3/2104.#"#3>32#".'5326=5J+ KT\0,]_^,NZ14.+326;)KkB9?5) "9,a^"8'-@)`dUT0J36N'5# (( 8# 40 ?33/322/3/3/10#"&54>32.#"3267X`.UyK3W('V22Q9ql/W'0#PZ1\"B^=7M &0 /  ?3//3/10+324.+32M$9SnF¬n;Y=PEj0XK>,F`; l  7@   /@    ?3/9//23/3/3/10!!!!!! _+8RRl  //@?3/9//3/3/210!!!#! 'i^P  *)F/0! )& ?32?329//3/9/2/10.#"32>75#53#".54>32!)W3:[>!9Y>  466M{W.6_M2Y)8$D_:<_B#P  +T}SR[/07 4 / / ?33/39//23/310#!#3!37jii4j/U 6@  /@   ?3/22/2/3/3/3/10#5!#3!53D]SS SSO +/@    ?323//3/3/10#".'53265!59V;.*% #T*:@.+M9! [D?S_^ 5/@  ?33/3933/3/33/3210##33^jj |G64/?3/3/10!3!4Zj< XV@   . /@    ?33/3/9/323/3/2/339333/3310#'#/#3?3Xg"mDg# d$ch\ggUU25 3 . .@   ?3/33/33//23/310#'#3535@fLfve X')00 #?3//3/10#".54>324.#"32>X0Rl323267#".4.#"32>84,%O)-K=&,E00C,+D1/D, 3UtF[V).WNQ{V0,4C-B;]F&(FY5<`F&(F]_b$=/ 0@     ?33/9/9/3/32/3210#'.+#324&+32>byn %2iC`>);&+2LDbT$:).@(7.! 0(32(- #3I*0 $$0@  / $'# ?323/3299/3/2/3/10#"&'532654.'.54>32.#"#+MlA;p&,jB]P,;'N?'ChJ+--.W(SM-9 'N?(1H/ b10"  ,<,#C4 \ /)"  -?(>&/@ ?3/2/3/2/10###5!>j]HS/ 8'/ /  ?3/3/3/10#".53326538#Cc?Fb=j%;*PKj7Y?"  <[yIIy\< `bb`&&-9&SrF FrSVTTV%&<+%Y#'@   /2/]10#".'33267'2#"&54> <[yIIy\< `bb`&&-9&SrF FrSVTTV%&<+%+2@    @ O?]]/]104>32#4&#";(CZ33ZC(7997==[<<[=3>>3=&QQ@  A?/2/3/104&#"#4>32C>>C+J`55aI+3333=W88W=!@  O?2/3/3/3/3/10#".54>7?,7=3%;`FRG  $7"6%+O=%[m A?5%@  T?3//10>54.54>32?, ,3%;`Fo  !"6%,N=%9@  T?3//10.54>32F`;%3=7,?9%=N,%6"7$  m*</%H@ H ]]++5r*>r/%H@ H ]]++5`;'8@@ H+]/310#5!5!53n8n;k`;'8@@ H +]/2103!!#`n8nSkvC8@ ?/]/105!#vzjShvb>+/@ P?]]5`;%8@ 0]2/105333`n;kk`;%8@ 0]2/10###5nSkk`; - 8@ P ]]32/222210##5#5353nnkk`)/10!5Zkksv OR?//10#".'7326=-<#;40T%%>R0-Y%sv OR?//10326?#".=%%T04;# ;-%Y-0R>{'##  (22/102#".54>!2#".54>\))))))))U))))))))nD488@ P 0]]/]10#".54>324&#"3264J/1I/3K0\ej+1,-)3,-)C2/A((D1_X)93),75uLO]/10#umkt%88@ ]2//10#5!#5!tnYnt(4@$! @" 0  )]9/910"&'#".=3326=332>=36?A52E-n1$i$1n-F'#"(4F(%5((5%(F4oB/C@pO/HHP@ H ]]+]++]qqqq5o@/C@pO/HHP@ H ]]+]++]qqqq5+K/G@p0/HHP@ H ]]+]++]qqqqq5+/?@pO/HHP@ H ]]+]++]qqq5E/C@p/HHP@ H ]]+]++]qqqq5-49 H/+/10!5!9 ̅ffOf'OO@]5]]]]5EnE@H H++5{I fE{ f9wBwm*T<( h*T<( hT gT g>*/@ ?]]5t-88@@ 0]2/10!53!7t}nSm#:88@0O_ ]]]]/]10!!735#mukRukr > 8@@ 0@!]]9/910.#"#54&#"'>32>32)1$i$1)m-@,5A?6,A,#+5((5*#!9)("#')9"q9 &@/?O  0@ /]/]10''7'7LuuNuuLuuNuLuvNvvLuvNvq* Q@&      r?33/333933323/33/33393333310''7'7LuuNuuLuuNu*LuvNvvLuvNvC%K K ///10532654.546;#"#0:)2)pj%i*1)vcCv (!7>M7ZguI 7?N6]dMf'OO H+]5f-'O7O@@ @ H H+5+5*<{=r*>r{?Ct2 @ H+5t @ H+5f'OO@]5]]]]54@ p@ H/ H+]]q+qqq55vr/#@p/@]]]]qqq5;S@.  @ H  /  /]3/]32/]33/+9999/99//9103267#"''7&'&#"'>3278(=V,lE:'9w=")<V+mE:(3x7+VHIz87+VHIl= H+5+?m1@;'' 666o666@#,, @ H`p"/""/]]]q3/33/+]33/]q/9/3210>323267#".#"2#".54>2#".54>+mE:P>7"(=V,lE;O>7")<$$##$$##HI"("7+VHI!)"7+#""##""#&EE-  ]55'EE5HHHH H+++++55F; -@    0 ]/32105!'57!<S//z&8@]]3/105#73#/C&8@ @/9/2107'5ddk4C c H+5x 8 O?/10".5463"3/H2i]1+,-m2C)Q_U8*(5x A?5H#0@  o/]2]/9/10>32#.#"".54>32 <[yIIy\; `bb`&&-9&RsF FsRVTTV%&<+%X#0@  o/]2]/9/10>32#.#"".54>32 <[yIIy\; `bb`&&-9&-RsF FsRVTTV%&<+%q(@`]]]]qq5@$@ /]/99/310%5%j4kd@&@ //]9/3107'5ddk4@ J@)   / ?  @   /]92/2]9107'5%#3#'⪪ok4jdddk4B'8@@/ ?  O?2]2/2102654.#52#*:$-N:"":N-9:*%j 8L++K8 T'8@@ Z?/3/3/102654.#52#*:$-N:"":N-9:*%j 8L++K8 2RSl?@       ]]933/3229910'#7'7'7'37" G " G #;]]:LM:^_=LD+7P42,4  &4@,#/ )5P ` P  8]2/]q22929/9910#"'&'#".54>32676324&#"326%4&#"3264J/1%#"%/1I/3K0\2#&0\ej+1,-)3,-+1,-)3,-)C2  /A((D1/ _X)93),75()93),75vC-@ //9910#33#bYo:Yo)vc@ H@H++5@j    ]//10!".'7!267jGF5q@hK[a`jc    P?//10!".'7!267jGF5q@hK[a`j'?NO?/10!5!?Ʌ'?P!'?!@&W@  @P?/10#".#"#&>323265%"HkG7XK?=<";9#GkG7XK?=<"?6I=i_5%-&LP3 -q5FG2`a[Kh@j&@ @H @ H ++5;`%@$4D]/]105!5!}wS/kK );/ )#/  &???9//10'#".546;54&#"5>32'#"3267,d1.B+yvy=?-V0#b61Q: hvF?(2 S.D*$'6M["/6T *?+3+*%(K)< *#6#//@   ??9//10!3267#"&54>326&#"*}/B'0c#&j3#B]:8Z?!iHG>L/ ':% N |6aH+">X)DQPE<*+W 8 ` /   ??]?/10#5!3!532#"&546H ,, !--NONN****W-,24H&+HH H++++55. 8#*/@/ ??/]10#".54>324&#"32>8&Fb<:_C$&Fb<:_C$iSH*;&SJ);%;cG("Cb?;cG'"BbB_Y2C%_Z2D.8/Q 5/ /  ????99/10#'#"&5332>73]0Q/U]g] $)gS5(^^Mu )NQ1W"/ ??/10#"&54>32.#"3267%Q))Je<*M"#N&$?-XU&L"( 3253#'#".732675.#"E)Id;2h^Mj/I2k85#N+7KT AfE$1ak%C^?^U8< YE!5# 24H '+H H +++55Q0 / /  ????/10#4&#"#3>32g.+ $)gg,Q0PbA<: )P2']]Q7! 24H ''H H +++5I,V. # . ,.O ,&# ???99???/]104&#"#4.#"#3>32>32 ^  `R5&'4-,!o/ -!f" .$a:0 *69%7%I9K*/ ??9?/103>32#6&#"#K`0R.T`h++#%*i_80geC3 )K;;*7 / /  ???/10#"&5#53573#327*!G#fggy2FV[OOo;*n= H +5!D+@ @???3/910373#!upuSUP!D?G 6@     ????9/910#'#'373GƁ|GAs+,5@@P`O_o'",O /2?2/9/9]]102#".54>2#".54>-!!-+!!+_I2,  ,-  -s",,!!,,"L^",,!!,,"C)s+,?@#O'_'o'@P`'",O /?99//33/9/9]]102#".54>'2#".54>T+  +-  - I_-,!!,,!!, s",,!!,,"tL^",,!!,,"E)G5$@%% / * 7/32/29/10>32".54>54.54>54&#"/,, 4)! I%        @ @ O?/2210#"&5332>7&Ηv{-'3N<+w{*:R5@ @/]/10!5!7mm@ @/]/10!5!7mm@ @/]/10!%3!mm@ @/]/10!%3!mm@ @/]/10#'!5!@ m@ @/]/10#'!5!@ m@ @/]/10!#7!@ m@ @/]/10!#7!@ 7m#B @ /]/10#'#%373Bܒ#B @ /]/10#'#%373Bʒ$B @ /]/10#'#737B$B @ /]/10#'#737BK; Q?]5'@O?9=/33/33/310%5%AC4kdd+V? A?5@ @@!  ?    02]292/22]29107'5%73#3⪪dj4kddk4 +8a 92(,õ@"/!?!!!0@9323''A(C??9/99/]]9/910+#.546; 4.+3264.+32>Iu(2  er5_H**PsHHN+r(G3g6Q   #2  @ $ A C??39/21032#!.54>;4.+326Px{?Is+'=Xe'$LwR͙9dN]h7 "@2j5V>!'| +!"@ "!" DB??10>32#"&'532>5&#"HW֒LR؆[HH[\h8*IEC$MS '(A\3/F !/1)Ǵ0$ @ !!! B///,D?]?]10%# 4>32>32.#".#"3267㟪R؆*M%"0')Ey'#0(?)@ /o&@0)& %A&C??9/]]10+#.546; 4.+3 ?d{  z,'2fh ^yV/  &= B v5Z1@ CA??9/310!5!!".54>;;#"sI?{xSvL$7h]Nd9r}!>V 1 @   CA??9/9107!!5!!5!!5–;-*)3 IJ)@*$DB??9/2910467!4&#"5>32#".732>5;41faX#OlڏFAz;0VyI@tW3g/?  %[k_r33qm+2;& Ĵ,@3 '$$/B/D??9/99910%#"&54>7.54>32.#"3!!"3267Of*H_5re9oirJXTNf>(Hd=HtQ+|K'μ>jQ5 %jO[1#:L(8R67O2y&3@A /?9///99//210!!!#".'532>5!EsX*& ';"2!XMa8 7\FB3<C!2)@ !=7.&&B D??9/910.#"32>7!5!#".54>32>32.#"I[ho;0fo,,))\^^,חQZ)N&"0b D@   ճ @A  CA??9399?/2/2910 ! 3 !'b1& >ds!8Sh RS??1033267#"&'.5 6-0O.30Eb#9+0U &}\&  i@  ?   ]]]5!1@ AACC???9?/3210!##3>32.#">3:H31 (#! %'@- /!Z +M#s *t0t@*,(D D# CA AA????9??]39/91032>7332>73#'#"&'#"#'/  '0!.hHQL-7B*/<#,OA7D& (QF\W]^'D3# [:  @F  CA A???99}/|/?//9910232>533##"'84;kn 9N.Qs/m 9/-f(,Jt$$ t@  0  -@ (BDC???22]9/10!#".54>32%32>54&#"`'D\5Y}N$L}_$90,<4# 3,0;! hRl@KV,ņE#;,J;E %<$%% H@#$CA?2?99////9/2104&+3 "#.546;2+#RWG:&=+ aK7yC2$&= B +`mP|M+\&H!ij! @ ' ! ! ! A C??99//922299310#.+#3324&+32>.5?'Tri1$GiD7M(Nw?eG'0?%^2ZM=mYA_OihP9S-3.+ #@4 #(1D B??99104>54&#"5>323267#"&9]x|x]9~-RPO*KXum39]v|v]9>iOxK"\hn4bKqYD<8@M2ZK  3Z|HFlUD=:BN21L5   o+ I@  AC??29//10!##"#.5!}EM V}E9&9B VZ! @ A /?2/103267#".5!5! :/.>W-PqG }7-I4  *QvL옘+;+L***'ò+@', "D+A?2223?3299//10!32>54.'5!##".547#+BZ6#MzXTyN&8XA{sQiz:o*mcjILe_o,QM[鏺Wm)'-  @ ("B AD???9/10#".5332654.#"5>32=vozk1BiL 9/ 6J$PpFl{C@ueoMtN(8V9  ,WVf#;@  @ AAC??9?99310#3>32.#";P)eH4  +-DbXN"oA@     CA?2?29/32910!!5!!!!!5!pshyAzp="D  @  @# D A?2?9/399//104>75!!#"3267#".KwE\EcT&"PbH?6xNЀ8dZ/~|w$Db=;^B#  Aq0#Cv@ $AD??9/3910#".'532>54&+#5!!32TtCB?6HPZ0WY;?Z^Uas@ &Ge?zo"UOY{%,m#u@ @ +(,*&&ur -"s@@*&(++"$A! C A C???2?2]2/39/910+324.+32 !!5!5!373#s+2(5BP2g``6R7 m,1##ll]3" v5 `ggOX%,ku@@,)&+'#!'!!' ".r@@ -*'),"$O! Q A C???2?2229///3910+324.+32 !!5!5!%'373s+2(5BP2g``6R7 m$9čqr]3" v56Ւyy}9  @AC AC????9/10#52>5#5!33%Uh6K-@nVT`41R?}}\ -C).(@$O VAC????910)33#"&'53265#52#".54>n.Q #,0r^@2%%22%%2}T&  P&21&&12&<* L  r r@AC AACC???99???999910!##33!#52>5#5uNh6F(5TwVT`41R?<^: !5Z1'   r r6"(@,!OV AACC???99???992210!##33#"&'532>5#52#".54>u#O^0@>%9D% 2%%22%%25Tw&io9 $HjFP&21&&12&\{&C{& C/{&C{&Co& j& l& n& p\o& j\& r=P&(JBe-1Y11 /%@2 1?O* B*D??99//]]322229/310!5!5!3##".54>32.#"32>75!6qq)[_^,חQZXII[ho;0fo,,) T]"'+JsxF {& C{&C9/-&U/P&'UJ{&COJ  @u r@ !AC AC???2?2//10+324.+32 !!5!5!s*A^~dg6R7 m,1#^yV/v5 OJ  Mu@   "r@! OC AC???2?299//10+324.+32 !!5!5!s*A^~dg6R7 m$9^yV/v56Ւ{& ?Z !B  u@ CD OA?2??9/?//9/321032>53#".5##33 &% =dHZn;6ET-,H4\PZ0>`r5%)gf!!8 Ĵ!"A@ !DA??99/?10>32#3>54&#"=SiAcf5mΏKup?dO<1*:l`BaAዐ+32{&=2\{& t\& v{& t& v{&  t&  v/{& t/& v{& t& v{& t& v"Cֶ@#A D??29/399//10#"&'532>54.+5!5!8ЗNx6?HbP"&TcE\EwKVuD  &Fa;=^A!w,V{& Cwf-;x@  x@   BA C???99/]]104.#"#3>32J":N+ PX`0,adb,NZ1fJ?Z8/P<34E*.[\h9IL*!4!4!4 :D$A?@ //GDA??9/99?//99//10#".54>7.54673>54.'4.'326*Id:=sY5+ii+5Xr>:cI* "=!5!5!e:X9&E9#shZvE ";0c\&S&T/o& j/z& y/&S/& rfP&JT& gT& g0& i>@ ?]]]5T& g*"@$1X% ,!@2 !,C+A??9/99/299103! #!#%4.+3#3264.+32>ver5_H*Iu=*PsHƼ+327"32>7.%,@ ;Z> =I[9bwCOi[v*UZ|N#"CeC=aK6%~0:  FpQ6(SQ "QitL(>M%-(I#ij # @ )## "A CC???9/239910!#.+##53!24&+32>.5?'T^ri1$GiD7M(Nw?eG'0?%GF2ZM=mYA_OihP9Sg?@  @   CAA???9/93322/2291033!33###7!׏̘< \- D\&&Sv&&I%'@,o,0,,,, ,P,O,,,]]]qqq5{&.?&Smv&&I%'@o0 PO]]]qqq5m1& )@&&&&P&P&&&& &&&]]]qqr5&@%C@pO/HHP@ H ]]+]++qqqqq5& Y& c&@%C@  p O /  H HP  @ H   ]]+]++qqqqq5&E%6@p/HP@ H ]]+]+]qqq5&&TL& S2P& J2& Sov& {& H4& T& K/E@#p0/@ H ]]+]]]]]]qqqqq5& E%6@p/HP@ H ]]+]+]qqq5&  l{&?v&&I%'@o0 PO]]]qqq5v&<(vP&&<J(2&I2%'@o0 PO]]]qqq52&@2%C@  p O /  H HP  @ H   ]]+]++qqqqq55{&?5&S1v5&&Swv&&I%'@o0 PO]]]qqq5&@%C@pO/HHP@ H ]]+]++qqqqq5/z& V/& d/& Y/& c{&?&S&Sv&vP&&J&I%'@(o(0(((( (P(O(((]]]qqq5&Sov-&f& e& _v&&S&SVv&&I%'@o0 PO]]]qqq5&@%C@  p O /  H HP  @ H   ]]+]++qqqqq5m&&E%6@p/HP@ H ]]+]+]qqq5&@%C@pO/HHP@ H ]]+]++qqqqq5z& V& \b&Fvb&9&S-v9&N&SN{&Hf&S{&Aov&&I%'@ o 0   P O   ]]]qqq5&' i!s i!@    ]]q5]5&E@   O  ]]]5& i@_?]]]]]5^)4C/*#"ij*/@ //"C.A /??9/9/9103267#".5!2#.#4&+32>\ 1"4<#XrB^ri1$GiD7M(.5?'Nx?eG'FFS,  .WzMq2ZM=mYA_OR0?%njgP9SoH D4J @  @ A AC C???9?299//3/310!##33 3#Q _Ko 2@   A C?2?23210%#!5!5! she? +1Ƿ DB?32?32/3/3/1063 #"&'532>54#")R؆[HGZ\h8TGA` ')Ey'# ,@ CA??9//3/3/3107!!5!3!+F!@ CA??9///210!#3!kX.H&@/ *R! PS???392210353!!>32#"&'#4.#"32>!KbVX,ErY[H2N6!DIQ.3j032#"&'4.#"32>KbVX,ErY[2N6!DIQ.3j0.54>;>32#"&'H2N6!DIQ.3j032>32.#".#"327ELw~BJp@(>R04*'BHCwZ4|%A|wŠKBY7  4("3`W@m#:  @$R S!P???992104>32!5!#'#".73267.#"mFo0]-ޜIcVW,kbBQ+h3ljG {jfH{vtm+@Q,1 ;'@1A ,, 6"T R??9/99]9/9910#"'532654./.54>32'>54.#"?:)R~KytH? 'Sa=+EfYoo7:bx4`T1&IiD@a? .H89h?0T:!"%!!$uHpuoF3sm_L*JahTN6^`N[21VqR-SYY0+\%G @ &%#TV?32?329/32/3/3/32/22/10&#"!!#"&'532767!5!5!2xV}[T=t25::X1/{_r9_KRp: HEɑZ -=-- # @ .(R"OP SQ?????9/104.#"#3>3232>53#".5&LB*_93R9 &% =dHZm:4C'gcA4#KtPET-,H4\PZ0>`r5f#6  @ $ P OUQ????9910#3>324&#">7bR %PV[2VX,`m!DIQ.aVoy\;k3G,Dqm1Q<1h'K  @ TQQO????999//103 ##4>32&#"d),#N}Z+[$`Q,8" -1,[Y+ 6M& fJ&" fX&( fB?+H'@#(#%)*%%+% 'QR T???9/3/3/923107.#"5>3273:7#".''#'ض4$7E!T $A:4EL   6*)?3*/5"St"  *"asfT",  2P8{`lfd%A%~&@ %#P RQ???229/104&#"3265##".54>3242'9'%<-7,yVxL""LxWjQ882_UZb3?HHs~EzuJ:f#49$/!@TU!2 R)P??9??/22/9/102#"&'#4>32&#">4.#"326VX,Ki0_1#N}Z+[$`Q,9#J 2N6!DIQ.0j3HrȄB \[Y+ 6M0aOO^51Q<1.* #@2# &-R P??99104>54&#"'>323267#"./MbfbM/XbOY*OQV0dS$/LbfbL/_h\]X[Rc7=YD2*)0>*33  .I^0>^H8.*.5# ( @(#U  OR??32?//9/32210"&5!5!7!!3267#".'532>=Ͼ=sp0q?:\B/,& H((0 -mjB[: 0+?&6@   "TOR??32?/3/99//3210!!3267#"&5!5!54>32&#"=sp0q?<|B"N}Z+[$`Q,8" -Amj  @[Y+ 6M;`^#:@! ##$%#!OV O???99/332210>32.#"#"&'532>73' _H;  & 5qc*40SJD o3N[K#O<?dGh=@      QO?2?29/323910!!5!3!!!5#3NIۓ};$C  @  @%   O?2/9/399//1074>75!!#"3267#".KwEO8cT&"PbHr>26>'Ѐ8\dZ/~xw$Db=;_C$ Aq`8T2@ +-11+1+1%. @9% +,221./OV??29/39999//910%3267#".54>54.+5!5!5VnsnV5'F8@R $-Kb94UlrlU4'Wc8O.`[O<#ToG& "!( 7YB@M-)G<9M/w.*D`%E$ @ &!!OR??9/3310]#"&'532>54.+#5!!32?̌Bi*38:YY-0Tq@FW$'`Jha[+/P?=I' BE{,P 18@@)852733))9:!@$ 9)*&RQS-@P7358OQ?2?22????99/|//333/9310 !!5#5!4>323#'#".73267.#"'373=@FtV& "'&Me= /'- 2< h{bdx`6ՒljG{AF{[Z,-^Eyy*\ '1X@ ../#,@12)/1-.Q(*S(@ O V????/39///10#"&'53265#52#".54>#5!3!53.Q #,0r^,2%%22%%2z&  P&21&&12& <^:)E\,DE78 EF%@DQC,18Q>1P*O(@ O V?????99?/9910#"&'532>5#52#".54>3>32#4.#"#)#O^0@>%9D% 2%%22%%2$2A,NY- ".)$&io9 $HjFP&21&&12&[f*#,QqF6!5&$-&B&B&B&B &B&B:& kO& m& oO& qv'/'@ "RP??9///310467!4&#"5>32#".732>7vY@Haw9YEX,/,>YEX1/1>YEX/>YEX/>YEX-/->Y1ܹ A ' 7 G W g w ]A ](A]A(8HXhx ]1,9015!3267.#"3>75#".54>327#".'f3M4BQ(e9WO!)Jte XW+9w3d8 zzn+T]2vtU!sHol“V'⭛<'EE\&B2'&C2(\ &U  N&'UI &>B\H&B\H& B,J 1M@  3)!@ 2&RQS-POQ?2?2????10 !!5#5!4>323#'#".73267.#"=@FtV& "'&Me= /'- 2< `6ՒljG{AF{[Z,-^\&>4&<4&&&&&&&&&& & &&&.&2&6&&.&2&6&&$;  @ % OX??29/39/10%#".'532>54.+5!5!8З'>62>rHbP"&Tc8S EwK\VqA $C_;=bD$w}l/Z{&C@ @H@H++5mce5CQd'D00LV*Q+<6@OSS? P'0D$*I9R?9?99?/9/9910%#".54>323>32#"&'#4>7.5327.#"32654&#"IdVW,FobX(e20RjfHpljG ,7O00O94$,88415:"ܷ-^!/++/0h;OL,#6#6#6 <F&SA @ 11KRS??9/99?//99//10#".54>7.54673>54.'4.'32>*Id:=sY5+iYeE+5Xr>:cI* "=!5!5!'JjC:60(x7ӓ]P$ ";0r}ݒ/&Ru&T :& k {&&EI-#@B@HBBB@ HBBB]]+]]+5 &R [& s`N&IcJ'5;@ ($&$6V@ 0%'S-3 /?/9910>32#"&'#4>7.5!532654&#"(e20R ,7O00O94$,88325:"!/++/0ck9G\VB/1.@ /:$@$/H(7P2-.1O: ?E .Q?9?99?9910>32#"&'#4>7.54&#"#3>3232654&#"(e20R ,7O00O94$,88325:"qvq/P32#"&'#4>7.5!5!7!32654&#"(e20RZ ,7O00O94$,88325:"J-!/++/0<*%4CX911!0??+@?DS5&P<. QQ??3332?3332?]]9/329910"&'#'#".54>323>32"3267.!"32654.0M"~"M0Sk?!N^**^N!?l.9D$ 9D">#'#>"D9 $D'<<'EpljGkGǀpEp-^b#[#b^-3273>267.#"!2>54&#"Rl?!N^**^N!?kS0M"~"M#>"D9 $Dw9D$ 9D">#EpljGkGǀpE'<<'#b^--^b#[NT`(& h$`N8.@6@%O6*ER1*PV???9910267#".'.'.'53265.'.54>32.#"#': 5N;-'0<(!A XW~w5h[DsT0'^x0 D?+'*2G^@*dV9 #/,))9FX8NnF! !),'\)#2ݲ"#@$" O#Q V??2?210%23267#".'.+5!5!MoP8$.>/#5: TkF0-=R97ӓ'?Q+'F6 .IZ,!=.}ݒ//3β@ OQ??9/]10#32>54.+5327dU u=[>3273267#".5327.#" XW+9w3c9%,@ ;Y< 3M4(e9Hol“V'0: FoQkT]2'=&5 f5@ p@]]]5I&. fW@ p@]]]5'&2 f5@ p@]]]5D&6 fR@ p1@111]]]5`G"K@&   #$ ! VOO???9/99/322221033!33##"&'532>7##Ɛ;5qc*40SJD fg{{<?dGI`(<: 3 )$..V8/?9///9/3104>323267#"&'.5#".732>54.#"I*Kj@KoH# 6-0O.30Eb#9+8)@gI'++++@jM*0UwG0U &}\H(Ji@/""/.##.-(N@ '" @ ")(#"C B?2?29/329/9210!>54.#"'>323#!!5>7!"6V54.=#2?C?2@Xl=/;=;/Ώ+&!/HgIKh>9S7f)f#//]10#3#3)fffF v@   //99//3232/3/39/332210!!5!3!!!!#!9^ǖ`mD&F&RFv&&I%'@)o)0)))) )P)O)))]]]qqq5&>&Rmv&&I%'@$o$0$$$$ $P$O$$$]]]qqq5m1& 21@ -5H1111P1P1111 111]]]qqr+5&@%C@((p(O(/((H(HP((@ H (((]]+]++qqqqq5l& Xl& W(&@(%C@**p*O*/**H*HP**@ H ***]]+]++qqqqq5%&E%%6@-p-/---HP--@ H ---]]+]+]qqq5&&TK&Rv@ O]]5P& RvP1& Rv\N&IM&RMv&&HP@ /]]]55a&T&K/E@###p#0#/########@ H ###]]+]]]]]]qqqqq5&E%6@!p!/!!!HP!!@ H !!!]]+]+]qqq5& E%6@+p+/+++HP++@ H +++]]+]+]qqq5&E%6@7p7/777HP77@ H 777]]+]+]qqq5&E%6@ p /   HP  @ H   ]]+]+]qqq5&E%6@p/HP@ H ]]+]+]qqq5&E%6@#p#/###HP##@ H ###]]+]+]qqq5O& m'{&?v'&'&I%'@o0 PO]]]qqq5v&5v&"v&(v&'Iv   HO  ]+]]5v&"&Iv)))HO))]+]]5v&(&Iv555HO55]+]]5&I%'@ o 0   P O   ]]]qqq5&"I%'@o0  P O ]]]qqq5&(I%'@"o"0"""" "P"O"""]]]qqq5&@%C@  p O /  H HP  @ H   ]]+]++qqqqq5&"@%C@pO/HHP@ H ]]+]++qqqqq5&(@%C@""p"O"/""H"HP""@ H """]]+]++qqqqq5 &> &RZv &&Rv&&I%'@o0 PO]]]qqq5&@%C@pO/HHP@ H ]]+]++qqqqq5 u& U & Z l& X l& Wf&>f&R&R&.R&2R&6Rv&^v&.[v&2bv&6vN&&IvN&.&I[vN&2&IvN&6&I&I%'@o0 PO]]]qqq5x&.Ix%'@o0 PO]]]qqq5&2I%'@o0 PO]]]qqq5&6I%'@3o303333 3P3O333]]]qqq5&Rv&& ]& ^v&&R&R """]5?v-&-&I%'@o0 PO]]]qqq5-&@%C@pO/HHP@ H ]]+]++qqqqq5&&E%6@p/HP@ H ]]+]+]qqq5&@%C@pO/HHP@ H ]]+]++qqqqq5u& U& [&EBv&B&R%vB&)&R)}&G`&R&@v&&I%'@ o 0   P O   ]]]qqq5&I%'@o0 PO]]]qqq5t&G"@ H"+55B&M`&M$&$P&SP@ `0]]]5&& fK fK@  _o]]q5]5S&"' faK faK@_o]]q5]5&(& fK fK@  $$$_$o$$]]q5]5*T<(& h*T<-& h,8  @ PS QQ????10!#4&#"#3>323#oWQ#=BN3)OOR,e ur/P7'.54>323#>54&#" H %  6R77U:*>(+vn* %"  |B0d9)F43E*/LFE':&S*(#D  *@  Q O??9//3/9/10!5!!5!+% !@ QO??9///210!#3!쯯IbC"69  +@ 0R&PP?3??//29/104.#">%4>74>32#".{!7*!+ A_?2EGl30#7_H$Dc?XwI .r”cmH+SY/4R:32+3267#".532>54.#"!R]VzO%ruUX!QZb2[e6A^<(@.327#'#".73267.#"m9w3d8 XW+3M4BQ(e9l“V'HzT]2vt%3 @& !P O!R???910#"&'3>324.#"32>ErY[KbVX,2N6!DIQ.3j032#"&'4>32&#"4.#"32>N&MSY1VX,ErZ[#N}Z+[$`Q,8" 2N6!DIQ.3j032#"&'532>54&#"ELw~BEwN?BHIyW/|A|wŠK"3`W@h0;S1O& U6.@<)"P19ȿR?3]2?9/3/3210%>32#<>7.54>32.#"2>54&#"0-Hc?+F3-Z]JpN?BHCwZ4q&I9#4P&YK2*A,1VA' )*$ %)( wŠK"3`W2 " Jm`%3B,&4@VS +,/ P)R??99??10%#".54>3233267#"&'.5327.#"IdVW,FobX5& BT#Ih#&#jc+h3GpM)jfHpljGF6W'%)uJX-^m 0?!@)10.!$ .P$RQT????9910327.#"4>32.#"#'#".54>32jc+h3GpM)%PZ,,3,8" IdVW,FobX췲-^[Y+6M0ӾjfHpljGv'1 '@('R"P??9/104>32#"&'53265!.%.#"v9oilu=9waH@YB)E^9BdC +kyBTjzF2>CpP,-PoCv'5'@ ("RP??9/]210467!4&#"5>32#".732>7vY@Haw93232>5 "&(/6AJ"TlJe;! %?[?#<99 $::B*]f@1H/9H)N-4 v 6-%jT4im"7]D&  2]S5`K,0^YfMY@ @.?7-*E@N7@ .?;4ΰ  %JR%P??9/]9/9999910732>54.+532>54.#"5>3273267#"&/#"&'XHUqCApWLa8:`G'DDL.)LLN,v`(X (/5;6\C'3tIO);%$;,&6#"5%   'F`9!A# v 6-%)%=T6BqQ.e:J@ 00)0)0#8@;)**3 PR??9/9]99//910".54>32'2>54.+532>54&#"^wEJpYd6,?%(I8!;nW8Z?"!9O-ki%E6 viCwZ4A|wŠKEmM!=5) $9P6IsP**D1*8 !:.FC3`W\A? @ VO??9/32//9///3210!!5!3##"&'53265!^:/T);7&P5Q V???999?10.#"#"&'532>=7#".54>3254>32327.#"3,8" fRXWJa9 XW+9w0]4#N}Z,,fdi(e96M0y5R9_D~ol“VQ[Y+amZ!-?'!"@.VP ('+ P%Q??99??10%7#".54>327#"&'532>5327.#" XW+9w3c9fRXWJa9 di(e9+D~ol“V'5R9 %9##!@&#$$ PR??9/]29/10%#".54>32.#"32675#5!FUs|AJpN?BHCwZ4-TvI*@- A|wŠK"3`W[\. Bb): %@*"UOO???99103 3#".54>732654.B1%~.$7W==W7"0d %!# n)QLE*K9" 7K+ DIQ-|2.& #.-$)./y BJ.B=(3  @===CB.%8R*%OO???9]]91032654&&#"5632>?>32&#"#".54>77##%!# & 80$0($  $(0$0-."4V==U6#/N2C#.-$C4 '56' &D?;*K9" 7K+ @AA!f3  @  RU OO????99]10332>73#7#"&5WQ#=BN3)OOR,ur/P<z1C*'6! @ (#TQ QP??99??10>32#4&#"#4>32&#"N)OOR,WQ#=BN3#N}Z+[$`Q,8" -A1C*qur/P32#".'532>54&#"#4>32&#"N)OOR,/,& H()WQ#=BN3#N}Z+[$`Q,8" -A1C*ℋ ":+ur/PYi+,i+%i+,ии"01!"&5!".54>32!5!!!;";.]f(I8"#29:ZH8  "$*,fXl'B21@&,?FF&')#`$  VS??//9/103267#"&'.5!5 6-0T.30Eb#9,F0U &}\b0*U$ʵ! #@+$$#"O SQ/???29/329/10%#".'532>54&+5!##5!!06s}'>62>rHHhC  I"NLF4 \VqA $C_;zwex(8NfZ -G% ,@*R"R %QO OO????9??//9/1032>7332>73#'#"&5#"#'/  '0!14;$QT.5@*//<#6YAB7D&4ZF9P1ip4Q7#Zf 3K+ 2@2"+ 0R(RUO OO??????9/]9/91032>7332>73#4>7##"&5#"#'/  '0!-2;'QT.5@*//<#6YAB7D&4ZFz|:=96O3ip4Q7#Z^ =T.*+6+@+;P$3P.6)*,O*QQ V????9??/]9/910#"&'532>54.#"#4.#"#3>32>32 53>32#4&#"M@pX#<4"1 ,QPR,WX =BM08Ma8 7\F4E*qvq/P<^'4' @ "VP  O Q??99??/104&#"#3>323267#".5WX =BM0,QPR, 1"4<#XpAvq/P322>7!"!. B|plw?B|qlw?)FgG(}CdG*@uËMC}uMC1TqA-Oi<\ "; @  QO?2?29//33/9/210!!!!!"&54>3!"3:7& 332jqN_5:\D  ZʒuG8`J]W)C:@99%/@: R::4* P4R??9/?9//9/910%#"&54>32#".32>54.#"32>=1 *@2=z|~{=2@*E' -7 Fx[]yG 7- '5'wɑRRw'5`]-UA'7^~GNnBBnNG~^7'AU-])f?^, @ O RQ???9910!#'#"&7332>73YXSP#GLS0k`Ȅw7V=^, @ S RQ???9910!#'#"&7332>73YXSP#GLS0k`Ȅw7V=^^%3% @& VO R??99?10%#"&7332>733267#".5-TTT,SP#GLS0 1"4<#Xo@6J.Ȅw7V=FY3 5]Mf0@ U PO???99103>32#6&#"#ɟYXSP#GLS0k`Ȅw7V=^%5%@ %& V PO???99103>32#6&#"3267#".5ɟYXSP#GLS0$5"C !%$ \vDk`Ȅw7V=WFY3 1X}M#  @ Q P??104>32#6.#"#%>S\`,Xp>;X95W?#xS{V7 -]cBY5:cNa# @  PQ??10!#4.#"#&>32#?W59X;>pX-_\S>%gNc:5YBc]- 7V{S(A#̳ # @ )##" O QQ???9/9910!#'.+#!24.+32>ɇ5;C'T^ri1!A`?0-,v!@]?34.+32>t,-0?`A!1irT'C;5'Ge?<]@! ,C1! .C[=MoH"4.E6D% ">^ED<+4! @F!<70PVR???999/10#"&'3267#".=3265.'.54>32.#"NzF2Y* 1"4<#XpAXW~w5h[DsT0'^x32327#"&5YWQ`$[+XXNb#\+-_q ap 7c0>M 1 1,$7V@?.(T1:4 : U?9/9?9/9910#4&'#".54>32>454632&#".#"32>   'kG2U="!10/7',"-":52388,$49O00O7,  q'0/++/!',2 @   QB??9/32/3/9/3210>32!!#!5!4&#"<|B=sp0q? 2mj?T-0  @ O  OV???/2210#"&5!5!7!!3267<|B=sp0q?p -dmjd"X  !@# R QOO???99?9/332231033!33##'#"&=#2>75!ˮ-QPQ- =CM05WW4E*/P=I/F&" " "  +@ #0# $OR??3299//10%2>54.'5!##".54>7#5!-LmE 'D4t6D'=wppw='D6t4D' El=`x32#".54>54.'332>54&#*T% ZxF5_iUrB  (CX0Uf6:J")\jGa8-\\6rnd($?9636>'-dik4:V::y}uB'@  OQQ???/3/3910!#'#357l%B<@  Q  Q OO?3?3?9/3?/33/3/33/39103373#'#'%ӑ!͑T+}-N\fl=Q;:ӵ@  @@ Q TQ???99/33103>32.#"#';V5rc*40SJD 3:<?dGlE" + @ OQO??9?/29210 #37"kl>=p|qo|}: @OQ W??2?210%3267#".=!5!5!$9E&9X:x7ӓ08 AsZ\}ݒ/yF+q+}@ ? P@ # #0## @ , O  Q&O+Q?]]?2?2]99//]10!##>7!5!5!3>32'2654&#"]  72LjJB9%'@T#($!-&B($D}ݒ/!SJ2*I99L. "*$B ε @ % O/?29/39/10%#".'532>54.+5!5!8З'>62>rHbP"&Tc8S EwK\VqA $C_;=bD$w}l/Ztf0?sδ;@ $4,++@ $@9)/491+ 9QO?2?]99999/2999/10".54>32>54.+5!5!#.''267.#"P}V-#?Z7ChO75+&Tc8S EwK4W@ ?X3!)6#[(>#>V36O4/I[+#qC=bD$w}l/Zd54.+532+Y]LLf>;#";#."GߘYl<>fLL]Y+rtÍO$WkJ]5 W"- @ SQ??9/10+532>54.+3GߘXl<>fLL]Y+tÍO$WkJ]5q WY% @ &!VP??2104>32.#"32>7#".JqN? FGDDwZ44ZwDDGF ?NqJ#O4ݨނ5M9/-%9B5+ @ :0/00&&&&&#B#D??9/]]9910#".54>324.#"3262#".54>/'FasD{}?Ufz~@#N{W$MzV!9++9!!9++9˘f@J@K~;~;+:! 9,,9 !:+)=' @ *&'O'Q??9/9910#!!24.+32>4.+328h[iĨ_U)G5.N;/L67N1*HpK'{Qs $8Mx2$"6%3 e:C 00!)6@; 1..&PR??9/99/910".54>7.54>32'2654.#";#"`n;!8I(&>,6dYpJE4ZwCiv 6E%ik-O9!"?Z*PsI6P9$ )5=!MmEKw|AW`3CF.:! 8*1D*$6F552"2*@7455/ % P/R??9/9/10%#".54>32>32.#".#"32675#5!FUs|AJp8AjO#<4"1 BHCwZ4-TvI*@- A|wŠKCoQ- 3YF"3`W[\.  - @   O Q?2?39/2210!#3!3#!M̮4g3fh8G_9 /AX'4@46'H9/> F"*>R(@ @H 57O?+?99999102#".54>#.'#".54632>5!5!.#"322%%22%%2*O@ <;CwZ5zoCcI2y %2#+00= ,&21&&12&32.#"#7#".54>323M4(e9%PZ,,3,8" XW+9w.Z2T]2[Y+6M09{Hol“V &@ f@ p?]]]5"'&A f@ p?]]]5,B03Q3& &1 @'&3,!RQ 1 O S,P???2??99//104>323!!!'#".732>7.#"!,FtV:@ (/,Me= /'  2< ljGg6AF{[Z, -^ 7,55Jb1.+@ @#06@#1 .O-SF(P;RQ /?????9//29/10%#"&'532654&+5!#'#".54>323!32>7.#"5'U^+J#E)fS^XΈ (/,Me=FtV:'O?( /'  2< \]n<  {wAFpljGgj8X{<[Z, -^,{{.CFP{E::*K@ +P++": DzJ8"/@ MG*'QDOS?P4RFQ?2????2?/99//10!'#".54>323!3>32+#>732>7.#"!2654&#" (/,Me=FtV:=$gK*("7E") | /'  2< h!&) AFpljGgkf :/9I*8M$C[Z, -^ 7 8--+AU"== 3  ,@ B'80P@O O0Q????999/10+"&5#537!>32.#"%;2654.'.5467#2XxFåI?&-*.-()=?*8$F9#KspyTQ+8#D6" MlC-    >6 3.)7DUl^6?2-)6DU7:\g3<P):4@=.%T;OO7R V?????310#"&'532>=#"&5#537!54>32.#"3267!Q#N}Z+\#aO,;#<#: FqP2B$$,8! sp0-\^1 7M0; -/[^1 6M0/mjhb->KTB1+'($1:?KL8I??$OKD@$U5.PB+O*%'OIRRL R??299???99//92910%>32##<>7&'#".5#537!632.#"467!3.2654&#"#3E*MX)F]5 &07_T&~~+1&P+-M*5J//+5^K"g=D#((G6FP1Q: )*$ %)( *WY - 1^W6aTH-uC6P5E$5A 7n 6!7+   @80'TQ 66Q QPO????9/9??]]9/2103>32#4.#"####5354>32.#"3ޛ 'Y99R6'#% {{+]i&H!." ;O/d;6"KvT>(A/#,7ɑde2=]=-;D&; 0@;<+6Q#PS???9929/]10#5!;254.'.54>32.#"+".5ʱa+8#D6"1Qh7-*.-()=?*8$F9#2XxFFwV12-)6DU7Pj?   >6 3.)7DU7MlCClM7 <   @ OS Q?2??22210)#5!!!! 6xzg12 ~DC  C D@# CCAA???3?399//329/39/3222222922910# #33# #33FG0v,~FG0v,XM2XM=C C@   C/?399//32210!#!!#!}}}  d dg(<( @) RUO%T????9910>3232>73#7#"&54.#"> F)Nc7WQ#=BN3)OOR,)$5&/UvHur/P<{1C*9- ^8;%/8 @/9' ,R VO5T????9910>3232>733267#".=7#"&54.#"> F)Nc7WQ#=BN3 1"4<#XpA(OPR+)$5&/UvHur/P<FY3 5]M\/B)9- 60 6@   OQQ???39//3329929910!#'!#3 0SUMyT@   ~~@    OQQ???99//2//29/39910)5!#!!!!!%3f43?5@Kb)F@FFG90#G@ ?@< P@)FFPAR-R?9??9/?99//9/9910"&'#".5467!4&#"5>32>32+32672654&#"2>5! [{#oINmE ]l9p*=BF5WN40*]7'9' 3;>8A@tc66  R\KwQ+Ten'#  5dSKJDXV.Om?>mP.G+P̳Ѳ& @,& % OQ??9/929/910#!#53!24&+324.+32>8h[iĨ_U)G5pc.N;/L6*HpK'{Qs $8M(K>E2$"6}6ͳ @ P p R?]?]/3/103267# $54>32.#"9,Z\OCHRK}XBHUL]4eV' DžC" )Y "@ QO??//10)!24.+32>OƁ?@Rr}gV&;z~|:VW,7)XH!=@QO??9/32//329/103!2#!#%4.+3#32>H.Ɓ?@БRr\^gV&G;z~|:EVW,)X / @  QO??9//3/29/10)!!!!!+ %8T *@ #**#@00 )**@HR88885P?]?+9/9/3/9///910>32#"&'532>54.+532>54.#"OIv5'C\66M2*bvXS]NG^96`LWo?BpUHX.QqB6T=% *32)'%=2%%22%%2[&12&&21&- O  H R?+?/3/10#".'53265!5([l$KE=:Eel7FAsV3 #(_g B  @ O OQQ???9?9/10!##33JG519 <  @      OQ??99//339//32910%!!573%VLii15 H'" @ #RP??//10#".54>324.#"32>HplEHqlE/TsCNuO'/TrDNuO'uËMC}uMC]\.3 #"&'532>,Z[OCHRK}XBHUL]4dV' DžC" )Y?'''A |}#  O?///102#".54>"32>54.+uG={}uG<{]T(6^J]T'5]HplxAC~qlE/TsCNqH#*NnDNuO'?g'!# " /2//10"#.54>32#>54.1eL B~txE" N,Z[OCHRȄ@K}XBHUL]4%1k@ 1%( W)W@1& % . " p//]]/99//]3929//99/99105>32'#".547>54.#"3267#6͜o|B7͝n|B,TyLe(/,TyLi' NnF!8;'B*;D[+DD5D5D5F<@$<A!(PAR:0 R:P??99??9//99//39910>32#"&'#".5467!4&#"5>3232>54.#"3267.#sMNrL%(OxPNk)*6E,BhG&\^9k)-s=[r$4 #7&$8&I"/EBNU[:}‡zÉJTZ)A->xo%/ WQgZ)+\deY)3NnE 7GT. ) 3@ C CC I= .8@ %O@R??39/99/9///9910".54>7.54673>54.'332654.3~`&&E`:5Q96N22H.8S6:aF&&`#0LA74Ib@@rU2&2A.V__V.A2&?'"   P /2?//104>32#.#"?<{}sJ[uDwōNMx8aM?'"  R/2?//1032673#".5Du[Js}{<Ma8xōMNw*@  Q O??9///210+#!24.+3261hsj[xF#?X6~zTX-Dp6H+ek!8ʷ@QO??39/9/3/39/910>7.54>3!##"#;#")E*?Z:,[]|q1*'虥nn0GS 4FS-=dF' 0%Ӧ8Ak!9ʲ @  Q OO???9/9/2/29103;3!".54>7.';#"kƨ'*1q][,:Z?*E)bnn%0 'Fd=-SF4 TG]QA8w@ OQ??2/10!#!5!xVV  R O?3?//10#".5332>538mfpb-7]FA\:{Sj=;eM;bG()Ic9W4Y2/z    0  /]//3/9910#!5!54.'!5 4E*p/P=f-QPQ- =CM04Y2*>N@  5!+z: 00  &&  0  /]9//9///329910#!5!54.'!54>32#".4>32#". 4E*K/P=))))))))-QPQ- =CM0))))))))M-F% W"*W %  -//9//33/9107!2>54.'!5!2>54.'!5!#)M/<#6YA7D&4ZF9P1jo4Q7W"'/  '0!14;$QT.5@*B"@ QO?2?3/332210373#B57vh%BL  @  O QQO??3?3/9/3?=/3333933910#'#3737Bӑ!͑T+}-NflbVC *@ OQ?2?2/3/10)5!5!!7N}ݒ/&9&& @ &&RO?2?9/2/39/9910%!5!#".'532>54.+,_i,3t$Z_]',cc[$UqCIvWi6Tk:BwY4   1A%$?/3L .8%@3)")PR??99//9999/9/103267#".54675>54.#"5>32bD_;w~WXRgFqF^o:7YA6RN<}\#4]~J&()?8?fJe'o(&&   &D^78M8*Z 1-@#+#).QPQ???9/910%#"'532>?.54>32327#"&'4=P$%!-&$f/I3LggL3J.f$&-!&#P!Jt[0B'ig: @O  OOQ???9/?/2210!#.533653Ƶfqפ3bZ)pgl2 PN}[7  + O  QQ???/10!#!&'7>7! /BTal9(F<1( Vq3=s E@  >? z???39//393910#'!#3 <<{}ί!gh  >&>@!%?   z???399///]/9/99]2]910!5##!#3#3%FVͬ!kkMj&H !???@   z!??9/9/9/2910#!! 4.+32>4+32>jAJ"=/'A2qm'@.~s1I1t|!A].?8$ /z 0~*U%? ?%??@%$$z??9/9/9/9103! #!#4+32>4.+32>~AJ"=/~@~s1I1'A2qm'@.LA].?(t|fzz 0$ / &? ?z??/10+!24.+326(ayŕ"DhEZMgVo?!UoA80 6 ?@  z ??9//2910!!!!!!0]l!pp6. 4 ?@  z??9//3910!5!5!5!5!!6l]?ppS!4= ?@  y ??9//910.#"32675#5!#".54>32P0b;w837qJZe6  z z???9?/2232310##33~1w!t[V?z??/10!3!Vo!P L@    z z???3?39/3=/332299//333310# # #33m)RM!f` 4 ;A ; zz ?2??3?/3210#'#353`WzbzN!5^ 2<; zz??3??3/32103##]zzII!%&?? y!??/10#".54>324.#"32>9bIWU)9aHWV*2O86N3an6N3dlf28i_kf28ifFpL),Nl@+Nlr7IZ?@ 48=/ >8*?!@>%z@ =//Ez??9/99?/99//9910#".54>7.54673>54&'4.'32>6.?%(H6 HwZZwH5G(%>- &6!!4$ >0A&QU-@''?.-)?504?J-+SB('AS-+H<329B)- #3+%%+3#)"2.,,Y8)4 4(j.=?@  z??9//210+#!24&+326j!JxX{?rW4j^g\fm1`M/!:]HMCJ("C??  ?@   z ???9/9/910#'.+#!24&+326}#)6ImH#NX NTMlkQQ' !7N/Ut'J@2Gs ?z??/10###5!s~Pqe)A > > z z???/10#".5332653e+QsGNrI$&@1[NBlK))Hd</G0d\E  ?? z z??39/3?3?/32910#/#37379mg: *jPz&![Z!sx4>;!e+"//и/"и/и/A&6FVfv ]A] //i+и/ 01'#".54>3273267.#"\8U9%MyS"@%dK!2!+_5B$`coz,PpCBvY4 +4P9GG v>;!e+"//"и/и/9A]A)9IYiy ] //i+и/ 01632#"&'4.#"326z\8U9%MyS"@%d!2!+_5B$`c0oz,PpCBvY4 m4P9GG vF="7 == A   |???99/3104>32#'#".732>75.#"-StHUx]8S99:-+,F!#?/LyU. t,QpLp_$6$ 3QA)8CѸe+?i+2i+*i+29и/"?9A**]A*)*9*I*Y*i*y*** ]>иE9i+/i+>i+ и/и/(и96и6/01632#"&/#".5465!4&#"5>324.#">2>5#EV[)=*7^5"2!L13J/-@G'L)-.6 $F&*OIM& #k,RpE@xZ9# ('Gf<" ci U 2U8IG y~1C%$D1)e0 6 == | w???99/10#"&'3>324&#"32>e,SuI:;0dAoy>G*\' 1'F6  MyT,>r>2ai/9 1VF0#@ == A   w|????9/104>323#'#".732>7.#"-StH?9x]8S98@++,C! =2NzT,t,QpLp_$5$ 1R_>#J >#>#@/ |??9/]q/2/10!32>7#"&54>326&#"_:_a?=7.|>*OpFClK(NVIQ"(QW o AsW3(Ii2RSZKX>%E>%> "%@  |??9/]//310467!.#"5>32#".73267_a>=7.|>S{Q'*OpFDkK(NVIQ(QW o +RuKAsW3(Ii2RSZK*_@:F#>@  *0? *))5|5??9/9/]2910#".54>7.54>32.#";#"32>7_<<:YR',;#F? EmL96% #>28H*0Q?2;?2E)!3% M4#;* n  g !  *_@:N*>@ #*##*: ?00:*))55|??9/9/3/9///910>32#"&'532>54.+532>54.#"*<<:YR',;#F? EmL9675#".54>327#".'0(Y3?#Y]6--PG>Rv6P5"JpO?"]J_NJhC3S8HG v  RFuu,PqCCvZ4 ~k]%*)9T5 4 = | ??/103!#5!#"&54>32 *7###:lmm6&""!@0 7  =  |w????9/32210##33烃Jb|@)Y; ; );_ )A %|| | ???99???/]104#"#4&#"#3>32>32+ { {j "&4@")=Q>"6(  8+gu#1@E 2"YY@:@%:=%% =  | | ???3?/23/3/104&#"#3>32#"&'532>5%7'+1x444dg`k&   CHF 1%|gc * oq8^lu 7+b@*= = |??/]10#"&54>324&#"32>b)OsK)NtKVS/A'VR0A'HwV/HvU/hh":K)ih":K'+>"> |??/3/10>32#"&'532>54.#"'-h1-UxK3c)(_-(I7 5L0,]&IwT.z3O58M0q;@ @ /2/3/3104>32#4&#")OuLHwV/`S4D)HtR,*QtK`X0D)q@  @/2/3/31032653#".5)D4S`/VwHLuO))D0X`KtQ*,RtH)e@#>=  = !A | | !????99/10#"&'#3>324&#"326e0UtD< x0mA7T8>G%(-0 _d R{Q(bg?3*PqMai,% f 6 =@  |??32/3/9/3210#"&5#5357!!3267 &Q*{"ޒH) im-mm :53= = | |????9/10#'#".5332673:y-Z;2Q: p*V#c958T8F9l8 0@ o0 //]]]/39910#!5!2>54.'!5ac * oqnu$5$ 1%|x445dg#'+1|@)T; ;;P((% | ||????99??/]331032>7332>73#'#"&5#"&5d+ { {j"&4@")=Q@8>"6(w7  8+wu#1@E 2"YYz5  ||???3/10373#딖 !5icem@11@#*#'. ??9/910#"&'5326?.54>323267#"&'3J#O6)  3;0#4XBBY4"0;4  '9Q#^O&m :8>@!D7##7D!@>8: m&b86U+=0+0+0 =' =@ 3+,,v "?9??9/9/299//10#"&'#4>3232>54&+532654&#"b*Kh=3V #DfC;_B$!-'B.=#L28+R`2%IAB'3#54&'.'.'.#"5>32, +:" %7"- !C<$&+Jvs>SO'P((Y2 ')HH>j--iKXkZ##_8':A >5>5-=#(0 v??9//9/10.54632.#"#".54>32>54.')&nw&S-0U%/('"N&?-FvYJoI%!;P>1 ZR*;% +!*#;'6!7S;aa1C&4360!N; ; ; A |w | !??32???/]/9/3210#5.533>54.'3hz>fH(}KLzQR} 'IkE"@_Bj^[ }"?=>"BCM}]9 @/D@+/./ /+.A |$| ????9/99103267#"./#'.#"5>32?3  1#4(?#&n  1#4'3!'|xZ0"UKZ1"sMM[,)G 2 =  ^?/10#5!3!53"&54>32E!*7###$lmmV6&""!J)s(=@  ^?99/103>32#6&#"#J{:n92M3(4+.3qB:%Eb=QI!6%:l7]]5zl7]]5 bp8@ ]]55 jp7   ]]5).e#-=  =@ ! _?9/10%#"&'#4>324.#"326e,Mg;*X#HnKKjC $9*IRL#NXhR{R)H=jP..SpF*J6]dh g7]]5w7...]]5F?1<S(8/7!88>@/$-R2PO!77O R??9/??9?9/99//22910".5332>73>32!3267#"'"!6.9N_4%!!2$&T0JjD D]l9p*mP.&E!-#&H- H-H-+++5m&E-!1#&H1 H1H1+++5&E.@ _/@ HP  H+]]+qqq5\/AQxK+, :Q"#A@#!> 5>Q'/NN+Q"QQ5PG PO??????9/999999///10673>32>327##"&'#.#"#4.#"3:7%4.#">32;?+-4!EO&,3#"V7A&F +P'  "((O, E+!#A9"9I+ip5Q7ݡV;#]s }&W.=#6YBn7D&_u< \%5[. !5@.)5"%// QQ) PO????9/999999//10>73>32>7#.'.'#4&#")T/(JJO,(V&S0Eu31Y,+DW =?D(Bx00X1'93E*v V):tp & vq0O:9!&E+2/)))H)H) H) H)++++]q5&E%HH H+++]5&*E%HH H+++]5$%CT3""A>=+@ ":8>88.'P R??9/99/9910#"&'53265.'.'#467&54>32.#"32653NzFfRXW~w5h[8b', XQ '^x$ ''8.@-$>>3V-O??9/99//9/910!!#".54>7.54>7!32>54./b"POJ8"!7)^T':yzn22KV$QD9Zo6BkNSqE)I:!F:%39>@A)! :AQgEJj@5]~I>mXD#fE3kfZ!t6W=!*DV,0-+G4?L T\8~041(.@ +("#)(78 (74@ 7-86S1.O(*O$!"QQ QP????99??9?9//29291032#4.#"#327#"'#.5#5373#3\7J,!B'660ji%HkF )D1 t $dC,-& f@  p  @ H +]]q5& f@p@ H+]]q5f& fR#@(P((p(@((((]]]]qqq5W!>  @ RO?3?9/3322/32/321033!33##".=#26=!ஆ:l`_k:$p I]]K_`11`_K~y>>y~W'> &@'!R O?3?9/3322/322210354'3!.'33##"&=#32>7! Js^=]o/VF1 -I˿&jjjjjv@K>x%LtP^& Mm^_& Mh^& M\#Fe+5i+?i+ ?9 /?A&6FVfv ]A]-и-/.59IEX:/:>YEX>/>>YEX/>YEX / >YEX/>YEXC/C>YEX/>YEX-/->YEX0/0>YEX?/?>Yи/ >9 A ' 7 G W g w ]A ]и:"A""]A"("8"H"X"h"x""" ] *и*/.>901%!#"'532>=#3267.#"3>75#".54>327#".' z4[I*3+ 3M4BQ(e9\8';Nte XW+9w3d8 zzn+EoL) &8%uT]2vt8$ sHol“V'⭛<'EE^v& P^& PZ^A] /y@@-8% @ BC;4V*P% "POQ Q-Q?????99??9/9/10!4.#"#4.#"#3>32>323#"&'532>=l"'/  '0!14;$QT.5@*:hS'K*8"2!.=#6YA{7D&4ZF{9P1ip4Q7Ma8 7\F%^Y& Pb^& M^& P,^& Q{\f&/ OoB^& P1F^& P^& Rm^*& Nm^"& Nm^& Su^& S}^&  S^& Sv^&  S^& N^& S{}(0 "@ %T WR???//9/10#3267#".=32654632&#"!*9E&9^B$aOXX+[$`QWYfk(2 ?qZpaǷ q_^"& N}6I@ 66%0 ̲0@%66 &+RO?2?2/9//9/9910%!5!#"&'3267#".532>54.+,_i,3t(d4!*9E&9^B$,cc[$UqCIvWi6Tk:BwY4u(2 ?qZ  1A%$?/ X="3 ==  | |???9/10#"&'36324&#"32>X-StHUx]7T99:-+,F!#?/ LyU. Qt,QpLp_$6$ 3Q'+>"> |??/3/10#"&54>32.#"3267+-h1-UxK3c)(_-)H7 5L0,]&IwT.z3O58M0qK>/8T0 /#.3+?6@ o& |0 ??9/]/9/3210>32#<>7.54>32.#"2654&#" "1@&5C8T9gtw4ZyE_J(R-)G5 *@F 8;$?/==;0 MxR+z3O5%?1$#4X05Z@,"==@,1~ 'w???99//923/9/910.#"32654&'.''7'37#".54>32&bX*9"PIErA-}Z_BtZDiH%%IkFZ^6L0gd5Q  %`R9&`}[1p_?+PpDCmM**_s88= =@  v ??9/32/10&#"!!##5354>32sT< (Ih@@MNmUm\=\>s5< ==@    |??9/32//1032=!5!33##"'T< (Ih@ALJNmUm\=\>R^4<5. = =  ||????/10332>73#57#"&54,2%%)3^6]d5HF 1$`c3˙"5''5!?jhjjs"'55'"!D5& = |??//9/10#".5#5!3267D: /S=#T773/L6=m|B<9- , <  z??/10#5!#3!53 mmnn9-L  <<@  z??9/3/2/221035#5!#3#3!535#W mmhnnJ 0@W).@  !!<6=@19.&.| . ?99?9/9/9/9910#.'#".54632>5!5!.#"3262#"&54>;? z#&)L;$QH,A/! & "5''5!Kp**?*DG-7>*}(("'55'"7-0(=w ??//9/103267#"&5#5r#94  ii0;<rmj3W)05 ==w ??/91053#5!3#"&'5326=E`k&  '(mk ^lu-9)_;5>|??/10!3!;$Tg |@9T; ; 2);5.@ % | ???99?/9/22104#"#4&#"#3>32>32#"&'532>+ { {j "&4@")=Q.J6.! >"6(  8+gu#1@E 2"YY/Q<"u2|6)I;) ; ;  )|%????99/1032>7332>73##"&5#"&5d+ { {o"&4@")=Q68>"6(w7  8+wr#1@E 2"YY=@#6==| ??9?/10#"&'532>53>32#4&#"`k&   y-X6`q+6$%)^lu"8+cc:4oqnuHF -#4@#5== | ???9/103267#"&54&#"#3>32=   &ka+6$%)y-X6`q*7! ul^HF -#rgc:4oqO5 4;A ; ||?2??3?/2310##33Oz%z&g*a@%6"= #=@ "|??9//2210#".54>322>7!"!.a-QqEBmN+,QrEBmN++<'TL):(M SHwV/)PuMHvU/)Ou/= QX,9IT0 +I==&! 0@ + |! ?32?3/2/332210#5.54>7533>54.'kr-Le8r-Le9r*9! !9+r*9# "9, MrN, NsN,$7I+0K6!$7H+0K7!3 @DE3< * ;;<*@%6/{ ?2??99/10#"&'3267#".=32>54.'.54>32.#" 'E]77'* -6K/6}6&2 !7')M;$=^A6^03Y"(6! #>27K.v0D+41)p6L/ +>.&@. n &/9M8&=v ??//9/10#"&'532654>32.#"u#@Z79<066#AZ787668U:qE;8V:rE;'=%1@     |?2??/10"&5#5357!!3267#".'532>=^uqF&\Q -  imAYYǃ PDi I5#L!; ;@   |???9/3322/322210353!533##'#".=#2675!b``o468 #A2b=+W')whc * 3M3;0rOGGk5+P@ " "" '< <" |  |?2??2/99}/|/99102>54.'53##".5467#53./C* ) B3+NpEFoM)4B ) '?/5D%/B4,`h0|a/G0d\BV>%4 A = = "| |???/9/10#".53326=4.#"5>32V'KoHLlE #;/WI#!-diBlK)'Hd>a/G0c\b"5"]kj5|?3??/103# g-:5 '@ |?2?2/3310!5!5!!:[iamgn-58<@ | ??2?2/3210327#".=!5!5!:# "%'B.s[<3%i,E38amgn-{5(Q(1 /@!#(|?2?2?9//329/3210!5!5!3>32+#67254#"3[x 0B-4*(7 a|+2amgn83# 2%#5#),"& O C5!D@ >@ | `??9/22/9/9910#"'532>54.+57!5!C5]JSF&F,32.#"32>7_+PpEBmN++PpEBmN+*:&*:'*='->'`xD6lnaxD7m.Mf<&Ea32Nz=9+/6$zz:m?jrnEC /#=]:.kmN%H ; ; &  H}!x ?3??+9910>32#4&#"#4>32&#":m?jrz=9+/6$z7X?@D9( 7]:-jmnEB .$r6N4d -.8!. ;~ ??//10#"&'53265!5%2#"&546"*PsH4c(-k3Q\)8$)77>_B"vTSd/" /!"/Y%2; ; }~???9/2103>32#6.#"#o?y>nr{+2gD{m?8vu'3 =H V0; ;~???9/310#'#"&7332>73Vq?x?nq{+16:"}l?8vu'3  2$l%6%;; ~ ??99?/10#"&7332>733267#".5?s>nq{+16:"} "%*>N-5?3vu'3  2$l)4 j6L- Z"O; ?< ~@ /? ~ ??9/q9?/910+3326?34.+32>XQ|;9Y_3H,fw*B-'KGZSM(o %$ ?@  ~ ~??39/3?3?/2229210# #33FG0v,XM3@ ~ ~???9/3/33910#*'532>737%P]qF$":5/挲$)QsK#m 6*Mz[^S ' > yghrU T?/10".54>327Uxy=1A##3!$,I`3FvS=Z;&-)2,4**@+x" 8 H/+/21026544#-,+1]i2I.d5(*8U_Q)C2x" 8 H /+/210".5463"3/H2i]1+,-2C)Q_U8*(5/ 2;`@/?//9/]//10#32>54.+532 "Dc@~ \.>&.QpCyl1_;dJ-'5 6K0=^sY7. `@/?///9/]/104>;#";#'.Y1lyCpQ.&>.\ ~AbD"_7s^=0K6 5'-JdRRd/2/3/33310' pn11o@_`_d/2/3/33310 7no_`_Zu L@@/]//10#u?><u2@ P]]]]q59}I/'@o0 P]]]qqqq5<*HH H H++++5><HHHH H H++++++5@ Q/?/3210#'!73xxxHzG ///10#'xxG'*@ @H@ H++5'+@ @H@ H++5`!8/2//32105333`n!kk`!8//2/3210###5nkk`! * 88@  /32/3210##5#5353nnkk`///10!5ZkkX @  //10327#"&/5./)-09"6VR/*v 2,&#q9 6@   ?_  @/]/9/]/910''7'7LuuNuuLuuNuLuvNvvLuvNv)J%// ?@   ~~???9/99/29921033#".54672>54.'ڌ͇07-@''A-60I  h56hA$<,,=$@k3 (" $+=) + ;  x??/210#5!3!53*Z[[-2&27";);@ )$} ??9/10#"&'532654.'.54>32&#"22Od1Hn9=p=XE*6(SC+?nU*Y7nO-<"/>!&L<&q/B* i)& )?0;2" e  )<} A@   0` ~ ~???9?/]]3/3910#'#373}朦(%T b* >|?/?9//104>;#";#'.T-es>hL*1G/> sq<7% /3//3/10!# 7 3Hqq<7 q% @ /3/9//3/10!#!733HqG<7)%/3///10!# 73HqۜG<7z/3///10!#73zww/ ///3/10!# 7 53R]QHqG>q/ @ //9//3/10!# 7 3R]k.G>FAg/ @ //9//3/10!#!7!3R]GJ;/////10!# 73R]GG>/z////10!#73zQjE'#`///2//10!# 7 3Qj:R*I7/ //2/3/10!# 7 53RjDH*$:̀/ //2/3/10!# 7 3RjZ2q-k/ //2/3/10!# 7 3Rj{G-/////10)733Rj*b&z////10!#'3zjN&////10!#!'!j^=qP& /3//3/10!# ' 3jG#M4& /3//3/10!# ' 3jH5P5& /3//3/10!# ' 3jHGWH#&/3///10!# ' 3jGEBz///3/10!#'3zTQ>B////10!#'3qTjB @ //9//3/10!#!'!3T~egyHB @ //9//3/10!# ' 3THGZ{B @ //9//3/10!# ' 3THGZB////10!# ' 3TGZj@ //9///10!#!5!3_GH @ //9//3/10!#!5!3GHe* @ //9//3/10!#!5!3e*GH@ //9///10!#!5!3Bz///3/10!#73zdTHGRB@ //9///10!# 7 3eTrtpB @ //9//3/10!# 7 53dT.aqpB @ //9//3/10!# 7 3eTQ>pB{B @ //9//3/10!#!7!3TGHGaB////10!#73Tfq&z////10!#73zHpHnOW&//2//10!# 7 3Hp,cnIp& //2/3/10!# 7 53Hp2]*nLv& //2/3/10!# 7 3IpGHqnRY& //3/3/10!# 7 3Ipe*GnI.:&////10)733IpnI#z////10!#'3zst8;#////10!##'!`s)H+# /3//3/10!#%' 3sHA2# /3//3/10!# ' 3sH;8# /3//3/10!# ' 3sHG>5##/3///10!# ' 3sG7>5/z///3/10!#'53zgqD}/////10!#' 3igHqQe/ @ //9//3/10!#!'!3gHqNH/ @ //9//3/10!# ' 3gHGqAq/ ///3/10!# ' 3gHGq2g]}/////10!# ' 3gGqALLKz///3/10!#'3zKZK////10!#' 3pK}]s@K///3/10!#'3qKڜqm*K @ //9//3/10!#!'!3K~\g}K @ //9//3/10!# ' 3KHGHcK@ //9///10!# ' 3KGp@ //9///10!#!5!3_GH7 @ //9//3/10!#!5!53iQ>q9 @ //9//3/10!#!5!3GHfq@ //9///10!#!5!3e*GBz////10!#73zdTHfB//2//10!# 7 3dT~fB //3/3/10!# 7 53eTr*f\vB //3/3/10!# 7 3eT4[qf+B //3/3/10!# 7 3eTGHGfGB////10)7!3THG]z//2//10!#'3z|Ĝ$.//3//10!##'!b|. /3/2/3/10!#%' 3|H9.  /3/2/3/10!# ' 3|H.! /3/2/3/10!# ' 3|HG.-/3/2//10!# ' 3|H.$z//2/3/10!#'53zr*2&b$//3//10!#' 3LrH*2$ @ //29//3/10!##'!3jrH*2@H$ //2/3/10!# ' 3rHG*2g$ //2/3/10!# ' 3r>G*2EK$//2//10!# ' 3r4*2 L/z//2/3/10!#'3zgqOT///2//10!#'3qg[Ok/ //2/3/10!#' 3igHqO/ @ //29//3/10!#!'!3gRqO/ @ //29//3/10!# ' 3g%GHqO///2//10!# ' 3g1qOTNz//2/3/10!#'3zHG{N//2//10!#' 3RHB8{2 N //2/3/10!#' 53fHHq{.sN//2/3/10!#'3qHלq{qN @ //29//3/10!#!'!3H>G{hN@ //39///10!# ' 3H0G{|//3//10!#!5!3_GHJ //3/3/10!#!5!53sGH*N //3/3/10!#!5!3_[4qa //3/3/10!#!5!3GHGe@&p8Q?//10)3!&^p@&p 8@ Q?/9//210!#3!&x^^wpxoB*H H H H++++5f'@ //3/310!5!5!5!fff{9#jd&@]22/3291073#ddj4fd"@]2/910#3#'k4jd@"@]9/310%5%j4kd@"@]9/2107'5ddk4nD>8?8@ P`0@PO_]]q/]]10#".54>324&#"3264J/1I/3K0\ej+1,-)3,-)C2/A((D1_X)93),75 <@ @/32/10#'##%ϯݮ NPE<HHHH H H++++++5+[- H+55vk8//10!#!jzxvk8//105!#vzjhvy8Q?/10%!3jhhyvy8Q?/10%!3!vjhfH%KK@ ]//10!3!5H}05efHK@ ]//10!3!H}feH@ -@  H@ /]/+23310'57!!V``HaA^t!@@@  O?]/]10#4>32#".!-+!!+-!tj,!!,,!!,Zs%@@OO  /]?9//]102#".54>' +!!+-!!-J_s!,,  ,,!L^hy@ O?///10!5!2#".54>hj,!!,,!!,L!-+!!+-!stK8O?//10!5!53t}n\k<* 1pp@  A/?32999///9/10%#%#*{Ϝ/VwDNg<* 6pp@  //399//399//9/1033<1Z"D6W >] _?55 _] _?55 b] _?55*z *@    ^^??9//910#'#373z۝65_%0>%>@ "_?9///310%467!.#"5>32#".73267_a>=7.|>S{Q'*OpFDkK(NVIQ;(QW o +RuKAsW3(Ii2RSZK & & ' ' ( ( ) )E] *S +S +S ,S , - -S .S .S /S / 0 0 1 1 2 2{ 3{ 39NI+K%%S &I +`!@@**H@#%H@H@H++++55S &I ,`!@@**H@#%H@H@H++++55S &I .`!@@**H@#%H@H@H++++55S &I /`!@@**H@#%H@H@H++++55S &K +`'@-@.4H-@#*H-@H-@H-@ H-+++++55S &K ,`'@-@.4H-@#*H-@H-@H-@ H-+++++55S &K .`'@-@.4H-@#*H-@H-@H-@ H-+++++55S &K ,`'@-@.4H-@#*H-@H-@H-@ H-+++++55& 1I_ 1@ H1+5& 2I_ 1@ H1+5& 1L['@????`?/????]]]]]]]q5& 2L['@????`?/????]]]]]]]q5svsv9/-\+ +!:ǵ#!"@ @ DP!!B?]?]210>32#"&'532>5&#"HW֒LR؆[HH[\h8*IEC$MS '(A\+&}`@@]]]]]]5 +&*}w`@""""@"""]]]]]]5S".   A CA??9?/910>3"#4.#52< S}XKmA5HW`2WTȄBJuuIBȅ&- 4{&-H,@ AC??9/2910!!2.#!#![YP(4G6XIH|,!9/+,4#ò @ (BC??9//10#.54>324.#"32>/EsTek7(GbsAvC)QyPLwS+*QxNLyR, }A  EjwQ0;Ƙl[(-]blZ(,]F %@CA??9//2222103!#F` F%FZ C@   v @  A ACC???3?39/33322910!###3 3 { XwmF%+5 !@&,+ C  A??99210'.''.#"5>32#>5<.'V+-X9a6\K97Lb;a*@N$(UE,{H&B{4%$ ji|+4e \xN512v&@6/?_oF?/]310>54.'.54>7>7 .Pi:6pi]E(M}NmQ=(_is=AmP,;a~C0^WJ6*x&>74+1 $=ZtŊY%%%#EdOl7 "8V?5rObl!8IEE29@',,1EE">T"R??9/33/]910".54>32'2>54.#"4.#">4ZeD)'GauEZ{J #:N*LjB?udDgF#5S;([[U" (?Z'B3@B>6* s14[{OvG3Un:AcI/ ?bW`uB/Qm>CnO+  !4rpeM-"<- &Ajf=IZ$1@%! P!R??9/910!#".54>32.#"!!3267=x9xќY^}3k6<~>E~eE  CfG>=-sÖz3DpTYvE $1  @% !RP??9/910732>7!5!.#"5>32#"&'=>FfC  Ee~E>~<6k3}ۢ^Yx9x= EvYTpD3zʗs- b>KQ=<?/G44 /% L @/?O54.#"5>3232>5".54>323%4.#" #@ii)" 48M3 goB]?%}70Rm=y%Ca=؂WrDC;1A(24=@5'~078 ~@>5 7$+R P??999999104.#"'>323267#".54>7''7> #,-$?=Z< )u)<&#,-$?=Z< u)<&(2 ;^B3ibV!{%O(2 ;^B3ibV!%/,FM< -D D D( @5(E9AR0R 9'$O???99//99//10!27##".'#".5467#"'>32>54&'!32653aq; a &<0#FlH(D2  (8C$?bC##3-a ,>L6?!- & ! ."0EC[)QyoE3WA>V5;{rP&#[,!1ZPwNOvH_7vw.=D /.8@.>$))84;R4P??99/]33104>32#"&'32>32.#"#".54.#"3264lqpe/I}[B{*sc?B9&n8#;:@(.2/c_.<_Ew1}:cKLlȆC"<`S   &SZKa7)f+M& &@,U&")R"P??9?9/3/91034>32#"&'!!#5#4.#"3264lqpe/I}[B{*2ήG<_Ew1}:cKLlȆC"{{#Ka7)o&Ro]q5&R]q5C"7D  122+@8 3R1 0R&P?2?/?9/104.#">%4>74>32#.{!7*!+ A_?2EGl30#7_H$Dc?XwI 2gloc.SY/4R:=kYywCh 7[YRrH!aU'E{gv˗\XWf, @  P U??9/22910!2.#!#4>32.#"GYP'4I65otN?BHQi=IH|+!Nxl2"%IoI\f *1! @ P&RU???/10#.54>324.#"32> 5c[Zb3B|qlw?)LmCNoG!)LlDNoG!iWp MquMC]]/=fJ]]/=fuz"@P/?9//222210#!3!)g%ze @  } @  OOUQ???3?39/332910!###33ߞ{ʘ32#>54&'R ]Q7JbD4YL?;Pe<]&AX14;;0x~43.xx7+ * ŲURni'5y'/6 &@0+ @/]]3/99104>7>7#>54.'.LYRHEGBBy\7aP"&#-EQ$na,}c5., )EiM4K`:'E?<99=#29 Q}\h^3DF 4E?"@*3.'V!?>BR9P T???99?/9104>32&#">32#"&'#"&'532>54.#"326#N}Z+[$`Q,9#JaVX,Ki0_1ApX#<4"1 2N6!DIQ.0j3,[Y+ 6M0aOHrȄB BMa8 7\FO^51Q<2b4NP) $~;N+ ,E2~@OI@ ) +P R7R??3?99/999910.54>7''7>54.#"'>323267#".'532>58Q5 u)<&#,-$?=Z< )u)<&#,1:\B/,& H(( ;[?3ibV!%O(2 ;^B3ibV!{%O(2 B[: 0+l\+& &lB?5\+& + B?55\+& , B?55d\^& -d{ B?55`\+& '`B?5\+& . B?55\+& / B?55_\^& 0_{ B?55r\& (rA?5h\& )hA?5\P&J\&L z\& 7(lz\+&' &l 7(B?5z\+&' + 7( B?55z\+&' , 7( B?55nz\^&' -n{ 7( B?55`z\+&' '` 7(B?5z\+&' . 7( B?55z\+&' / 7( B?55_z\^&' 0_{ 7( B?55+& 4B?5?+& +? B?557+& ,7 B?55+& 'B?57+& .7 B?556+& /6 B?55& (A?5& )A?5x+&  4xB?5+&  + B?55+&  , B?55w^&  -w{ B?55y+&  'yB?5+&  . B?55+&  / B?55w^&  0w{ B?55O&  (OA?5r&  )rA?5oz&  7?xz+& ' 4x 72B?5z+& ' + 72 B?55z+& ' , 72 B?55wz^& ' -w{ 72 B?55yz+& ' 'y 72B?5z+& ' . 72 B?55z+& ' / 72 B?55wz^& ' 0w{ 72 B?55+&  4B?5,+&  +, B?556+&  ,6 B?55b&  - B?55+&  'B?5,+&  ., B?556+&  /6 B?55b&  0 B?55&  (A?5&  )A?5P& J& L/-& 4.B?5O/-& +O{ .B?55/-& , .B?55/-& '8B?5O/-& .O{ 8B?55/-& / 8B?55/-& ((A?5/-& )(A?5+& '(B?56f+& '6B?5f+& . B?55f+& / B?55,fb& 0, B?55f& (A?5af& )aA?5fP&Jf&L;-& 42B?5T;-& +T 2B?55;-& , 2B?55;b& - 2B?55;-& ''5-2<<1SI7 1$0333KB0 $)@ @ O?9/910.54>32> 7$:) - 70-)$ 0!<<@%-!30$1@O?/10#ݲ R@O?/10#6 R]%@  @ HO?+22/10>323267#".#"+mE:P>7"(=V-kE;O>7"*;HI"("7+VHI"("7+S)@@ O?/99910.54632'>%#u5-07 - ):$7 ~lo1$03!-%@<%#u5-07 - ):$7 tl~1$03!-%@<>323267#".#"(5-07 - ):$7 +mE:P>7"(=V-kE;O>7"*;1$03!-%@<32%# 7$:) - 70-~lo)$ 0!<<@%-!30$1+RS%@ O?9/910.54>32%# 7$:) - 70-&l~)$ 0!<<@%-!30$1+R-.E@ "*@! -%@ H%P.O?]9+]//9/910.54>32>323267#".#"? 7$:) - 70-U+mE:P>7"(=V-kE;O>7"*;)$ 0!<<@%-!30$1^HI"("7+VHI"("7+'+,5@(**#@+++**` ,O?2]23/]/9/102#".54>!2#".54>'#''''u&&&&X~;'&&''&&'^+R'+,5@#)+@)+++**` ,O?2]23/]/}102#".54>!2#".54>%#''''u&&&&ڊ~;'&&''&&'_*S{'?@G@%#44((?743<@+077 77 @O?22]//]99//102#".54>!2#".54>%>323267#".#"|''''&&&&+mE:P>7"(=V-kE;O>7"*;;'&&''&&'HI"("7+VHI"("7+X@ @  O?9/910.54632'>'5-2<<1SI7 1$0333KB0 $)9NI+Kz@ @ /]/10#"&=33267.>DN% HPk-#!Dg2 R?5ff!Y !@@  AACC??3?]?3/299/210#"&5332>53###33j.SsE#9*+:$|p f;X<yt/!!/).C%$ !O  @ "A C??99//]3239/221032#!#5353!!4.+326P{z=Gu, JvW͝;fObi89Z?"& a@ P]]]5 4 @    CA??9/32//99//32103!!!!##:Ƶ-o\f'?' @('%UAC??9/?921032>54.#"#!!>32#"'RB^{I!9NYa/?:؜V3q~R^NpWX7 s4}Лel\ v@   lv@A  A ACCC?????9933?/2222210!### 333 3#L%w bby{{Vm+& b:J   l @ A  ACC???9?88/3//3310%3###33 _V_]@     @ CA  AC??9/9??/3//399//993105##335333 ##88m'g'^7RY$Q @ C @   C AA???988?9/32/3/32233103533#3 ###$xxm_R#+ D   @ A  ACC???993?88/3/322310!###5!3+aU_oH> v @ AAC C???9/?/2210!#!#3!33#^۲%P X)tVof 6  @  A CCA????9//10!##!#3ײD)}Xdf0'H  @ (F%  ACC???9/?9/910!###!>32#"&'532>54.#"<N~W/@lR1#5:/D+}9ΔH@ÃwY#9C+7IX6 $)38B@ )))88K@G!=..!B! DD???9/9/3/99//2910%267#"&'#".54>3"3267.54>324.#">,%Eu2e~{>iK>vj\$B\+& bSV ,v @  AC??/10%3##!5!!m }}}VffIֲ ٳ @  C AA???9/3/39210!5373!!#!/'`X'/ѴD""lK@     v@A A   A ACCC?????9??/3/3/3/3910%3## # 3 3z [p+-oVL; @ A A C???/910%#!#5!#!3L Ke\9  v@A AC???9//10!##".53326733#r6Uzl1BiLO6d ?@veLMtN(HtVeEC @CAA???9//39/32105.533>73#k_,4S;=n**l?@Et_LEkN/H?n+ @  A C?3?9//210>32#4.#"#3 6Tzl1BiLO5@ve>MtN(-*1<M<(%j=@2!(<7-B D??9//10!32>7#".'.54673>324.#"-lH|`1SJE$'JLR/q5D`< ,90gw~Z!4]I@^=/?hk7   LӇ#;R2E<&4c_~r33q-*2=`=)&jt3>@3")=8.BI D?3??9//9/10!32>7#.'.54673>324.#"-lH|`1SJE$GQbU)D`< ,90gw~Z!4]I@^=/?hk7  !Zv#;R2E<&4c_~r33q uf&Je#E "#@$#A!! AC  F???9/?22910#"&'532>54.+#33{E6q{(X0*I!^{IB~s! >~Ǔ}ϓQ :l^]#_TB xA  CC???9910!! "'7>7!3#J98:@%++7S=,y|#t9F( G1t.Coe8 @AAC F???9/?/910%#"&'532>5!#3!36s{(X0*I!_|H۲%w}ňH 9eO)oF   @A  ACC???9/?/910%3##!#3!3|p۲%.CX)e9  s@CA A???9//10%#".5332673##F6Uzl1BiLO6ҟ @veLMtN(H;|@   @ A @ @@    ACC???39/988888?3=/3323/9299//333310%3## #' #373|o ={=@Ӝ88ُ.C/G\&L\{&H=(&L;-*)6 *@)$D B??9//310467!4&#"5>32#".732>5;41faX#OlڏFAz;0VyI@tW3g/?  %[k_r33q-{& _Hu{&H{&H">@  @A D??9/]22/2/9/310#"&'532>54.+5!5!8ЗNx6?HbP"&TcE\EwKVuD  &Fa;=^A!w,VP&J{&H/{&H9/-)1$ó *%@$$BD??9//2210#".54>322>7!"!./Si~{=##53!!!!P$B^9&E9*!:ƦZqA 2(|\-oJ}fM@  t@AACCE????9?/32/32910%3#"&'532>=# # 3 3$B^9&E9*!Xp+-oZq? 2(|NL@     @ A ACC????9/22/3/332/33910!# #!5!3 3!#x}[+-\II3Z*@  CA??9//3/103!".54>;;#"uG=z{WvJ 8ibPf;xv"?ZS!0B!** " t@ , %DDA???99///9/3910332>53#"&'#"&54>;32>5#",-$ 9bJFY$e<+auDR* A[9N9 2'GhC!-!'*ĿMwI_v{ !7*o%Ed+'@J" +@ @ @@ 8t@50=%6=DB??9/9//9///104.+532>54.#"5>3232>53#"&5-RsFJF=dH((F7,5A+%@>=#WS'fq5\D' #&54.#"5>32i ք:\A#4S;$DEK+KRZc4fq;]@"Vcq6R8(L:#-V|Oj%&Fk.C#k"n@/##)DA C???9/9/10##"&'72326!32>53#".5  7=C% ?E$ )-# 5]JJc<=;H' + N9 2'GhC! ChHoF  k@  ACDA????9//]/9/1032>53#".5##33/-% 7_JJe>N9 2'GhC! ChHQ)B,*5 IJ# (BD??9///9/10.#"32>=!5!#".54>32-ONS0Xf82]QRe98qstMY~; <~Æ@'KjDMʁm1TU@V2 o@ DA?2?9//2/9/10!32>53#"&5!5!'/%'4 2'|m+2U@ &&,@  '$$/@ HB2/D??+9/9//9///10%#"&54>7.54>32.#"3!!"3267Of*H_5re9oirJXTNf>(Hd=HtQ+|K'μ>jQ5 %jO[1#:L(8R67O2y&}R*B! xt*@ $EA  CC????//910!# "'7>7!3#"&'532>=J98:@%++7S=,Q$B^9&E9*!#t9F( G1ZqA 2(|Ro #V@ # @@$ OOQ Q??3??3229/910!##333##".5332>5yJM-QrEPrI"!8*+9"==ln;\A""A\;2''2#+M( !*@%!,+#$($/?_$$'l R??99//]32222104.#"32>>32#"&'#5357!!\BiJ8\))U*UsD/)]9uo6A{s]JA3&<*0?R.RpAMwR+ N-f& aF@ P&&&&]]]5B 4 @    QO??9/32//99//32103!!!!##BTLFf(:'(( @()#(QUO???9/9210!!>32#".'532>54.#"#'L#qF2o '#PsI#.V|N B%9uvr̙Y8k`X|N$5r\@   @O  OO QQQ?????9933?/2222210%3#### 333 LLяq& b6G  ~ @  O  OQQ???93?10%3###33 Z,)q51)V@   @ QO  OQ??9/29/??9//329333105##335333 ##55m%q%3l2͵'\     @Q  Q OS??9/?9?29/10353!!3 ### ),1s#' G  @ O OQQ???9?29/10!###5!3'X}`Z51@  @ OOQ Q???9/?10!#!#3!33#y`5ˮV Dhqf 8  @  O QQO????9/210!##!#3}ϮeTDhdf0)B)!@*& OQQ???9//9/910!###!>32#"&'532>54.#"<N~W/DoR," 5:/D+  \q-q”z5,^ewK\5EZ# 3&06@@ &&66G@C!;+++!P! RR???9/]9/3/99//2910%267#"&'#".54>3327.54>324.#">& 7a+bwlw?=wsYqB)LlD'&CF=dJE^:<5%b $( 67).y-C}uM>dJ]a2 KdYf74^OB4UU2Y9/& bA^ ,  @ O Q??/10!#!5!!3#Qvj V9qBf &@   QUOO????3/29210373#B57phfBf=  @ U  QOOQ????3?/39222103!373!!#!i57phFJD@    O@  O  OQQ???9?/32/32910%3## # 3 3 dq~+7; @O O Q???910%#!#5!#!37 4ڔjZ<V,9  @O OQ???9//10%3###"&53;3e oڰ GoOq7#".'.54673>326.#"FpQ,KD> $DIQ0rm8?\; *6 9fbi_-4XB9Q6+%2MwQ*   ?wn8O0E<#4\xEByRCoP-,PpC2=`=)&z3>@3)"=8.P\ R?3??9//9/10!32>7#5.'.54673>326.#"FpQ,KD> 54.+#33?d{E2o1'#PsI#6bS#BsirF&T`XV*P5!X@O QQ???910%3#7#!&'7>7!jy /BTal9(F<1( llVq3=sf8 @OOQ U???9/?/910%#"&'532>5!#3!31n1'#PsI#5ˮFr{@M`zDhaF  @ OOQ Q???9/?/910!!#3!33#75ˮjDhl9@QOO???9//10%5#"&53;3##ڰ GoOʝ ﮦ32#".732>7vY@Haw954.+5!5!8З'>62>rHbP"&Tc8OEwK\VqA $C_;=bD$w/ZN&I}&G }&G\ %3" #@ &""PR??9/3210#".54>322>7!"!. B|qlw?B|qlw?)GgE*EfG+DuËMC}uMC2VtA1Rk9 }& G}&1G`N&I`}&G;`&P?)}&+G) &@  OQ??//10%3##!! ُq}&/GB}!J!@  O!Q W???9///910%#"&'532>=##53!!!!x$B^9&E9*!TZvE80oF}QJ@  @OOQQW????9?/32/32910%3#"&'532>=# # 3 3$B^9&E9*!nZvE80o~F)C@$    O OQQ????9/32/332/339210!# #!5!3 3!UN2!O~Vm_6C$4,@5S 1O'R$!R?9??9/?//9/39103265.#"32>53#"&'#".54>323!//2/%0 ,-$ 9bJFY%c?Vo@At\8iR"<H  '@ < << 2@/#0*7RP??9/9//9///104.+532>54&#"5>3232>53#".5;lW87L[0[\'2$$5/.W{M$Vcnt73' CiJ0`M/ $;,&6#DL 'F`9Trk%E6 /#{GhC!8eS,H@ $)+(@$P*(Q??9/9//99//910!4.+532>54&#"5>323#ApWLa8_i)GHM.SQbU'2M6}u  $;,&6#DL  'F`9*K<* wmq,?,," ~@ !!'ROQ???9///9/10##"'732>7!32>53#".5 &053#".=##33,0$ >cG3[D(ѢE6 /#{GhC!8eSDh'3#@P R??9///9/10%26=#5!#".54>32.#"ys9kbj{CJpN?BHCwZ4/Qoeo2iY(A|zÈI".]]]Y,T4  @ RO?2?9///9/10!32>53#".5!5!",35,?rX4V.8 7/@kSK<P%,,2@ -**7@ H P<7R??+9//3/99//10%#".54>7.54>32.#";#"32>7']_Z$t3#>Q/]U(`v,ab_)^NG`:8`MWpACqU$[cc,  *LmB6U?* dT9dK,  %5"#6&,;$%;)  !}D'A'' 'O!@ QQW????//9/103#"&'532>=##&'7>7$B^9&E9*! /CSal9(F<2' ZvE80oVq3=sh$6///10#$Hn%h6@     //32933/2223910#'7'77'$H1111hC1111m///10!5!\՘m///10!5!\՘>f)f'vv]f'OO(HH H++5+55y T?/10".54>327yxy=1A##3!$,I`3FvS=Z;&-)2,4**@+9#3%@3).3$ T?33/10".54>327".54>327lo9.32.#"3!!!!!.Bs[>x11t=~EqR#hwkyBS{Q'j؏RB&07@, *5+4&45  .- ##-."!"""1Ƿ4+&&-#"#@ #D. 5 ' B?9?9933//99//933339333310#&54>?33273.'>7#7.'".|.w~Azk!|*E!|&N3FN|&F  >L6G0/sMЊq  *%9 |6# x@J3\+7D o@ **7'Ƿ2++ " B* D??9///99//310.#">7#".54>32.#"3>32LBԖRR؆[HH[\h8 (4!4B&, R' AS` ')Ey&ZN! =\<+T=(& hf#&)@ )#$xxx "x x 'x@1$ #) C'C A&A?3??3?99//]//91035#533!33#3##!##%3'#35#%3'5#1MyVVU.MMZZFE$T~E6%N@ ./=?=O==x u@ 6N*IBP3*R  ACC???9/9??99/]99]/10!#.##324.#32>#"&'532654.54>32.#"Q)',azV$<.1L #?2 0:! *G_66[0+()4F,CMC,!DiH$C/2D!#. ,CNC,3@$ 6aO5bSAZV4O4P9S{DdB   =?/G>>NhH32"32654&>3>7#".'#".54>32>7"%32>54."3267.'cR +3 6(/I( -:GF@H5;+-4K0,RtG!"$5Y/*#+=(!5631%+%'?0" /w % $ =R15aOhwAU#/ ?C`>W&X"0 JoL<1",'9)  +̼/8aSJvR,H--Ag@=8$$. @==3)HCE??2?99399/9/993310#'2>54&' #.54>324.#">d 2$8iR29xMwQ*eSҙ~6fO0,Nk?KjE #/-$.>#!)_ygSR`o=j+OpF{IMqM5MqK%)HcT/@(#:,2``e7KpYGf"+17@ 5/# 41(@4 '40 (! 0@ @ H  131`1p111AC??9/]q99//+]/332222/2910#+##535#535!23#3%4&'!!>267!#!.fHl^fKlQG[v!r l3YA&+~v~6V<~  #=v-.[M&'B )4@/ 2$% %$   /!$ 2 @ 0D B% B???9/9/9/99//9333310#.54>?3.'!#*'2>7#2F'_i7P~jBD??99//]3232/910!!!3267#".5<7#53>7!5!>54.#"5>324*``VyEsVxK"Zgm4||?\&vD;IBjL$QTS'!SWS!k,6-**1F-   (U]  :U##V<+?*   8]|C0Q"\ !)X@ %$!$%  "$D % B??/29/329333310#&4>?3.'23267#*'Z'M~6d04l324.#"326# #".54>32&#"3267U+Je9Dd@*Jd9DdA ~!7*(7""7)P@nTaJoL&&KoH2_'^NRf3D')V*PtL%)NpGOuK%)NpL4N34K05M4kd)NoFFsQ,q)dk8L0qm <^@06'0      6 3,D C A  B?39/???99/339/3/3/10#'##3' ##".'532654.54>32.#"%u//pʔQSn0$BZ653-!Y5G>-COC-!;P/;S"J34:-EOE-58y*?)j +!+A2#:* ` #+CR 5x0h@##)) 3 b@#3-RTS)&*-Q?22??33/3?329/9/3/33/3/32/33/3/3/3/10 # '73#"&'532654&+532654&#"5>32RfJ7$GiF@=?506ZT/#%-6"K-di&*8:{Ztf*F4w%"q#! q LA4@ BR.O=>>1OOHa55N1)h@""  @%,>==:C1N0CT,&  RS"#&Q?22??329/9?22/3/3/32/33/3/3/3//33/2/3/310 ##"&'532654&+532654&#"5>32!57>54.#"'>323Rfu$GiF@=?506ZT/#%-6"K-di&*8:H/! 7&C.3;#,N;")A/>{-*F4w%"q#! q LA4@ Bd}#3  e 0G/558!+R (j#?@ !!  b@ ##RTS"Q???33/3?329//3/33/3/2/2/33/3/10 # '73#".'532654&+!!32RfJ7,$F/H97F7-VD){Ztn\my)""E}W'BR!B|011$BB;a((A$?@  @!1006$A#-6T  RSQ???329/?23/3/3/2/2/33/3//33/2/3/310 ##".'532654&+!!32!57>54.#"'>323Rf,$F/H97F7-VD)H/! 7&C.3;#,N;")A/>{5\my)""E}W'B_}#3  e 0G/558!+R!LGh::J"@ 11+@@+66+?@  @2@=DJ466D+.*' '@'P'`''ADT  RSQ???329/?3]229/92/3/2/2/33/3//3/3/3/33/10 ##".'532654&+!!32#"&'532654&+532654&#"5>32Rf,$F/H97F7-VD)$GiF@=?506ZT/#%-6"K-di&*8:{5\my)""E}W'B*F4w%"q#! q LA4@ BR!,/,,#+`)&//.(?@  @*#'+(.@ H..p%%%-)S  RSQ???329/?3]9/+332/3/2/2/33/3//33/3322/10 ##".'532654&+!!32##5!533'3Rf,$F/H97F7-VD)ZZ{5\my)""E}W'BmmzRR &2n-h@ ' ' b@'-*@"P"`"""0RTSQ???33/3?9/]32/3/33/3/2/2/33/210 # '73#"&54>;#">324&#"326RfJ7;X;z{#VpKAofF*.B* !)%#&{Zth(G6|Cy\7}890A' ' G4(R+IBB,;;D??55?&h@ @* >DD@584/C@S&#@P`) RSQ???9/]32?229//3/2/2/33/2/3/3/2/10 ##"&54>;#">324&#"326#".'532654&+!!32Rfo;X;z{#VpKAofF*.B* !)%#&,$F/H97F7-VD){/(G6|Cy\7}890A' ' G4(w\my)""E}W'BZ LL0r"//<#t"M=t@<3232>=#".'#".5332>5332>53#".#"F-L&3:=(C02'"92,+3@*/ZF*!&,&"*(#-PpC()'(B<: +"i 3''3 $ImI /<##<./<# !9, Mg?l4  @ A C??39/3910#"32673##".546;WZ*^*131t4 Cv_57233 )36.@ 24S#2Q??9/910>32#".#"5>3232>54.#"#34&VVR#Ha:3XvC()'(B<: -L&3:=(D16U=F?1 NmMg? +"H7J, i-=>6" +>65+ 09DB??992104>54.#"#&54>3232>7#".5UnsnU5 %D8)C0Gm;aN 4VmqmV4.RoA1idY!QpbMkV~]D829G27*#8)% SpC9Xj0IiP<7:JcD>R1$$XH!*-?*,- x@+ ,*-$A-C A???9/229910>32.#"!5'.#"5>32 M;BJ+B% .&,-4"11"2+*&. %B+H@:#HDU/!ICakaCJ$0UCB<C"J5' 9/@9K**"AS4D??9/104.#"32>"#".#">32#".5467>32232>p1TqAMP4Vo:FxX223/?HCc~P-VV^~JShm{C?qwCHE2=Dm_*3*575g(;a~6]|F-.=ʍnKK=?jW Y-@ CA??9/32//9/321053!!##"5463ٳn6K6&cY"+|HIZ GO? +F FH9@DR 3 ?97332>73#".#"5>3232>=#"&'#"#'/  '0!-PpC()'(B<: -L&3:=(G3-cEQL-7B*//<#,OAB7D& (QFMg? +"SN]^'D3#lf3 @ OUO??9/?39103##".54>3"3267-yFY{ISq@L( &Ff@:{3z2*ecxC/RqCQmBN Qi<=E&B̴&1X~@ 1R , B)@9 99 6!JR<6P??9///99/10.#"326"#4>3232>54&'#".54>32>73#".'.,e-+4F\L9DG9%% @hDEl-NN:T60YC(01) (14EsaQ")+=:6$ -@>- 529RP??99104>54.#"#&54>323267#".*DW[WD* !<0 6(!HsRJiG*)CVYVC).O?WXQtTZ/B`E0&!'1#/# +!,]K0+7:8;T=,'&0A. 6') (Lm),;)+ @)+,#O,Q O???9/9910>32.#"!5'.#"5>32 4=F*4B *#))+-1-*&&#+ :'B<7G1B)  1(GV G+3 (C23pN} I5G '8@'JB7/S"R??9/104.#"32>>32#".5467>3232>7"#".#"Z'AT..PML*)Id:FjG$FmVi;E}hmn8>ow+W02=D 23/2;>ZsD!WV*6S:g(;a~lc`@{unKK=?jW DoH7na4@O V??32//99//3210!!#".'532>5!5!53]DmO  4+6 _YU)5O6~@  O?/10!4>32#!#"&54>< %8/!,a %8/!,$;0) $;0) K@  O?/102>324&#"#Cn\OHG%yv95;DPavH#yG>"f% M@   A?3//2/102>324&#"#Cn\OHG%yv95;DPavH#yG>"*@  @O?/10.54632=S3F36/%%7#:K*>8.!@  @//10.54632=S3F36/%%7#:K*>8.!*@ @ O?/10>54.546327%%/63F3S=!.8>*K:#@ @ //10>54.546327%%/63F3S=!.8>*K:#<W `!6 `6)+4@    RS?3?39/329107%%'%7=DCCC )O׈P: ]N'@  R#/?//104>32#".732>54.#" WssʖWWssʖWTJaaJJaaJ$sʖWWssʖWWsaJJaaJJfY,;JYhw@Q6u3+3G&B0D5C9 DCB??99??999106232#".'#".54>3:.#"3265332>54.#"gV&DsW;4) `EWsD&Vh 8E& /):54;)/ &E8 )VS 0#E9SV=|AJWWJA|=T++g+'x(@ %((,*A'C@ % D B??9/??910>32.#"!!3267#".5##3EoVI]4Q(@^@#v @aD(Q4_GVsCۅ9 ,arm0 : \ U ó @  @CC AC??39/2??/329=/3/3/91033####3 VUl|]]wzPHltH@     @CC C AACC???9/322?3???299//9910!##333####36èxx%%xQd)ddgu Q ¶ v @  A CCC????9/3/322910 ### 5)ͤ͸ _`*DKMg@ H u@A  A C CCC?????9/992?/9/23/33/3329910###!#3!5)ݣ7×G`)0<gp@ 6(%/'&&"Ĵ9< ȳZA"Mx@ h[ZZU`Pe<HD2@,&6(%B?3?9/9/23999/39104>7>54.#!5!2>54.#"5>7'37>32&#"32>32.#"#"&<)Ic9>yl[B%+QtH=dH(>fNTX:Oְc4*  Nfq5_H*3Y{O(6 BA,mpj*&;30#<;;!>gcf<}r:S8 7S>2O76R8(L:#Ձ\nPj% 0KgAZX6! *3    {?'`{& tJb?+)AT@=54.#"".54>32"&'732>737< %%""%$S^/ 2dWX_-"7Pс#?jY+2F Do>͏77ϙ̓><˾AA͗e=~A'Ge@j9/!AN@5? %//%?5*:@*B2/5A%"? C?32?3393333102#"&'.54>7>2>54.'#"&'>66UWV+3Z|I +69XXU*4\KX9*E0E.+D/J--I/D--F1H:.nցסk.!?1o؂ءk2?m#`{QW}]"''!_|PY}] &F qDXn@34MNnc\iXiNiNi#D+<4u3+@3JQMXEMffYn&B0D4A7 DAB??99??]/9999//99106232#".'#".54>3:.#"3265332>54.#"".#"'46323>54.54632gV&DsW;4) `EWsD&Vh 8E& /):53;)/ &E8 UxZC *-ad88=HY7h7%/63F3S=)VS 0#E9SV=|AJKNGA|=)2)>Gy# .8>$B3 6&  `\f+@ ǴU O B D??]?9/10.54>32.#"3267#ϐLR؆[HH[\h8#D S` ')EyRO@    @ OO Q  QO??9???/3393393/10# #3'3654&'*8![]奪z},5+ =uh`j&J#V1X'31@2'&! !,R POQ????9/2910#33>32.#"!!32>7#".5?lZ*j-2108Y@'v&A\9012573Zk;;Xrl4  Dv[~eJ   ;uu(> V@    ̵ Ӳ@  OQQQ????39/2/233939=/10!#####33'>ƱGL_DD^2Ry@    V@  @  @ O  O QQQQ?????9/?3//33999/993310!#######3333R~66~ѢõZ:::^^h L@  @ Q  QQO???9?/33/23/999105! ###3!Sz٠پx& J//- fK8_S@   |@ OQ QQQO??????9/32299/2299292105!###!#3!3!bϘ$ I77?cNrxlj@ 2# *"!!754.+532>54.#"5>7'37>32.#"32>32.#"#"&54>*]ZR=%ApWLa8:`GN^5/3>(}'Gct #4$$;,&6#"5% Ȁ]iG-CW2*K<* %=T6UpF% *3   {k:R6Vf%B&G]b?'?Z@)=(99(2;:?(:(:(Ayy@ @;O=)(9Q4.U(OP#R?????99?99//9/9910#".54>324.#"32>"&'732>737I<`FC\8<`EC\9)"&))"$*#?jY+2F Dy33wz32wě\e55e\\d54eW~A'Ge@j\ T7N@5- ''-5$2@$8*'-O5 Q?32?3393333102#"&'.54>7>2>54&'#"&'>85R*QtKT64Q+SwLT3*E)<&QJD**F+=(TKGT:/(^\/>7-&^\1=& GYg8&$% GZi8&!(R:BVl@KL?WOW_WW0a@aaZgCg;LgLg;2*;"!!"/%@R/@6OH?OOKVCKddodddWl OR??]]??99/99999//9]]10%#".54>3:.#"3265332>54.#"56232#"&".#"'46323>54.546323jMPh<1^Y 8E& *!<11Gy# .8>$B3&  ` &O&?5f7 U  @   PR??]?9/10.54>32.#"3267#JpN?BHCwZ4#C wŠK"3`Wc$l?//10''‡1yL1yL*<r*>ro@E9NI+K O?/102#".54>31$$10$$0$00$$00$_{}G MPoBj.   //10>=35$#3I.i VPRW{Q. tTU>#'+6($ 3,A  3n)n) n%n@#/7 C 3)''2*A%C??9/9?]9/910#!!34.'&'6763#53#4.'&'>q9Xer5_H*I`).*P: O0K<3 1G'"# j% 0LhA^d y2P7O %9r”(G3} 6Qh # 6 //9/9/310'7!#!'71HR111Qh$ #6   //9/9/310#!'7!$H11Rht11';O%@A-K7#F<2(  //9/102#".54>2#".54>2#".54>2#".54>+"=--="#<--<#"=--="#<--<#"=--="#<--<#"=--="#<--<.=#"<--<"#=..=#"<--<"#=..=#"<--<"#=..=#"<--<"#=.@I#Ee+i+и/ i+ i+!i+012#".54>;#"&5#52""""a  ?D!""! bE<bR[  66C?/10!!![PKPdVX66//10!!!ELXSz  ////10#"54$32B8. 6 6 //10#"&5463232654&#".igigVgIJdfJHfjhffJffJIeghc  O?2//10 '6,3h'5[Kh@cc  O?2//102 $!5'c@hK[hW   O?//10.#"#&>32hD@ɅWob #LP=#^) @ Q V??/10%3267#".=#7= 1":<#Xo>^*FY3 5]MB^ @ QV??/10%!#"&'532>=!=#>=#i=#h'JjC:60(]P$ ";0w^)  V/?/10%3267#".== 1":<#Xo>FY3 5]M^)M  V/?/10%3267#".== 1":<#Xo>MvFY3 5]MuC@&@ @ H@ O?]+]q//9/10#7>323267#".#"LߍI+mE:P>7"(=V,lE;O>7")<uHI"("7+VHI!)"7+zU@(  @H@` HAr??+q]q3/+22//9/10>323267#".#"#7+mE:P>7"(=V,lE;O>7")<0ߍ}HI"("7+RHI"("7+Ll*@@ O?]/9/10#7!5!Lߍ l]9l*@@ O?]/9/10#'!5!ݠ( l]O4@@@A@P`/]?]q/9/10!!#'5ˠP+?@P 1شO;;@ ',`@6"" "" @@O?2]]2//]10>323267#".#"2#".54>!2#".54>+mE:P>7"(=V,lE;O>7")<=)))))))) HI"("7+VHI!)"7+5)))))))){+,1' ض`",O?]//10!5!2#".54>!2#".54>9 #)))))))) ɅR))))))))Ly'(I# @@(A o@  0@/]q]?]q//10!5!2#"&54>!2#"&54>N5 ''-='((-='˅G('=-(('=-(3 ش`@ @@ HO?9/+]/9/10#7%2#".54>1$$10$$0$00$$00$o= ص`@@@HO?23/+]/910'3732#".54>H1$$10$$0yy$$00$$00$5oQ@ @@H@ HHA r??+]q2+3/+/910373#4>32#".,"..##.."M{ggy.##..##.6 #@  A?/229/310#'##'##'Z"00"00"Zj6ddddqfC ////107iiJyKz@ @W Q??/1032654.'3#"&'z1C6 ,$'/ ~n59) ',7$&>4.H\O4@@A@P`O/q]?]/9/10!5!#7N5ߍ}˅/);<c /7@2%4" ""O_o""323267#".#"2#"&54>!2#"&54>+mE:P>7"(=V,lE;O>7")<9''-='((-='HI"("7+RHI"("7+('=-(('=-(}f<`ش`  @@ HA?]9/+]/]10#7%4>32#"."..##.."{l.##..##.N{I///10!!wIT@ ?o/]///10 #]A*T<(*@/?_@-2H/+]r///10 #<Y(,Z{///10!!wyo#'(V$ز%ص `  @ H (A% &0&&& H&|/+]q?+]2]2//102#"&54>!2#"&54>7!5!X''-='((-='V5{('=-(('=-(o{:'+,@(ز#)ص`@ ,O)*`**@ H*/+]q?2]2//102#".54>!2#".54>7!5!\))))))))F C))))))))ry'(O`# ص`@ (A@P`@H/]+]?]2]2//9/]10#72#"&54>!2#"&54>Oߍ''-='((-='('=-(('=-({O+,A' @@ `",O?2]2]//9/10#72#".54>!2#".54>Lߍ)))))))) O))))))))y#*+i@ *'$)%% @ `@!  +A'''''$$$(%%%%/]]2]q?]2]q2//9/9102#"&54>!2#"&54>%'373X''-='((-='ۚ{('=-(('=-(1yyo{./N@  * @@ `%/O?2]2]2//9/910'3732#".54>!2#".54>ۚ)))))))) yyG))))))))oy'(K # ص`@ (A@P`@H/]+]?]]//9/10#'2#".54>!2#".54>䠍'=-''`'=-(((-='((-='({O+,A ' @@ `",O?2]2]//9/10#'2#".54>!2#".54>砍))))i))))O))))))))NR @ @`@ HA 0/]q?+]]/9/]10!5!2#".54>N51$$10$$0$00$$00${9[,@ @` O?]/9/102#".54>%!5!31$$10$$0# f$00$$00$pz{'@@@HA?]+//10#'##%Ӷ${#@@@HO?+//10#'##%ϯݮ%g=@ A?]/32104&#"#4>32C>>C+J`55aI+3333=W88W=+@  O?/32104&#"#4>328888(CZ33ZC(3>>3=[<<[={&EI-,@H@H?O]]]]++5zR@2  @ /]q]]]]22/]////]10>323267#".#"!5!+mE:P>7"(=V,lE;O>7")</5HI"("7+RHI"("7+QfO';B@%%$ (2$%7D!!!-/]q?q9//9933104.#"32>'#"&'%4632&4%4>32#".P(Ig?ImI$(Ig?ImI$jaR?LLaR>KYtt͙YYtt͙Y)ic/:jZic/:jWP?( M=%t͙XXtt͙XXfO5@ ppD/29?]q2//9/104>32#".##7#!Ytt͙YYtt͙Y9\'t͙XXtt͙XX͛YfafO 4C@% !+!`pp0D  &/]q?]q2//99//10!7>54.#">32!4>32#".D2J1">W4Ms-:"Q2$3! #>2Ytt͙YYtt͙Y1QMM,6U;8/E#-'55;I1^nt͙XXtt͙XXfO-A[@4&&&.8. ""))=D  3/]q?]q9/qq9//99//99104.'>54&#"632+32#"&'32>%4>32#".G0<32#".HykYtt͙YYtt͙Y\\t͙XXtt͙XXfO1E@$  (  -D #/q?]q9/q//99//104.+5!5!32#"&'32>%4>32#".B3Tk8DDYcho`+S!T#FxX3Ytt͙YYtt͙YAU3[oBJKX_&Eat͙XXtt͙XXfO-AM@,(.8.++++####=D3/q?]q9/q//99//2104.#"7>;5#"32>'#".5>32%4>32#".BeH'm*9")?*"]-PH+Ytt͙YYtt͙Y4V>#5W="[I{Z(G^0(>+?gNT0t͙XXtt͙XXfO1@D /]q2?//99//10!!3 4>32#".;wIYtt͙YYtt͙YbQt͙XXtt͙XXfO+=QR@/H>#9 &4 ,}9k99## 111MD)))) C/q?q9/qq99//9//104.'>54&#"32>.54632#"&54>7%4>32#".>,<#GL}y@_?FMUO!Bb@:dI)|AENIKCEJ *8 BW"7)0?$3Ytt͙YYtt͙Yl'@4)$_EUc!7G%?^(+hH*G34M.E #C/433,) :6+('))*t͙XXtt͙XXfO-AM@,) # .8.&&=D3/q?]q9/q//99//104.#"3267+32>2#"&54>4>32#".I)Hc:+ _-PG*9Ytt͙YYtt͙YYbU'(G_63U?#p{[2k?hMSI(>+t͙XXtt͙XXv& v&v&v&v&&U&UfO&:NO@*!   'E1;' @6D$$/J,/qq?]q99//99//9910#".54>324'326%%.#"4>32#".732>54.#"1!@b@9\A#!@aA9\A#_B9IV(C7IVlYtt͙YYtt͙YANhgNNghN(P^4*W]P^4*X`%!8G 6Et͙XXtt͙XXthOOhgOOfO2/@) $D./?q2//9/104>32#".!53'733%32>54.#"Ytt͙YYtt͙YI#R%NhgNNghNt͙XXtt͙XXW[OuhOOhgOOfO 4HC@# !?+5!:0D 0D&/q?q2//99//23310%!57>54.#"'>32!%4>32#".732>54.#"&4,7 . -H4)fD.N7,B-~SYtt͙YYtt͙YANhgNNghNT,@5/.#' =*25K0'EDI+{t͙XXtt͙XXthOOhgOOfO*>Ra@5#&###   +I5?+&  D:D N0/q?]q9/q9//99//9///910#"&'532654&+532654&#"5>32%4>32#".732>54.#")%KqL*ABOh[bNOP@MEBDU%U&or=65+Ytt͙YYtt͙YANhgNNghN.P<#S I?9:L@993Q \P32#".732>54.#"*x_*xYtt͙YYtt͙YANhgNNghNpR2t[t͙XXtt͙XXthOOhgOOfO1EG@# <(2 7-DA#/?]9/q//99//3210#"&'532654&+!!32%4>32#".732>54.#"-Ok>KJ&Vc]Xy=2_K-Ytt͙YYtt͙YANhgNNghN4V>"UNCB;eQ-L+t͙XXtt͙XXthOOhgOOfO+?SO@+$,J6@,!!!! )))E;D O1/?]q9/q//99//2210#"&54>;#">324&#"326%4>32#".732>54.#"#@Z7ty QjFK?\=""X35O5a@G)R&8$$PmAQ7M08L4AJE\8Mt͙XXtt͙XXthOOhgOOfO.?@ % D* /q2?]//99//33/310 #!5!4>32#".732>54.#"j0Ytt͙YYtt͙YANhgNNghN,dWt͙XXtt͙XXthOOhgOOfO)9Mam@<$ *2**:XDN: ////''55SID!!!]?/q?]q9/q99//99//99//9910#"&5467.54>324&#">4.'32>%4>32#".732>54.#"!%AX4svGKE>8U9loD?6'oB=*  ""C9DM//q?]9/q//99//3310+5326?#".54>32'"32674.4>32#".732>54.#"*º:A"W35P5#@Y54X@$$"LzLHBIE\7t͙XXtt͙XXthOOhgOOfO +?SE@ *$$$,J6@,*#""E;D &(O1/3/?2/2///99//10#".54>324.#"326!53'733%4>32#".732>54.#"oIQ(9$'9'&8%X@ #kX(6VYtt͙YYtt͙YANhgNNghN4#SggS##SjRm?Tl?Q;Aht͙XXtt͙XXthOOhgOOfO )=A@ 4 * /%D9/3/?23/2//99//10%!53'733!53'733%4>32#".732>54.#"kX(6VKkX(6VYtt͙YYtt͙YANhgNNghNQ;AhQQ;Aht͙XXtt͙XXthOOhgOOfO';OM@%&    (F2<(& A7D"$K-/3/?2/2//9///23310>323!57>54&#"!53'733%4>32#".732>54.#"D;)BM nl#$#$QkX(6VYtt͙YYtt͙YANhgNNghNgPY#<;=$QL5I8/4&Q;Aht͙XXtt͙XXthOOhgOOfO'2FZw@@1+"%""" +  +3Q=G31*)%  )LBD-/V8/3/q?2/q9/q92//9///9///910#"&'532654+532654&#"5>32!53'733%4>32#".732>54.#"`-D/'$*80Z12%$#!&3:BE$((4kX(6VYtt͙YYtt͙YANhgNNghN.P<#S I?sLC990Q \P32#".732>54.#"FPϬsF}}kX(6VYtt͙YYtt͙YANhgNNghNpE-gQ;Aht͙XXtt͙XXthOOhgOOfO';O[@-&    (F2<(& A7D"$K-/3/?2/9/q2//9///2310#"&'532654&+3#2!53'733%4>32#".732>54.#"R-E.)#428;4">0kX(6VYtt͙YYtt͙YANhgNNghN4U="TOCB:eQ/LQ;Aht͙XXtt͙XXthOOhgOOfO+6J^Y@,5/$ /  /7UAK75.-!!)-PFD13Z</3/?2/9/q2//9///2210#".54>;#">324&#"326!53'733%4>32#".732>54.#"o(8"$8'8]D #7'-8AY& #kX(6VYtt͙YYtt͙YANhgNNghN6V=!Hy\Yj:Q$?S0inAGAY8LQ;Aht͙XXtt͙XXthOOhgOOfO%9C@   0& +!D 5/3/2?22//9///3310##5!!53'733%4>32#".732>54.#"HTkX(6VYtt͙YYtt͙YANhgNNghNOsQCQ;Aht͙XXtt͙XXthOOhgOOfO,8CWkq@8%  -3B<-<<-DbNXDB;: 00**6:]SD">AgI/3/?2/9/q992//9///99//9910#"&5467.54>324#">4&'326!53'733%4>32#".732>54.#"v+<"LO,.*'&8'$7%+$ _@"0%((kX(6VYtt͙YYtt͙YANhgNNghN,D/aKAc'#Q7%@0.>#=W $.8G`0.$!B)L&#K+02-pQ;Aht͙XXtt͙XXthOOhgOOfO'2FZ]@/# 1+ ++ 3Q=G31*)  )LBD-0V8/3/?2/9/q2//9///3310+53265#"&54>32'"32674.!53'733%4>32#".732>54.#"o;Z=$NN(7<<(9#$8&% % kX(6VYtt͙YYtt͙YANhgNNghNWi]+Qqv(kb6W=!#N{LHBDE\7Q;Aht͙XXtt͙XXthOOhgOOfO =Qe\@0-!1.'71771>\HR>1-00WMD :0$$$$aC/q3/?2/2//9////23310#".54>324.#"326>323!57>54&#"4>32#".732>54.#"~IQ(9$'9'&8%X@ #;)BM nl#$#$Ytt͙YYtt͙YANhgNNghN4#SggS##SjRm?Tl?PY#<;=$QL5I8/4&t͙XXtt͙XXthOOhgOOfO +?Q@"( (  (,6,")**@H*;D&#@H#1/+3/?+2/2//9///104.#"326'#".532##7#!4>32#".o%8&'9'$9(QIX# @V6(XkYtt͙YYtt͙Y4gS##SggS#?lT?mlhA;QHt͙XXtt͙XXfO )I@    @H %D @H/+3/?+23/2//99//10##7#!%##7#!4>32#".V6(XkKV6(XkYtt͙YYtt͙Y&lhA;QQlhA;QHt͙XXtt͙XXfO';W@$ $  $(2(%&  &@H&7D"@H-/+3/?+2/22//9///2310>32!5#7>54&#"##7#!4>32#".l$#$#ln MB);)V6(XkYtt͙YYtt͙Y*&4/8I5LQ$=;<#YPlhA;QHt͙XXtt͙XXfO'2Fw@,)/ //3=3)01 ##1@H1BD -*@H*8/+3/q?+2/q9/q92//9///992/3104&'>54&#"632+32#"'32>##7#!4>32#".`4(($EB:3&!#$%21Z08*$'/D-V6(XkYtt͙YYtt͙YCIL32#".FsPF}}V6(XkYtt͙YYtt͙Y#EOglhA;QHt͙XXtt͙XXfO';a@ $ $  $(2(%&   &@H&7D "@H-/+3/?+2/9/q2//9///23104.#535#32#"&'32>##7#!4>32#".R0>"4;824#).E-V6(XkYtt͙YYtt͙Y7L/Q:BCOT"=U\lhA;QHt͙XXtt͙XXfO+6Ja@ -3&337A7-45))!5@H5FD 1.@H.</+3/?+2/9/q2//9///22104&#"54>;5#"32>'#".5>32##7#!4>32#".oA8-'7# D]8'8$"8(Y# &V6(XkYtt͙YYtt͙Yhi0S?$Q:jY\yH!=V0GL8YAGlhA;QHt͙XXtt͙XXfO%P@@H!D @H /+3/2?+22//9////10!33##7#!4>32#".HTV6(XkYtt͙YYtt͙YQlhA;QHt͙XXtt͙XXfO,8CWo@(:@(3 -@--@DND:AB666## 0B@HBSD+ >;@H;I/+3/?+2/9/q992//9///2/3/104.'>54.#"32>.54632#"&5467##7#!4>32#".v $+%7$'8&'*.,OL"<+_"@((%0V6(XkYtt͙YYtt͙Y#8.$ W=#>.0@%7Q#'cAKa/D)B!$.0/3-20+K#&L{lhA;QHt͙XXtt͙XXfO'2Fe@#)/%  /  /3=3)01  ""1@H1BD-*@H*8/+3/?+2/9/q2//9///33104.#"327+32>2#"&546##7#!4>32#".o&8$#9(<<7(NN$=Z; % %V6(XkYtt͙YYtt͙YWW{N#!=W6bk(vqQ+][7\EDBHLlhA;QHt͙XXtt͙XXfO =Q`@=1-07' -'  '->H>-1..@H.MD$::0@HC/+q3/?+2/2//9////23104.#"326'#".532%>32!5#7>54&#"4>32#".~%8&'9'$9(QIX# @ $#$#ln MB);Ytt͙YYtt͙Y4gS##SggS#?lT?m&4/8I5LQ$=;<#YPt͙XXtt͙XX-!@ BC D???10#"'532654&'.#"#463 aClDim{xPwp1dٟysa leU8CO}lNV @  AC??10!#!5!%5!}}FdO!:@"   C A?2?99//]]932103267!5!.'!5!!3##.+gv`No1N-<]FVLKTB`\]LRc>.-9@"    A C??9////9910573%%327673#!575.дnn[gf |XӛhixXX c#5AUaue+bvi+|li+BVi+\Li+i+i+Avv]Av)v9vIvYvivyvvv ]vb9A&6FVfv ]A]A&6FVfv ]A]$9$/<9YEXG/G>YEXg/g>Y39i+i+?)i+9 !A!'!7!G!W!g!w!!! ]A!!]QиYи!_иqиyи_01 5 #".54>324&#"326#".54>324&#"326#".54>324&#"326%#".54>324&#"326  $#A[76W>"#AZ76X>"52245134Z#A[76W>"#AZ7l52245134#A[76W?!#@[76X>"52245134#A[76W?!#@[76X>"52245134P?iL*"EhG?iM*"EiKTM\ESM[?iM*"EiG?iL*SM[ETM\?iL*"EhG?iM*"EiKTM\ESM[I?iL*"EhG?iM*"EiKTM\ESM[ ))0K f2r     & , R:   6  6  d h  6 @  L  XV *   2015 TypoStyle Co. All Rights Reserved.RegularCode New Roman:Version 2.10Version 2.10 March 29, 2015CodeNewRomanCode New Roman is a trademark of the TypoStyle Co.Samiru R.Code New Roman is aimed for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for programmers. This font improved and target to Mac OS Western New Roman, MONACO, Windows Consolas/Lusida Consolas, ABeeZee and Bitstream Vera Sans Mono.This font display allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortably reading of extended text on screen. OpenType features include hanging or lining numerals; slashed, dotted and normal zeros; and alternative shapes for a number of lower-case letters. The look of text can be tuned to personal taste by varying the number of bars and waves.http://typostyle.com/cat/reg/cnrhttp://typostyle.com/typo/dsinr/samiruIMPORTANT Code New Roman LICENSE TERMS This font is freeware. You can not redistribute and/or modify it. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: http://scripts.sil.org/OFL v1.1 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the OFL License for more details. ** and remember CNR is non-profit font** Designer: imSamiru@live.com 2015 TypoStyle Co. All Rights Reserved.RegularCode New Roman:Version 2.10Version 2.10 March 29, 2015CodeNewRomanCode New Roman is a trademark of the TypoStyle Co.Samiru R.Code New Roman is aimed for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for programmers. This font improved and target to Mac OS Western New Roman, MONACO, Windows Consolas/Lusida Consolas, ABeeZee and Bitstream Vera Sans Mono.This font display allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortably reading of extended text on screen. OpenType features include hanging or lining numerals; slashed, dotted and normal zeros; and alternative shapes for a number of lower-case letters. The look of text can be tuned to personal taste by varying the number of bars and waves.http://typostyle.com/cat/reg/cnrhttp://typostyle.com/typo/dsinr/samiruIMPORTANT Code New Roman LICENSE TERMS This font is freeware. You can not redistribute and/or modify it. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: http://scripts.sil.org/OFL v1.1 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the OFL License for more details. ** and remember CNR is non-profit font** Designer: imSamiru@live.com $%&'()*+,-./0123456789:;<=bc d  e   !"#f$%g&'()*+,-./0123h456789:;<=>?@DEFGHIJKLMNOPQRSTUVWXYZ[\]jikmlABnCDEFGoHqprIsJKLMNOPQRSTutvUwVWXYZ[\]^_`abcxdefzy{}|ghijklmnopqrst~uvwxyz{|}~ C"_ >@^`       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Aa?B # !      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                            ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   TypoStyleAmacronAbreve AringacuteAogonekAEacute Ccircumflex CdotaccentDcaronDcroatEcaronEmacronEbreve EdotaccentEogonek Gcircumflex Gdotaccentuni0122 HcircumflexHbarItildeImacronIbreve IdotaccentIogonekIJ Jcircumflexuni0136LacuteLcaronuni013BLdotNacuteNcaronuni0145EngOmacronObreve Ohungarumlaut OslashacuteRacuteRcaronuni0156Sacute Scircumflexuni0218Tcaronuni021ATbarUtildeUmacronUbreveUring UhungarumlautUogonekWgraveWacute Wcircumflex WdieresisYgrave YcircumflexZacute Zdotaccentamacronabreve aringacuteaogonekaeacute ccircumflex cdotaccentdcaronecaronemacronebreve edotaccenteogonekuniFB01uniFB02 gcircumflex gdotaccentuni0123 hcircumflexhbaritildeimacronibreveiogonekijuni0237 jcircumflexuni0137 kgreenlandiclacutelcaronuni013Cldotnacutencaronuni0146 napostropheengomacronobreve ohungarumlaut oslashacuteracutercaronuni0157sacute scircumflexuni0219longstcaronuni021Btbarutildeumacronubreveuring uhungarumlautuogonekwgravewacute wcircumflex wdieresisygrave ycircumflexzacute zdotaccentf.ss04f.ss05i.ss05 igrave.ss05 iacute.ss05icircumflex.ss05 itilde.ss05idieresis.ss05 imacron.ss05 ibreve.ss05 iogonek.ss05 dotlessi.ss05_277_278_279_280_281_282_283_284_285_286_287_288_289l.ss05 lacute.ss05 lcaron.ss05 uni013C.ss05 lslash.ss05 ldot.ss05_296_297_298_299_300_301r.ss04 racute.ss04 rcaron.ss04 uni0157.ss04r.ss05 racute.ss05 rcaron.ss05 uni0157.ss05_310_311_312_313ampersand.ss05_317_319 uni0302.ccmp uni030C.ccmpuni0315tildecomb.ccmp uni0308.ccmp uni0304.ccmp uni0306.ccmp uni030A.ccmp_335 uni030B.ccmp uni0307.ccmpuni0326uni0312_344 hyphen.caseexclamdown.casequestiondown.caseuni203Dguilsinglleft.caseguilsinglright.caseguillemotleft.caseguillemotright.case endash.case emdash.caseuni2015periodcentered.caseparenleft.caseparenright.casebracketleft.casebracketright.casebraceleft.casebraceright.caseAlphaBetaGammauni0394EpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilonPhiChiPsiuni03A9 Alphatonos EpsilontonosEtatonos Iotatonos Iotadieresis Omicrontonos UpsilontonosUpsilondieresis Omegatonosalphabeta beta.ss03gammadeltaepsilonzetaetatheta theta.ss03iotakappalambdauni03BCnuxiomicronrhosigmasigma1tauupsilonphiphi.ss03chipsiomega alphatonos epsilontonosetatonos iotatonos iotadieresisiotadieresistonos omicrontonos upsilontonosupsilondieresistonosupsilondieresis omegatonostonos_473 dieresistonos anoteleiaanoteleia.caseuni037Euni0374uni0375uni0410uni0411uni0412uni0413uni0414uni0415uni0416uni0417uni0418uni0419uni041Auni041Buni041Cuni041Duni041Euni041Funi0420uni0421uni0422uni0423uni0424uni0425uni0426uni0427uni0428uni0429uni042Auni042Buni042Cuni042Duni042Euni042Funi0403uni0490uni0402uni0404uni0405uni0400uni0401uni0406uni0407uni0408uni040Duni040Cuni0409uni040Auni040Buni040Euni040Funi0462uni0472uni0474uni0430uni0431uni0432uni0433uni0434uni0435uni0436uni0437uni0438uni0439uni043Auni043Buni043Cuni043Duni043Euni043Funi0440uni0441uni0442uni0443uni0444uni0445uni0446uni0447uni0448uni0449uni044Auni044Buni044Cuni044Duni044Euni044Funi0453uni0491uni0452uni0454uni0455uni0450uni0451uni0456uni0457uni0458uni045Duni045Cuni0459uni045Auni045Buni045Euni045Funi0463uni0473uni0475 uni0431.locl breve.locl breve.ccmpat.caseuni2117 estimatedEuro dollar.onumuni2116 zero.ss08 zero.ss07 zero.onumzero.onum_ss08zero.onum_ss07one.onumtwo.onum three.onum four.onum five.onumsix.onum seven.onum eight.onum nine.onumuni2070uni00B9uni00B2uni00B3uni2074uni2075uni2076uni2077uni2078uni2079uni207Auni207Buni207Cuni207Duni207Euni2080uni2081uni2082uni2083uni2084uni2085uni2086uni2087uni2088uni2089uni208Auni208Buni208Cuni208Duni208E uni2070.fraconesuperior.fractwosuperior.fracthreesuperior.frac uni2074.frac uni2075.frac uni2076.frac uni2077.frac uni2078.frac uni2079.fracuni2113_708 hookabovecombhookabovecomb.ccmp_711_712_713_714_715_716_717_718_719_720_721_722_723_724_725_726 dotbelowcombuni1EA0uni1EA2uni1EA4uni1EA6uni1EA8uni1EAAuni1EACuni1EAEuni1EB0uni1EB2uni1EB4uni1EB6uni1EB8uni1EBAuni1EBCuni1EBEuni1EC0uni1EC2uni1EC4uni1EC6uni1EC8uni1ECAuni1ECCuni1ECEuni1ED0uni1ED2uni1ED4uni1ED6uni1ED8Ohornuni1EDAuni1EDCuni1EDEuni1EE0uni1EE2uni1EE4uni1EE6Uhornuni1EE8uni1EEAuni1EECuni1EEEuni1EF0uni1EF4uni1EF8uni1EA1uni1EA3uni1EA5uni1EA7uni1EA9uni1EABuni1EADuni1EAFuni1EB1uni1EB3uni1EB5uni1EB7uni1EB9uni1EBBuni1EBDuni1EBFuni1EC1uni1EC3uni1EC5uni1EC7uni1EC9uni1ECBuni1ECDuni1ECFuni1ED1uni1ED3uni1ED5uni1ED7uni1ED9ohornuni1EDBuni1EDDuni1EDFuni1EE1uni1EE3uni1EE5uni1EE7uhornuni1EE9uni1EEBuni1EEDuni1EEFuni1EF1uni1EF5uni1EF6uni1EF7uni1EF9dongcircle underscoredbl oneeighth threeeighths fiveeighths seveneighthsuni207F exclamdbllirapeseta revlogicalnot intersection equivalence integraltp integralbt smileface invsmilefacemalefemaleheartdiamondclubspade musicalnotemusicalnotedblsununi2736houseuni2043 invbullet_852 invcircle filledboxtriaguptriagdnH18543uni25B4uni25BEuni25C2uni25B8triaglftriagrtarrowup arrowdown arrowupdn arrowupdnbse arrowleft arrowright arrowboth orthogonal filledrectblockupblocklfblockrtblockdnblockltshadeshadedkshadeSF110000SF050000SF090000SF080000SF070000SF040000SF020000SF060000SF030000SF010000SF100000SF540000SF190000SF360000SF450000SF280000SF500000SF470000SF220000SF510000SF240000SF440000SF230000SF420000SF400000SF260000SF380000SF410000SF250000SF390000SF430000SF530000SF200000SF370000SF460000SF270000SF490000SF480000SF210000SF520000uni25CCEng.ss01Eng.ss02Eng.ss03uni0162uni0163 iogonek.ccmpA.supsB.supsC.supsD.supsE.supsF.supsG.supsH.supsI.supsJ.supsK.supsL.supsM.supsN.supsO.supsP.supsQ.supsR.supsS.supsT.supsU.supsV.supsW.supsX.supsY.supsZ.supsuni0305 uni0305.ccmpuni030D uni030D.ccmpuni030E uni030E.ccmpuni030F uni030F.ccmpuni0310 uni0310.ccmpuni0311 uni0311.ccmp_966_967uni0313 uni0313.ccmpuni0314 uni0314.ccmpuni0316uni0317uni0318uni0319uni031A uni031A.ccmpuni031Cuni031Duni031Euni031Funi0320uni0321uni0322uni0324uni0325uni0329uni032Auni032Buni032Cuni032Duni032Euni032Funi0330uni0331uni0332uni0333uni0334 uni0334.ccmpuni0335 uni0335.ccmpuni0336 uni0336.ccmpuni0337 uni0337.ccmpuni0338 uni0338.ccmpuni0339uni033Auni033Buni033Cuni033D uni033D.ccmpuni033E uni033E.ccmpuni033F uni033F.ccmpuni0340 uni0340.ccmpuni0341 uni0341.ccmpuni0346 uni0346.ccmpuni0347uni0348uni0349uni034A uni034A.ccmpuni034B uni034B.ccmpuni034C uni034C.ccmpuni034Duni034Euni034Funi0350 uni0350.ccmpuni0351 uni0351.ccmpuni0352 uni0352.ccmpuni0353uni0354uni0355uni0356uni0357 uni0357.ccmpuni0358 uni0358.ccmpuni0359uni035Auni035B uni035B.ccmpuni035Cuni035D uni035D.ccmpuni035E uni035E.ccmpuni035Funi0360 uni0360.ccmpuni0361 uni0361.ccmpuni0362uni0363 uni0363.ccmpuni0364 uni0364.ccmpuni0365 uni0365.ccmpuni0366 uni0366.ccmpuni0367 uni0367.ccmpuni0368 uni0368.ccmpuni0369 uni0369.ccmpuni036A uni036A.ccmpuni036B uni036B.ccmpuni036C uni036C.ccmpuni036D uni036D.ccmpuni036E uni036E.ccmpuni036F uni036F.ccmpuni1DC0 uni1DC0.ccmpuni1DC1 uni1DC1.ccmpuni1DC2uni1DC3uni1DC4 uni1DC4.ccmpuni1DC5 uni1DC5.ccmpuni1DC6 uni1DC6.ccmpuni1DC7 uni1DC7.ccmpuni1DC8 uni1DC8.ccmpuni1DC9 uni1DC9.ccmpuni1DCAuni1DFE uni1DFE.ccmpuni1DFFuni0181uni0182uni0184uni0186uni0187uni0189uni018Auni018Buni018Euni018Funi0190uni0191uni0193uni0194uni0196uni0197uni0198uni019Cuni019Duni019Funi01A2uni01A4uni01A6uni01A7uni01A9uni01ACuni01AEuni01B1uni01B2uni01B3uni01B5uni01B7uni01B8uni01BCuni01C4uni01C5uni01C7uni01C8uni01CAuni01CBuni01CDuni01CFuni01D1uni01D3uni01D5uni01D7uni01D9uni01DBuni01DEuni01E0uni01E2uni01E4Gcaronuni01E8uni01EAuni01ECuni01EEuni01F1uni01F2uni01F4uni01F6uni01F7uni01F8uni0200uni0202uni0204uni0206uni0208uni020Auni020Cuni020Euni0210uni0212uni0214uni0216uni021Cuni021Euni0220uni0222uni0224uni0226uni0228uni022Auni022Cuni022Euni0230uni0232uni023Auni023Buni023Duni023Euni0241uni0243uni0244uni0245uni0246uni0248uni024Auni024Cuni024Euni1E00uni1E02uni1E04uni1E06uni1E08uni1E0Auni1E0Cuni1E0Euni1E10uni1E12uni1E14uni1E16uni1E18uni1E1Auni1E1Cuni1E1Euni1E20uni1E22uni1E24uni1E26uni1E28uni1E2Auni1E2Cuni1E2Euni1E30uni1E32uni1E34uni1E36uni1E38uni1E3Auni1E3Cuni1E3Euni1E40uni1E42uni1E44uni1E46uni1E48uni1E4Auni1E4Cuni1E4Euni1E50uni1E52uni1E54uni1E56uni1E58uni1E5Auni1E5Cuni1E5Euni1E60uni1E62uni1E64uni1E66uni1E68uni1E6Auni1E6Cuni1E6Euni1E70uni1E72uni1E74uni1E76uni1E78uni1E7Auni1E7Cuni1E7Euni1E86uni1E88uni1E8Auni1E8Cuni1E8Euni1E90uni1E92uni1E94uni2C60uni2C62uni2C63uni2C64uni2C67uni2C69uni2C6Buni2183uni2132uni2C75uni0180uni0183uni0185uni0188uni018Cuni018D_1301uni0195uni01BFuni0199uni019A uni019A.ss05_1307uni019Buni019Euni01A3uni01A5uni01A8uni01ABuni01ADuni01B4uni01B6uni01B9uni01BAuni01BDuni01C6uni01C9uni01CCuni01CEuni01D0 uni01D0.ss05_1326uni01D2uni01D4uni01D6uni01D8uni01DAuni01DCuni01DDuni01DFuni01E1uni01E3uni01E5gcaronuni01E9uni01EBuni01EDuni01EFuni01F0_1344uni01F3uni01F5uni01F9uni0201uni0203uni0205uni0207uni0209 uni0209.ss05_1354uni020B uni020B.ss05_1357uni020Duni020Funi0211 uni0211.ss04_1362_1363uni0213 uni0213.ss04_1366_1367uni0215uni0217uni021Duni021Funi0221uni0223uni0225uni0227uni0229uni022Buni022Duni022Funi0231uni0233uni0234uni0235uni0236uni0238uni0239uni023Cuni023Funi0240uni0242uni0247uni0249_1393 uni0249.ccmp_1395uni024Buni024D uni024D.ss04_1399_1400uni024Funi01AAuni01BBuni01BEuni01C0uni01C1uni01C2uni01C3uni1E01uni1E03uni1E05uni1E07uni1E09uni1E0Buni1E0Duni1E0Funi1E11uni1E13uni1E15uni1E17uni1E19uni1E1Buni1E1Duni1E1F uni1E1F.ss04_1426uni1E21uni1E23uni1E25uni1E27uni1E29uni1E2Buni1E2D uni1E2D.ss05_1435 uni1E2D.ccmpuni1E2D.ccmp_ss05_1438uni1E2Funi1E31uni1E33uni1E35uni1E37 uni1E37.ss05_1445uni1E39 uni1E39.ss05_1448uni1E3B uni1E3B.ss05_1451uni1E3D uni1E3D.ss05_1454uni1E3Funi1E41uni1E43uni1E45uni1E47uni1E49uni1E4Buni1E4Duni1E4Funi1E51uni1E53uni1E55uni1E57uni1E59 uni1E59.ss04 uni1E59.ss05_1471uni1E5B uni1E5B.ss04 uni1E5B.ss05_1475uni1E5D uni1E5D.ss04 uni1E5D.ss05_1479uni1E5F uni1E5F.ss04 uni1E5F.ss05_1483uni1E61uni1E63uni1E65uni1E67uni1E69uni1E6Buni1E6Duni1E6Funi1E71uni1E73uni1E75uni1E77uni1E79uni1E7Buni1E7Duni1E7Funi1E87uni1E89uni1E8Buni1E8Duni1E8Funi1E91uni1E93uni1E95uni1E96uni1E97uni1E98uni1E99uni1E9Auni1E9Buni2C61 uni2C61.ss05_1516uni2C65uni2C66uni2C68uni2C6Auni2C6Cuni2C74uni2184uni214Euni2C76uni2C77uni0250uni0251uni0252uni0253uni0254uni0255uni0256uni0257uni0258uni0259uni025Auni025Buni025Cuni025Duni025Euni025Funi0260uni0261uni0262uni0263uni0264uni0265uni0266uni0267uni0268 uni0268.ss05_1553 uni0268.ccmpuni0268.ccmp_ss05_1556uni0269uni026Auni026Buni026Cuni026Duni026Euni026Funi0270uni0271uni0272uni0273uni0274uni0275uni0276uni0277uni0278uni0279uni027Auni027Buni027Cuni027Duni027Euni027Funi0280uni0281uni0282uni0283uni0284uni0285uni0286uni0287uni0288uni0289uni028Auni028Buni028Cuni028Duni028Euni028Funi0290uni0291uni0292uni0293uni0294uni0295uni0296uni0297uni0298uni0299uni029Auni029Buni029Cuni029Duni029Euni029Funi02A0uni02A1uni02A2uni02A3uni02A4uni02A5uni02A6uni02A7uni02A8uni02A9uni02AAuni02ABuni02ACuni02ADuni02AEuni02AFuni1D00uni1D01uni1D02uni1D03uni1D04uni1D05uni1D06uni1D07uni1D08uni1D09uni1D0Auni1D0Buni1D0Cuni1D0Duni1D0Euni1D0Funi1D10uni1D11uni1D12uni1D13uni1D14uni1D15uni1D16uni1D17uni1D18uni1D19uni1D1Auni1D1Buni1D1Cuni1D1Duni1D1Euni1D1Funi1D20uni1D21uni1D22uni1D23uni1D24uni1D25uni1D26uni1D27uni1D28uni1D29uni1D2Auni1D2Buni1D2Cuni1D2Duni1D2Euni1D2Funi1D30uni1D31uni1D32uni1D33uni1D34uni1D35uni1D36uni1D37uni1D38uni1D39uni1D3Auni1D3Buni1D3Cuni1D3Duni1D3Euni1D3Funi1D40uni1D41uni1D42uni1D43uni1D44uni1D45uni1D46uni1D47uni1D48uni1D49uni1D4Auni1D4Buni1D4Cuni1D4Duni1D4Euni1D4Funi1D50uni1D51uni1D52uni1D53uni1D54uni1D55uni1D56uni1D57uni1D58uni1D59uni1D5Auni1D5Buni1D5Cuni1D5Duni1D5Euni1D5Funi1D60uni1D61uni1D62uni1D63uni1D64uni1D65uni1D66uni1D67uni1D68uni1D69uni1D6Auni1D6Buni1D6Cuni1D6Duni1D6Euni1D6Funi1D70uni1D71uni1D72uni1D73uni1D74uni1D75uni1D76uni1D77uni1D78uni1D79uni1D7Auni1D7Buni1D7Cuni1D7Duni1D7Euni1D7Funi1D80uni1D81uni1D82uni1D83uni1D84uni1D85uni1D86uni1D87uni1D88uni1D89uni1D8Auni1D8Buni1D8Cuni1D8Duni1D8Euni1D8Funi1D90uni1D91uni1D92uni1D93uni1D94uni1D95uni1D96uni1D97uni1D98uni1D99uni1D9Auni1D9Buni1D9Cuni1D9Duni1D9Euni1D9Funi1DA0uni1DA1uni1DA2uni1DA3uni1DA4uni1DA5uni1DA6uni1DA7uni1DA8uni1DA9uni1DAAuni1DABuni1DACuni1DADuni1DAEuni1DAFuni1DB0uni1DB1uni1DB2uni1DB3uni1DB4uni1DB5uni1DB6uni1DB7uni1DB8uni1DB9uni1DBAuni1DBBuni1DBCuni1DBDuni1DBEuni1DBFuni02B0uni02B1uni02B2uni02B3uni02B4uni02B5uni02B6uni02B7uni02B8_1829_1830uni02BBuni02BCuni02BDuni02BEuni02BFuni02C0uni02C1uni02C2uni02C3uni02C4uni02C5uni02C8uni02CAuni02CBuni02CCuni02CDuni02CEuni02CFuni02D0uni02D1uni02D2uni02D3uni02D4uni02D5uni02D6uni02D7uni02DEuni02DFuni02E0uni02E1uni02E2uni02E3uni02E4uni02E5uni02E6uni02E7uni02E8uni02E9uni02E5_uni02E5_uni02E6uni02E5_uni02E5_uni02E7uni02E5_uni02E5_uni02E8uni02E5_uni02E5_uni02E9uni02E5_uni02E6uni02E5_uni02E6_uni02E5uni02E5_uni02E6_uni02E6uni02E5_uni02E6_uni02E7uni02E5_uni02E6_uni02E8uni02E5_uni02E6_uni02E9uni02E5_uni02E7uni02E5_uni02E7_uni02E5uni02E5_uni02E7_uni02E6uni02E5_uni02E7_uni02E7uni02E5_uni02E7_uni02E8uni02E5_uni02E7_uni02E9uni02E5_uni02E8uni02E5_uni02E8_uni02E5uni02E5_uni02E8_uni02E6uni02E5_uni02E8_uni02E7uni02E5_uni02E8_uni02E8uni02E5_uni02E8_uni02E9uni02E5_uni02E9uni02E5_uni02E9_uni02E5uni02E5_uni02E9_uni02E6uni02E5_uni02E9_uni02E7uni02E5_uni02E9_uni02E8uni02E5_uni02E9_uni02E9uni02E6_uni02E5uni02E6_uni02E5_uni02E5uni02E6_uni02E5_uni02E6uni02E6_uni02E5_uni02E7uni02E6_uni02E5_uni02E8uni02E6_uni02E5_uni02E9uni02E6_uni02E6_uni02E5uni02E6_uni02E6_uni02E7uni02E6_uni02E6_uni02E8uni02E6_uni02E6_uni02E9uni02E6_uni02E7uni02E6_uni02E7_uni02E5uni02E6_uni02E7_uni02E6uni02E6_uni02E7_uni02E7uni02E6_uni02E7_uni02E8uni02E6_uni02E7_uni02E9uni02E6_uni02E8uni02E6_uni02E8_uni02E5uni02E6_uni02E8_uni02E6uni02E6_uni02E8_uni02E7uni02E6_uni02E8_uni02E8uni02E6_uni02E8_uni02E9uni02E6_uni02E9uni02E6_uni02E9_uni02E5uni02E6_uni02E9_uni02E6uni02E6_uni02E9_uni02E7uni02E6_uni02E9_uni02E8uni02E6_uni02E9_uni02E9uni02E7_uni02E5uni02E7_uni02E5_uni02E5uni02E7_uni02E5_uni02E6uni02E7_uni02E5_uni02E7uni02E7_uni02E5_uni02E8uni02E7_uni02E5_uni02E9uni02E7_uni02E6uni02E7_uni02E6_uni02E5uni02E7_uni02E6_uni02E6uni02E7_uni02E6_uni02E7uni02E7_uni02E6_uni02E8uni02E7_uni02E6_uni02E9uni02E7_uni02E7_uni02E5uni02E7_uni02E7_uni02E6uni02E7_uni02E7_uni02E8uni02E7_uni02E7_uni02E9uni02E7_uni02E8uni02E7_uni02E8_uni02E5uni02E7_uni02E8_uni02E6uni02E7_uni02E8_uni02E7uni02E7_uni02E8_uni02E8uni02E7_uni02E8_uni02E9uni02E7_uni02E9uni02E7_uni02E9_uni02E5uni02E7_uni02E9_uni02E6uni02E7_uni02E9_uni02E7uni02E7_uni02E9_uni02E8uni02E7_uni02E9_uni02E9uni02E8_uni02E5uni02E8_uni02E5_uni02E5uni02E8_uni02E5_uni02E6uni02E8_uni02E5_uni02E7uni02E8_uni02E5_uni02E8uni02E8_uni02E5_uni02E9uni02E8_uni02E6uni02E8_uni02E6_uni02E5uni02E8_uni02E6_uni02E6uni02E8_uni02E6_uni02E7uni02E8_uni02E6_uni02E8uni02E8_uni02E6_uni02E9uni02E8_uni02E7uni02E8_uni02E7_uni02E5uni02E8_uni02E7_uni02E6uni02E8_uni02E7_uni02E7uni02E8_uni02E7_uni02E8uni02E8_uni02E7_uni02E9uni02E8_uni02E8_uni02E5uni02E8_uni02E8_uni02E6uni02E8_uni02E8_uni02E7uni02E8_uni02E8_uni02E9uni02E8_uni02E9uni02E8_uni02E9_uni02E5uni02E8_uni02E9_uni02E6uni02E8_uni02E9_uni02E7uni02E8_uni02E9_uni02E8uni02E8_uni02E9_uni02E9uni02E9_uni02E5uni02E9_uni02E5_uni02E5uni02E9_uni02E5_uni02E6uni02E9_uni02E5_uni02E7uni02E9_uni02E5_uni02E8uni02E9_uni02E5_uni02E9uni02E9_uni02E6uni02E9_uni02E6_uni02E5uni02E9_uni02E6_uni02E6uni02E9_uni02E6_uni02E7uni02E9_uni02E6_uni02E8uni02E9_uni02E6_uni02E9uni02E9_uni02E7uni02E9_uni02E7_uni02E5uni02E9_uni02E7_uni02E6uni02E9_uni02E7_uni02E7uni02E9_uni02E7_uni02E8uni02E9_uni02E7_uni02E9uni02E9_uni02E8uni02E9_uni02E8_uni02E5uni02E9_uni02E8_uni02E6uni02E9_uni02E8_uni02E7uni02E9_uni02E8_uni02E8uni02E9_uni02E8_uni02E9uni02E9_uni02E9_uni02E5uni02E9_uni02E9_uni02E6uni02E9_uni02E9_uni02E7uni02E9_uni02E9_uni02E8uni02EAuni02EBuni02ECuni02EDuni02EEuni02EFuni02F0uni02F1uni02F2uni02F3uni02F4uni02F5uni02F6uni02F7uni02F8uni02F9uni02FAuni02FBuni02FCuni02FDuni02FEuni02FFuniA717uniA718uniA719uniA71AuniA720uniA721uni2090uni2091uni2092uni2093uni2094 uni0313.locluni0313.locl_ccmp uni0314.locluni0314.locl_ccmpacutecomb.loclacutecomb.ccmpgravecomb.loclgravecomb.ccmpuni0342 uni0342.ccmpuni0313.locl_acutecomb.locluni0313.locl_acutecomb_ccmpuni0313.locl_gravecomb.locluni0313.locl_gravecomb_ccmpuni0313.locl_uni0342uni0313.locl_uni0342_ccmpuni0314.locl_acutecomb.locluni0314.locl_acutecomb_ccmpuni0314.locl_gravecomb.locluni0314.locl_gravecomb_ccmpuni0314.locl_uni0342uni0314.locl_uni0342_ccmpuni0308_acutecomb.locluni0308_acutecomb.ccmpuni0308_gravecomb.locluni0308_gravecomb.ccmpuni0308_uni0342uni0308_uni0342.ccmp_2070_2071uni0343 uni0343.ccmpuni0304_uni0313.locl_acutecomb.uni0304_uni0313.locl_gravecomb.uni0304_uni0314.locl_acutecomb.uni0304_uni0314.locl_gravecomb.uni0306_uni0313.locl_acutecomb.uni0306_uni0313.locl_gravecomb.uni0306_uni0314.locl_acutecomb.uni0306_uni0314.locl_gravecomb.uni0308_uni0304_acutecomb.locluni0308_uni0304_gravecomb.locluni0308_uni0306_acutecomb.locluni0308_uni0306_gravecomb.locluni0345 uni0345.ccmpuni03F4uni03F9uni03FDuni03FEuni03FFUpsilon1uni03D3uni03D4uni03DCuni03D8uni03DEuni03FAuni03E0uni03DAuni03F7uni03D0uni03F5uni03F6theta1uni03F0omega1uni03F1uni03FCuni03F2uni037Buni037Cuni037Dphi1uni03DDuni03D9uni03DFuni03FBuni03E1uni03DBuni03F3uni03F8uni03D7uni1F08uni1F0Cuni1F0Auni1F0Euni1F09uni1F0Duni1F0Buni1F0Funi1FBBuni1FBAuni1FB9uni1FB8uni1FBCuni1F88uni1F8Cuni1F8Auni1F8Euni1F89uni1F8Duni1F8Buni1F8Funi1F18uni1F1Cuni1F1Auni1F19uni1F1Duni1F1Buni1FC9uni1FC8uni1F28uni1F2Cuni1F2Auni1F2Euni1F29uni1F2Duni1F2Buni1F2Funi1FCBuni1FCAuni1FCCuni1F98uni1F9Cuni1F9Auni1F9Euni1F99uni1F9Duni1F9Buni1F9Funi1F38uni1F3Cuni1F3Auni1F3Euni1F39uni1F3Duni1F3Buni1F3Funi1FDBuni1FDAuni1FD9uni1FD8uni1F48uni1F4Cuni1F4Auni1F49uni1F4Duni1F4Buni1FF9uni1FF8uni1FECuni1F59uni1F5Duni1F5Buni1F5Funi1FEBuni1FEAuni1FE9uni1FE8uni1F68uni1F6Cuni1F6Auni1F6Euni1F69uni1F6Duni1F6Buni1F6Funi1FFBuni1FFAuni1FFCuni1FA8uni1FACuni1FAAuni1FAEuni1FA9uni1FADuni1FABuni1FAFuni1F00uni1F04uni1F02uni1F06uni1F01uni1F05uni1F03uni1F07uni1F71uni1F70uni1FB6uni1FB1uni1FB0uni1FB3uni1F80uni1F84uni1F82uni1F86uni1F81uni1F85uni1F83uni1F87uni1FB4uni1FB2uni1FB7uni1F10uni1F14uni1F12uni1F11uni1F15uni1F13uni1F73uni1F72uni1F20uni1F24uni1F22uni1F26uni1F21uni1F25uni1F23uni1F27uni1F75uni1F74uni1FC6uni1FC3uni1F90uni1F94uni1F92uni1F96uni1F91uni1F95uni1F93uni1F97uni1FC4uni1FC2uni1FC7uni1F30uni1F34uni1F32uni1F36uni1F31uni1F35uni1F33uni1F37uni1FD3uni1FD2uni1FD7uni1F77uni1F76uni1FD6uni1FD1uni1FD0uni1F40uni1F44uni1F42uni1F41uni1F45uni1F43uni1F79uni1F78uni1FE4uni1FE5uni1F50uni1F54uni1F52uni1F56uni1F51uni1F55uni1F53uni1F57uni1FE3uni1FE2uni1FE7uni1F7Buni1F7Auni1FE6uni1FE1uni1FE0uni1F60uni1F64uni1F62uni1F66uni1F61uni1F65uni1F63uni1F67uni1F7Duni1F7Cuni1FF6uni1FF3uni1FA0uni1FA4uni1FA2uni1FA6uni1FA1uni1FA5uni1FA3uni1FA7uni1FF4uni1FF2uni1FF7uni1FBFuni1FFEuni1FFDuni1FEFuni1FC0uni1FCEuni1FCDuni1FCFuni1FDEuni1FDDuni1FDFuni1FEEuni1FEDuni1FC1uni1FBD_2357_2358uni037A_2360uni048Auni048Cuni048Euni0492uni0494uni0496uni0498uni049Auni049Cuni049Euni04A0uni04A2uni04A4uni04A6uni04A8uni04AAuni04ACuni04AEuni04B0uni04B2uni04B4uni04B6uni04B8uni04BAuni04BCuni04BEuni04C0uni04C1uni04C3uni04C5uni04C7uni04C9uni04CBuni04CDuni04D0uni04D2uni04D4uni04D6uni04D8uni04DAuni04DCuni04DEuni04E0uni04E2uni04E4uni04E6uni04E8uni04EAuni04ECuni04EEuni04F0uni04F2uni04F4uni04F6uni04F8uni04FAuni04FCuni04FEuni0500uni0502uni0504uni0506uni0508uni050Auni050Cuni050Euni0510uni0512uni048Buni048Duni048Funi0493uni0495uni0497uni0499uni049Buni049Duni049Funi04A1uni04A3uni04A5uni04A7uni04A9uni04ABuni04ADuni04AFuni04B1uni04B3uni04B5uni04B7uni04B9uni04BBuni04BDuni04BFuni04C2uni04C4uni04C6uni04C8uni04CAuni04CCuni04CEuni04CFuni04D1uni04D3uni04D5uni04D7uni04D9uni04DBuni04DDuni04DFuni04E1uni04E3uni04E5uni04E7uni04E9uni04EBuni04EDuni04EFuni04F1uni04F3uni04F5uni04F7uni04F9uni04FBuni04FDuni04FFuni0501uni0503uni0505uni0507uni0509uni050Buni050Duni050Funi0511uni0513uni2000uni2001uni2002uni2003uni2004uni2005uni2006uni2007uni2008uni2009uni200Auni200Buni200Cuni200D figuredashfiguredash.caseuni2016_2514 quotereverseduni201Fminuteseconduni2034uni203Euni2E17uni20A0 colonmonetaryuni20A2uni20A5uni20A6uni20A8uni20A9uni20AAuni20ADuni20AEuni20AFuni20B0uni20B1uni20B2uni20B3uni20B4uni20B5uni2105uni214Donethird twothirdsuni2155uni2156uni2157uni2158uni2159uni215Auni03E2uni03E4uni03E6uni03E8uni03EAuni03ECuni03EEuni03E3uni03E5uni03E7uni03E9uni03EBuni03EDuni03EFuni0483uni0484 uni0484.ccmpuni0485 uni0485.ccmpuni0486 uni0486.ccmp_2570_2571uni0482uni20DDuni0488uni0489uni0460uni0464uni0466uni0468uni046Auni046Cuni046Euni0470uni0476uni0478uni047Auni047Cuni047Euni0480uni0461uni0465uni0467uni0469uni046Buni046Duni046Funi0471uni0477uni0479uni047Buni047Duni047Funi0481uni02BA gravecomb acutecombuni0302 tildecombuni0304uni0306uni0307uni0308uni030Auni030Buni030Cuni031Buni0327uni0328uni0344uni0E3Funi200Euni200Funi202Funi205Euni205Funi2071uni2215H22073H18551H18533 openbulletuniFE20uniFE21uniFE22uniFE23uniFEFF_2637_2638_2639_2640_2641_2642_2643_2644_2645_2646_2647_2648_2649_2650_2651_2652_2653_2654_2655_2656_2657_2658_2659_2660_2661_2662_2663_2664_2665_2666_2667_2668_2669_2670_2671_2672_2673_2674_2675_2676_2677_2678_2679_2680_2681uni24FFuni2776uni2777uni2778uni2779uni277Auni277Buni277Cuni277Duni277E uni1ECB.ss05_2693 uni1ECB.ccmpuni1ECB.ccmp_ss05_2696iogonek.ccmp_ss05_2698uni24EAuni2460uni2461uni2462uni2463uni2464uni2465uni2466uni2467uni2468uni2469uni246Auni246Buni246Cuni246Duni246Euni246Funi2470uni2471uni2472uni2473uni277Funi24EBuni24ECuni24EDuni24EEuni24EFuni24F0uni24F1uni24F2uni24F3uni24F4uni1E9Euni20B8uni20B9uni20BAuni2031_30_31_7  r%'(*_aik==??AACDFFHHJJLLNNQQSSVV""''//13::CC__""(*03  XY$',/0558?AHKKNPTTX`ccemrrzzAA&     - ; H K  cyrlgrek2latn@ SRB IPPH ROM *TRK 4markmkmk$   (08@HPX`hX)*-B;b==JXlXaT  &,28>D JPV\bVDhntzztVbV "V(t.444444444444::::@@FFFFF::::LRX^^tdjptFv| $*06<BHN*TZ`flfrx~x0  &* ,* &*28*$>DJ<66PVPVV\bhnB t*z*2*NhZflllrr  "(.4:@FLDRDR0X^Xdjpv|v|"""h* $*06<BHNTZN`flfrflfrx~"fr****>fffffx"fffffff x&",f28>DJPfV8\bhnttzfffffffx"ff4fff6fff<d BHBf"ff"fx(".f4ff:f:f:x@fFfLfRxXf^fdjpv| BZxf$<N fL8>$*06<BHNH*TZ`f*lrx6~B*pp *&,28>D8JPV\bhntz|N**x88 *VbDR| "(h.Bdh4:@FLRX^l@dLfjp vh|dh0606d0606BBh*hTTdTZXffdll>lhfhrrdrhh00dhhhd hhh$*df0f6<BHBfrNTZ`flrfx~f*<`bfrfff"f$"f      ffflflffffffffff8 &  ,f 2 8f >` D Jd P" Vf \ 8f b 8 h 8 n t z L<`J  v d d   "   d8> d   f   df!! !66d!<!!"!(!.!!4!:BHBHdBHfLN!@T!Fx!L!Rf!X``dd!^!d!j!p!v!|!f!f!f!!!!!f!!f!f!!!`f!f!!!"6>"<8"Bf"Hf"Hf"H"N"T"Z8"`8"` D D D8"*f$"f"l*"r"xf"~"""""" Df""f""f"f"8"8"<< D""""""""""""""BH#8#8###8# 8#&#,#28#8`(`#> &  &f#Dp#J#P#V#\#b#h#n#t8#z!##" B8"*##8"B##<#"f#Dp#J#####"##"#########$$ #$#"$#$$"$($.$4$:$@$F$@ D8$L"f$R*f$X8$^f$d8$j8$j8$p8$v8$| 8$8$8$8$8$f$!$<$$$$$$f$8$"r$$$8$j8"B8"B*8$8$$$ z%8"8%8% #%<%%"r%$8%*8"8%08%08%68%<%B%H%N%T%T%Z%`%f%lBH%r%x%~%%%"%0%%#8%8%*8%8% D D% D D D D*6 D< D"%%N DZ D` D D0%" D D%% Df$ D D D D""% D8%(8>8>8>8>8>==??AACDFFHHJJLLNN QQ SS VV   =J T a)Xs&  - 7 ; ;H%'("*_$aiZkc__  ""(*03YIijpty{$',/0558?AHKKNPTTX`ccemrrzz    %5NO j3333N33v3333 3Z333%3933QQ 33)33333333C33M333333~333333@33 33333*3S333333l343fGf33E3Q33s33n3LnonoL n Lnn&n*nnn5nn"nnn3 nnBn,nnknbnn(n33333&&3%nLo%oo 3o66o 3uu:uo3!GGL223/qqqq3LoL3nL'3Ru<<<&{{f8(33xoMLF3 'x>xOt=33377Yo#[[022232VF3Ix 3 >F8F3L q L3RJ3H_  7_OODQ33OOO3,O3**E *3  *  333_*uu 3 `Luou uu3-uQJurLu3{1{Nu2u35oB%uu3n8u33v}v3<}nnu\\L\Ru+nLKzulnDL|b[61/\nn\2x|OnL{s /<&3#33oo(L3 3Mo&*:oeMw{5"3f3B3pkb &L33E oD33ppLvNFe3cp 3  3_x*3^MMo3QM]]]Vy3%%iG3iGN><3w3t=kO3#_7kHT3T3N 3 3F_3;  L0+cNoM3W 5..k 33 S3B3Ed3L)oFT3 )LHpHLgcb!-Lb--;Lu3WW!3 FFUw`XX3i63si3\'i3i1t4[GA ]JG3V33PP3c Q` X#T`  - . 1 7"'/123:C5 3333333333 ~b~ &,28>DDJPV\bhnbtz     DDDDDDbbbbttt zDbA9:;>?BCDIJKNOP55QRUVWY  Z[\!"]56_88a^RpR\ >@p>4H\R\WD>DHf\ pfRf Hp>fg  & :     (H%'("*_$aiZkc__  ""(*03YIijpty{$',/0558?AHKKNPTTX`ccemrrzz    %5NO 3333N3O333w3ffflL H &,,28&>>8D8,,,&&&JJPV\bhJntzJPPJt,,&& 8WXZZnoqq :<=?@BD()FXH@pH Hp HRX ppzX^ " 9" CopX333p"   $*06$<BHNTZ`fB l$T$*********r$$$$x~xxxx`xxxxxxxxxHxxxxxxxT  Txxxxxxxxx ````    &* , &$xx & & & 2xx 8$ > D D$ 8 Jx P V \` b h n t$ z*$ 66 *B 66 **  $`$  &  & & &    &    & &$ & & &0 &66$ ~~~x      " 6 xxx ( ( .6xxxxx .x 4 t :x @ F L R X ^ d j Fx~ p x & v & & |x &xx  x & & &  & & & & & &` & `x *x 4x V   x   x x P P     $ $ * 0 x 6 <B$ B` . H  N T Z ` f l r x 6 ~ f x x  D D  ` t * ``$ `x 6   ~x `      & , 2 8 > D J P V \ b h n t z t & & & & & :H%'("*_$aiZkc__  ""(*03YIijpty{$',/0558?AHKKNPTTX`ccemrrzz    %5NO b:f@z&vDbfpl l pp6N^R*f68?DII{ D\\Z3 2 p2zCpfkU3vf ffHbp pppp\3p*ppIPl]bpzfbpf>p`pDf8p6f0ppTpp,pLYpf>3\4jpdwX:g#> dH#E pvXR*pp~pptpp       H KH%'("*_$aiZkc__  ""(*03YIijpty{$',/0558?AHKKNPTTX`ccemrrzz    %5NO j jV Vf==??AACDFFHHJJLLNN QQ SS VV    ` XmAA&  - ; H K RX^^d^jdpv|^^^^^^^d^^^^^^^       $*$*06<BH6NBTZTZ`fllllllllllllrrrrxx~~~~~rrrr^^~   "(.4:@F@FLRX^djdpvRX^|| ^R $*0*06<*0BHNTZ`Z`*0*0flBHBHrRrRx~>>==??AACCFFHHJJLLNNQQ SS  /57 =CE)FGHTeVWr%t  - 7 ; ;==??AACCFFHHJJLLNNQQ SS  /57 =CE)FGHTeVWr%t  - 7 ; ;j3333N3v333 3Z333%3933C33M3333~3333@3 33333*3S3333l343fGf33E3Q33s33j33333&33J3]33333333?33333'33l333363.333333^3q3 3:333k3373D333w313Q3 3n3(3u3,3>33333M^^3(33y333=3G3f3333I33j333j + "(+VV   !%GG'UU(XX)&&*VV   !%GG'UU(XX)&&*333333)33333333333333 33p333d333w33333333333 pcyrlgrekzlatn SRB 8   IPPHFROM XTRK     caltcaseccmpccmpdligdnomfracloclloclloclloclnumronumordn saltsaltsalt sinf(ss01.ss024ss03?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=?ACFHJLNQS     (6BEHJ  "%'*,.02468:<>@BDFJLNPRTW   '   aI !$&)+-/13579;=?ACEIKMOQSV  &    - . / 0 1 2 3 4 5 6 7aJ  "%'*,.02468:<>@BDFJLNPRTW   '   =?AFJLSHNQCaI !$&)+-/13579;=?ACEIKMOQSV  &    - . / 0 1 2 3 4 5 6 7 aI !$&)+-/13579;=?ACEIKMOQSV  &    - . / 0 1 2 3 4 5 6 7 paI !$&)+-/13579;=?ACEIKMOQSV  &    - . / 0 1 2 3 4 5 6 7 rpj"4FX:BJRZbjrz MHINHJOHKPHLRIHSIITIJUIKVILXJHYJIZJJ[JK\JL^KH_KI`KJaKKbKLdLHeLIfLJgLKhLLQIWJ]KcL:BJRZbjrz jHHkHIlHJmHKnHLoIHpIJqIKrILtJHuJIvJJwJKxJLzKH{KI|KJ}KK~KLLHLILJLKLLiHsJyKL:BJRZbjrz HHHIHJHKHLIHIIIJIKILJHJIJKJLKHKIKJKKKLLHLILJLKLLHIKL:BJRZbjrz HHHIHJHKHLIHIIIJIKILJHJIJJJKJLKHKIKJKLLHLILJLKLLHIJL:BJRZbjrz HHHIHJHKHLIHIIIJIKILJHJIJJJKJLKHKIKJKKKLLHLILJLKHIJKHL IIK 2 }~eehp \qtuvwxyz{|[[eehp8eehqt| <~ $(,28>DJPTZ`hptx   "(.26   !#)$*%+&,'-/37048159;-./gfsr  -.@IJLMQRSUVWqsvwx <:eq,?HKPTpru V -./V V  ./01QUv PTuZ*  "2  #$%&'345; -IL *:,HK D4nrvz~  $(,048<@ (6 !)*+,-789;  .@JMSSWWqsxx 4:,?HKPTpru  gseq freq>;#$}~ "$()-/qq1t|2;=H ) (<> - . 0;#$ jlilibgdiplus-6.0.4+dfsg/tests/testjpegcodec.c0000644000175000017500000014653513542672033021472 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #if !defined(USE_WINDOWS_GDIPLUS) #include #endif #include "testhelpers.h" static const char *file = "temp_asset.jpeg"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'j', 'p', 'e', 'g', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccess(buffer, pixelFormat, width, height, flags, propertyCount) \ { \ createFile (buffer, Ok); \ verifyBitmap (image, jpegRawFormat, pixelFormat, width, height, flags, propertyCount, TRUE); \ GdipDisposeImage (image); \ } static void test_valid () { BYTE grayscaleData[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x00, /* XDensity */ 0x00, 0x01, /* YDensity */ 0x00, 0x01, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x0B, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x11, 0x00, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x08, 0x01, 0x01, 0x00, 0x00, 0x3F, 0x00, 0x92, 0xBF, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE rgbData[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x00, /* XDensity */ 0x00, 0x01, /* YDensity */ 0x00, 0x01, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE ycbrData[] = { /* -- Header -- */ /* SOI */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x00, /* XDensity */ 0x00, 0x01, /* YDensity */ 0x00, 0x01, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Define Huffman Table -- */ /* DHT */ 0xFF, 0xC4, /* Data */ 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0xFE, 0xFE, 0x28, 0xA2, 0x8A, 0xFF, 0x00, 0xCF, 0xFC, 0xFF, 0x00, 0xCF, 0xFC, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE cmykData[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- Adobe APP14 -- */ /* APP0 */ 0xFF, 0xEE, /* Length */ 0x00, 0x0E, /* Identifier */ 0x41, 0x64, 0x6F, 0x62, 0x65, /* Version */ 0x00, 0x64, /* Flags0 */ 0x00, 0x00, /* Flags1 */ 0x00, 0x00, /* ColorTransform */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xC0, 0x00, 0x14, 0x08, 0x00, 0x01, 0x00, 0x01, 0x04, 0x43, 0x11, 0x00, 0x4D, 0x11, 0x00, 0x59, 0x11, 0x00, 0x4B, 0x11, 0x00, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0E, 0x04, 0x43, 0x00, 0x4D, 0x00, 0x59, 0x00, 0x4B, 0x00, 0x00, 0x3F, 0x00, 0xFE, 0xFE, 0x2B, 0xFC, 0xFF, 0x00, 0xEB, 0xFC, 0xFF, 0x00, 0xEB, 0xFC, 0xFF, 0x00, 0xEB, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE ycckData[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xEE, /* Length */ 0x00, 0x0E, /* Identifier */ 0x41, 0x64, 0x6F, 0x62, 0x65, /* Version */ 0x00, 0x64, /* Flags0 */ 0x00, 0x00, /* Flags1 */ 0x00, 0x00, /* ColorTransform */ 0x02, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xC0, 0x00, 0x14, 0x08, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0x04, 0x22, 0x00, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Define Huffman Table -- */ /* DHT */ 0xFF, 0xC4, /* Data */ 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0E, 0x04, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x04, 0x00, 0x00, 0x3F, 0x00, 0xFE, 0xFE, 0x28, 0xA2, 0x8A, 0xFF, 0x00, 0xCF, 0xFC, 0xFF, 0x00, 0xCF, 0xFC, 0xFF, 0x00, 0x3F, 0xFA, 0x28, 0xA2, 0xBF, /* -- End of Image -- */ 0xFF, 0xD9 }; // Libgdiplus converts CMYK images to RGB. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat epxectedCMYKFormat = PixelFormat32bppCMYK; #else PixelFormat epxectedCMYKFormat = PixelFormat32bppRGB; #endif createFileSuccess (grayscaleData, PixelFormat8bppIndexed, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 1); createFileSuccess (rgbData, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); createFileSuccess (ycbrData, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); createFileSuccess (cmykData, epxectedCMYKFormat, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 1); createFileSuccess (ycckData, epxectedCMYKFormat, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); } static void test_units () { BYTE dpiUnit[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x01, /* XDensity */ 0x00, 0x60, /* YDensity */ 0x00, 0x60, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE dpiUnitNoXDensity[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x01, /* XDensity */ 0x00, 0x00, /* YDensity */ 0x00, 0x60, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE dpiUnitNoYDensity[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x01, /* XDensity */ 0x00, 0x60, /* YDensity */ 0x00, 0x00, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE dpcUnit[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x02, /* XDensity */ 0x00, 0x60, /* YDensity */ 0x00, 0x60, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE dpcUnitNoXDensity[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x02, /* XDensity */ 0x00, 0x00, /* YDensity */ 0x00, 0x60, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE dpcUnitNoYDensity[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x02, /* XDensity */ 0x00, 0x60, /* YDensity */ 0x00, 0x00, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; BYTE unknownUnit[] = { /* -- Start of Image -- */ 0xFF, 0xD8, /* -- JFIF APP0 -- */ /* APP0 */ 0xFF, 0xE0, /* Length */ 0x00, 0x10, /* Identifier */ 0x4A, 0x46, 0x49, 0x46, 0x00, /* Version */ 0x01, 0x01, /* Units */ 0x03, /* XDensity */ 0x00, 0x60, /* YDensity */ 0x00, 0x60, /* XThumbnail */ 0x00, /* YThumbnail */ 0x00, /* -- Define Quantization Table -- */ /* DQT */ 0xFF, 0xDB, /* Data */ 0x00, 0x43, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xFF, 0xC4, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFF, 0xC4, 0x00, 0x1F, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xFF, 0xC4, 0x00, 0xB5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, /* EOI */ 0xF9, 0xFA, /* -- Scan -- */ /* SOS */ 0xFF, 0xDA, /* Compressed Data */ 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x6D, 0x14, 0x51, 0x48, 0xD0, /* -- End of Image -- */ 0xFF, 0xD9 }; createFileSuccess (dpiUnit, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasRealDPI | ImageFlagsReadOnly, 2); createFileSuccess (dpiUnitNoXDensity, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); createFileSuccess (dpiUnitNoYDensity, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); createFileSuccess (dpcUnit, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasRealDPI | ImageFlagsReadOnly, 2); createFileSuccess (dpcUnitNoXDensity, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); createFileSuccess (dpcUnitNoYDensity, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); createFileSuccess (unknownUnit, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2); } int main (int argc, char**argv) { STARTUP; test_valid (); test_units (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testclip.c0000644000175000017500000001640613542674535020500 0ustar directhexdirecthex#ifdef USE_WINDOWS_GDIPLUS #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #include #include #else #include #endif #include #include #include #include "testhelpers.h" #define C(func) assert (func == Ok) #ifdef USE_WINDOWS_GDIPLUS using namespace Gdiplus; using namespace DllExports; #endif static void test_gdip_clip() { GpBitmap *bitmap = 0; GpBitmap *other_bitmap = 0; GpGraphics *graphics; GpRegion *clip; GpPath *path; GpPath *other_path; static const int width = 100; static const int height = 100; BYTE *scan0 = (BYTE*) GdipAlloc (width * height * 4); BOOL is_infinite = 0; GpRectF rect; GpRect recti; BitmapData bm; BitmapData other_bm; memset (&bm, 0, sizeof (bm)); memset (&other_bm, 0, sizeof (other_bm)); rect.X = 0.; rect.Y = 0.; rect.Width = width; rect.Height = height; recti.X = 0; recti.Y = 0; recti.Width = width; recti.Height = height; // Create bitmap C (GdipCreateBitmapFromScan0 (width, height, width * 4, PixelFormat32bppARGB, scan0, &bitmap)); // Get graphics C (GdipGetImageGraphicsContext (bitmap, &graphics)); // Check the clipping region is infinite C (GdipCreateRegion(&clip)); C (GdipGetClip (graphics, clip)); C (GdipIsInfiniteRegion(clip, graphics, &is_infinite)); assert (is_infinite); // Create a path C (GdipCreatePath (FillModeAlternate, &path)); C (GdipAddPathEllipse (path, 0, 0, 3, 2)); C (GdipAddPathBezier (path, 30, 30, 70, 175, 210, 220, 20, 60)); C (GdipAddPathRectangle (path, 200, 200, 60, 60)); C (GdipAddPathArc (path, 0, 0, 150, 120, 30, 120)); C (GdipAddPathEllipse (path, 50, 50, 50, 100)); // Save the infinite clip C (GdipGetClip (graphics, clip)); // Set the path as the clipping region C (GdipSetClipPath (graphics, path, CombineModeReplace)); // Clear the clipped image (foreground) C (GdipGraphicsClear (graphics, 0x8000ff00)); // Reset the clip C (GdipResetClip(graphics)); // Clone the image for future use C (GdipCloneBitmapArea (0., 0., (float)width, (float)height, PixelFormat32bppARGB, bitmap, &other_bitmap)); // Set the path as the clipping region C (GdipSetClipPath (graphics, path, CombineModeExclude)); C (GdipGetClip (graphics, clip)); C (GdipIsInfiniteRegion (clip, graphics, &is_infinite)); assert (!is_infinite); // Clear the clipped image (background) C (GdipGraphicsClear (graphics, 0x80ff0000)); // Now onto the second image // Get the graphics C (GdipGetImageGraphicsContext (other_bitmap, &graphics)); // Get the infinite clip C (GdipGetClip (graphics, clip)); // Dup the path C (GdipClonePath (path, &other_path)); // Add the bounds to it C (GdipGetRegionBounds (clip, graphics, &rect)); C (GdipAddPathRectangles (other_path, &rect, 1)); // Reverse the path C (GdipReversePath (other_path)); // Clip using the reversed path C (GdipSetClipPath (graphics, other_path, CombineModeReplace)); // Clear the clipped image (background) C (GdipGraphicsClear (graphics, 0x80ff0000)); // Compare the two images C (GdipBitmapLockBits (bitmap, &recti, ImageLockModeRead, PixelFormat32bppARGB, &bm)); C (GdipBitmapLockBits (other_bitmap, &recti, ImageLockModeRead, PixelFormat32bppARGB, &other_bm)); assert (bm.Width == other_bm.Width); assert (bm.Height == other_bm.Height); { ARGB *p = (ARGB *) bm.Scan0; ARGB *other_p = (ARGB *) other_bm.Scan0; for (int i = 0; i < width * height; ++i) assert (*p++ == *other_p++); } C (GdipBitmapUnlockBits (bitmap, &bm)); C (GdipBitmapUnlockBits (other_bitmap, &other_bm)); C (GdipDeleteRegion (clip)); C (GdipDeleteGraphics (graphics)); C (GdipDisposeImage (bitmap)); GdipFree (scan0); } static void test_gdip_clip_transform() { GpBitmap *bitmap = 0; GpGraphics *graphics; GpRegion *clip; GpPath *path; GpRectF bounds; static const int width = 100; static const int height = 100; BYTE *scan0 = (BYTE*) GdipAlloc (width * height * 4); BOOL is_infinite = 0; C (GdipCreateBitmapFromScan0 (100, 100, 100 * 4, PixelFormat32bppARGB, scan0, &bitmap)); C (GdipGetImageGraphicsContext (bitmap, &graphics)); // Check the clipping region is infinite C (GdipCreateRegion(&clip)); C (GdipGetClip(graphics, clip)); C (GdipIsInfiniteRegion(clip, graphics, &is_infinite)); assert (is_infinite); // Transform the world C (GdipTranslateWorldTransform(graphics, 50.f, 0.f, MatrixOrderAppend)); // Test setting clip as rectangle C (GdipSetClipRect(graphics, 10, 10, 60, 60, CombineModeReplace)); C (GdipGetClipBounds(graphics, &bounds)); assert (bounds.X == 10); assert (bounds.Y == 10); assert (bounds.Width == 60); assert (bounds.Height == 60); // Test setting clip as path with rectangle C (GdipCreatePath(FillModeWinding, &path)); C (GdipAddPathRectangle(path, 10, 10, 60, 60)); C (GdipGetPathWorldBounds(path, &bounds, NULL, NULL)); assert (bounds.X == 10); assert (bounds.Y == 10); assert (bounds.Width == 60); assert (bounds.Height == 60); C (GdipSetClipPath(graphics, path, CombineModeReplace)); C (GdipGetClipBounds(graphics, &bounds)); assert (bounds.X == 10); assert (bounds.Y == 10); assert (bounds.Width == 60); assert (bounds.Height == 60); C (GdipDeleteRegion (clip)); C (GdipDeleteGraphics (graphics)); C (GdipDisposeImage (bitmap)); GdipFree (scan0); } static void test_gdip_clip_path () { GpBitmap *bitmap = 0; GpGraphics *graphics; C (GdipCreateBitmapFromScan0 (612, 792, 0, PixelFormat32bppARGB, NULL, &bitmap)); C (GdipBitmapSetResolution (bitmap, 72, 72)); C (GdipGetImageGraphicsContext (bitmap, &graphics)); C (GdipSetClipRect (graphics, 0, 0, 612, 792, CombineModeIntersect)); GpRectF rc = { 100, 100, 50, 50 }; GpPath *path; C (GdipCreatePath (FillModeAlternate, &path)); { C (GdipAddPathRectangle (path, rc.X, rc.Y, rc.Width, rc.Height)); // This rectangle should be overlapped by the black rectangle GpSolidFill *pathBrush; C (GdipCreateSolidFill (0xFF00FF00, &pathBrush)); C (GdipFillPath (graphics, pathBrush, path)); C (GdipDeleteBrush (pathBrush)); // Test clipping by GdipSetClipPath (issue #552) C (GdipSetClipPath (graphics, path, CombineModeIntersect)); // Also test clipping by GdipSetClipRegion (issue #547) GpRegion *rgn; C (GdipCreateRegionPath (path, &rgn)); C (GdipSetClipRegion (graphics, rgn, CombineModeIntersect)); C (GdipDeleteRegion (rgn)); } C (GdipDeletePath (path)); const ARGB expectedColor = 0xFF000000; GpSolidFill *brush; C (GdipCreateSolidFill (expectedColor, &brush)); C (GdipFillRectangleI (graphics, brush, rc.X, rc.Y, rc.Width, rc.Height)); C (GdipDeleteBrush (brush)); //CLSID png_clsid = { 0x557cf406, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; //WCHAR *filePath = createWchar ("test_gdip_clip_path.png"); //C (GdipSaveImageToFile (bitmap, filePath, &png_clsid, NULL)); GpPoint points[] = { { rc.X, rc.Y }, { rc.X + rc.Width / 2, rc.Y + rc.Height / 2 }, { rc.X + rc.Width - 1, rc.Y + rc.Height - 1 } }; for (int i = 0; i < sizeof (points) / sizeof (points[0]); i += 2) { GpPoint *pt = &points[i]; ARGB color; C (GdipBitmapGetPixel (bitmap, pt->X, pt->Y, &color)); assertEqualInt (color, expectedColor); } C (GdipDeleteGraphics (graphics)); C (GdipDisposeImage (bitmap)); } int main(int argc, char**argv) { STARTUP; test_gdip_clip(); test_gdip_clip_transform(); test_gdip_clip_path (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test-gsa.png0000644000175000017500000000045013233636545020726 0ustar directhexdirecthexPNG  IHDR7IDAT(S}б+qwr(]PW bJ&`Kf}ra8Q"@.5=} #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void test_createMatrix () { GpStatus status; GpMatrix *matrix; status = GdipCreateMatrix (&matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 0, 0, 1, 0, 0); // Negative tests. status = GdipCreateMatrix (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_createMatrix2 () { GpStatus status; GpMatrix *matrix; status = GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipDeleteMatrix (matrix); // Negative tests. status = GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, NULL); assertEqualInt (status, InvalidParameter); } static void test_createMatrix3 () { GpStatus status; GpMatrix *matrix; GpRectF rect = {5, 6, 8, 10}; GpRectF negativeRect = {-5, -6, -8, -10}; GpRectF zeroWidthRect = {1, 2, 0, 4}; GpRectF zeroHeightRect = {1, 2, 3, 0}; GpPointF points[3] = { {12, 14}, {-10, 20}, {8, 0} }; GpPointF rectPoints[3] = { {5, 6}, {13, 6}, {5, 16}, }; GpPointF zeroPoints[3] = { {0, 0}, {0, 0}, {0, 0} }; status = GdipCreateMatrix3 (&rect, points, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, -2.75f, 0.75f, -0.4f, -1.4f, 28.15f, 18.65f); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3 (&rect, rectPoints, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 0, 0, 1, 0, 0); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3 (&rect, zeroPoints, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 0, 0, 0, 0, 0, 0); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3 (&negativeRect, points, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 2.75f, -0.75f, 0.4f, 1.4f, 28.15f, 18.65f); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3 (&negativeRect, zeroPoints, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 0, 0, 0, 0, 0, 0); GdipDeleteMatrix (matrix); // Negative tests. matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3 (NULL, points, &matrix); assertEqualInt (status, InvalidParameter); assert (matrix == (GpMatrix *) 0xCC); matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3 (&rect, NULL, &matrix); assertEqualInt (status, InvalidParameter); assert (matrix == (GpMatrix *) 0xCC); status = GdipCreateMatrix3 (&rect, points, NULL); assertEqualInt (status, InvalidParameter); matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3 (&zeroWidthRect, points, &matrix); assertEqualInt (status, OutOfMemory); assert (!matrix); matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3 (&zeroHeightRect, points, &matrix); assertEqualInt (status, OutOfMemory); assert (!matrix); } static void test_createMatrix3I () { GpStatus status; GpMatrix *matrix; GpRect rect = {5, 6, 8, 10}; GpRect negativeRect = {-5, -6, -8, -10}; GpRect zeroWidthRect = {1, 2, 0, 4}; GpRect zeroHeightRect = {1, 2, 3, 0}; GpPoint points[3] = { {12, 14}, {-10, 20}, {8, 0} }; GpPoint rectPoints[3] = { {5, 6}, {13, 6}, {5, 16}, }; GpPoint zeroPoints[3] = { {0, 0}, {0, 0}, {0, 0} }; status = GdipCreateMatrix3I (&rect, points, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, -2.75f, 0.75f, -0.4f, -1.4f, 28.15f, 18.65f); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3I (&rect, rectPoints, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 0, 0, 1, 0, 0); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3I (&rect, zeroPoints, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 0, 0, 0, 0, 0, 0); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3I (&negativeRect, points, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 2.75f, -0.75f, 0.4f, 1.4f, 28.15f, 18.65f); GdipDeleteMatrix (matrix); status = GdipCreateMatrix3I (&negativeRect, zeroPoints, &matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 0, 0, 0, 0, 0, 0); GdipDeleteMatrix (matrix); // Negative tests. matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3I (NULL, points, &matrix); assertEqualInt (status, InvalidParameter); assert (matrix == (GpMatrix *) 0xCC); matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3I (&rect, NULL, &matrix); assertEqualInt (status, InvalidParameter); assert (matrix == (GpMatrix *) 0xCC); status = GdipCreateMatrix3I (&rect, points, NULL); assertEqualInt (status, InvalidParameter); matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3I (&zeroWidthRect, points, &matrix); assertEqualInt (status, OutOfMemory); assert (!matrix); matrix = (GpMatrix *) 0xCC; status = GdipCreateMatrix3I (&zeroHeightRect, points, &matrix); assertEqualInt (status, OutOfMemory); assert (!matrix); } static void test_cloneMatrix () { GpStatus status; GpMatrix *matrix; GpMatrix *clonedMatrix; GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); status = GdipCloneMatrix (matrix, &clonedMatrix); assertEqualInt (status, Ok); assert (clonedMatrix && clonedMatrix != matrix); verifyMatrix (clonedMatrix, 1, 2, 3, 4, 5, 6); GdipDeleteMatrix (clonedMatrix); // Negative tests. clonedMatrix = (GpMatrix *) 0xCC; status = GdipCloneMatrix (NULL, &clonedMatrix); assertEqualInt (status, InvalidParameter); assert (clonedMatrix == (GpMatrix *) 0xCC); status = GdipCloneMatrix (matrix, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_deleteMatrix () { GpStatus status; GpMatrix *matrix; GdipCreateMatrix (&matrix); status = GdipDeleteMatrix (matrix); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteMatrix (NULL); assertEqualInt (status, InvalidParameter); } static void test_setMatrixElements () { GpStatus status; GpMatrix *matrix; GdipCreateMatrix (&matrix); status = GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); // Negative tests. status = GdipSetMatrixElements (NULL, 1, 2, 3, 4, 5, 6); assertEqualInt (status, InvalidParameter); } static void test_multiplyMatrix () { GpStatus status; GpMatrix *originalTransform; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GdipCreateMatrix (&originalTransform); GdipCreateMatrix2 (2, 3, 4, 5, 6, 7, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); // MatrixOrderAppend. GdipSetMatrixElements (originalTransform, 1, 2, 3, 4, 5, 6); status = GdipMultiplyMatrix (originalTransform, matrix, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (originalTransform, 10, 13, 22, 29, 40, 52); // MatrixOrderPrepend. GdipSetMatrixElements (originalTransform, 1, 2, 3, 4, 5, 6); status = GdipMultiplyMatrix (originalTransform, matrix, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (originalTransform, 11, 16, 19, 28, 32, 46); // Non invertible matrix. GdipSetMatrixElements (originalTransform, 1, 2, 3, 4, 5, 6); status = GdipMultiplyMatrix (originalTransform, nonInvertibleMatrix, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (originalTransform, 287, 56, 697, 136, 1154, 246); // Negative tests. status = GdipMultiplyMatrix (NULL, matrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipMultiplyMatrix (originalTransform, NULL, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipMultiplyMatrix (originalTransform, originalTransform, MatrixOrderAppend); assertEqualInt (status, ObjectBusy); status = GdipMultiplyMatrix (originalTransform, originalTransform, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, ObjectBusy); status = GdipMultiplyMatrix (originalTransform, originalTransform, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, ObjectBusy); status = GdipMultiplyMatrix (originalTransform, NULL, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipMultiplyMatrix (originalTransform, NULL, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); } static void test_translateMatrix () { GpStatus status; GpMatrix *matrix; GdipCreateMatrix (&matrix); // MatrixOrderAppend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipTranslateMatrix (matrix, 5, 6, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 10, 12); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipTranslateMatrix (matrix, 0, 0, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipTranslateMatrix (matrix, -5, -6, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 0, 0); // MatrixOrderPrepend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipTranslateMatrix (matrix, 5, 6, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 28, 40); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipTranslateMatrix (matrix, 0, 0, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipTranslateMatrix (matrix, -5, -6, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, -18, -28); // Negative tests. status = GdipTranslateMatrix (NULL, 1, 2, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipTranslateMatrix (matrix, 1, 2, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipTranslateMatrix (matrix, 1, 2, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_scaleMatrix () { GpStatus status; GpMatrix *matrix; GdipCreateMatrix (&matrix); // MatrixOrderAppend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, 0.5, 0.75, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 0.5, 1.5, 1.5, 3, 2.5, 4.5); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, 1, 1, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, 0, 0, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 0, 0, 0, 0, 0, 0); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, -1, -1, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, -1, -2, -3, -4, -5, -6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, -0.5, -0.75, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, -0.5, -1.5, -1.5, -3, -2.5, -4.5); // MatrixOrderPrepend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, 0.5, 0.75, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 0.5, 1, 2.25, 3, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, 1, 1, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, 0, 0, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 0, 0, 0, 0, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, -1, -1, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, -1, -2, -3, -4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, -0.5, -0.75, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, -0.5, -1, -2.25, -3, 5, 6); // Negative value. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipScaleMatrix (matrix, -0.5, -0.75, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, -0.5, -1.5, -1.5, -3, -2.5, -4.5); // Negative tests. status = GdipScaleMatrix (NULL, 1, 2, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipScaleMatrix (matrix, 1, 2, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipScaleMatrix (matrix, 1, 2, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_rotateMatrix () { GpStatus status; GpMatrix *matrix; GdipCreateMatrix (&matrix); // MatrixOrderAppend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 630, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, -3, -4, 1, 2, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 360, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 90, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, -2, 1, -4, 3, -6, 5); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 0, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, -90, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 2, -1, 4, -3, 6, -5); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, -360, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, -630, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 3, 4, -1, -2, 5, 6); // MatrixOrderPrepend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 630, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, -3, -4, 1, 2, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 360, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, 90, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 3, 4, -1, -2, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, -90, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, -3, -4, 1, 2, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, -360, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipRotateMatrix (matrix, -630, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 3, 4, -1, -2, 5, 6); // Negative tests. status = GdipRotateMatrix (NULL, 45, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipRotateMatrix (matrix, 45, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipRotateMatrix (matrix, 45, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_shearMatrix () { GpStatus status; GpMatrix *matrix; GdipCreateMatrix (&matrix); // MatrixOrderAppend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipShearMatrix (matrix, 1, 2, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 3, 4, 7, 10, 11, 16); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipShearMatrix (matrix, 0, 0, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipShearMatrix (matrix, -1, -2, MatrixOrderAppend); assertEqualInt (status, Ok); verifyMatrix (matrix, -1, 0, -1, -2, -1, -4); // MatrixOrderPrepend. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipShearMatrix (matrix, 1, 2, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 7, 10, 4, 6, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipShearMatrix (matrix, 0, 0, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipShearMatrix (matrix, -1, -2, MatrixOrderPrepend); assertEqualInt (status, Ok); verifyMatrix (matrix, -5, -6, 2, 2, 5, 6); // Negative tests. status = GdipShearMatrix (NULL, 1, 2, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipShearMatrix (matrix, 1, 2, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipShearMatrix (matrix, 1, 2, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_invertMatrix () { GpStatus status; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GdipCreateMatrix (&matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); // Identity matrix. GdipSetMatrixElements (matrix, 1, 0, 0, 1, 0, 0); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 0, 0, 1, 0, 0); // Translate only matrix. GdipSetMatrixElements (matrix, 1, 0, 0, 1, 2, 3); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 0, 0, 1, -2, -3); // Scale only matrix. GdipSetMatrixElements (matrix, 2, 0, 0, 4, 0, 0); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 0.5f, 0, 0, 0.25f, 0, 0); // Shear only matrix. GdipSetMatrixElements (matrix, 1, 2, 3, 1, 0, 0); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, -0.2f, 0.4f, 0.6f, -0.2f, 0, 0); // Translate and scale only matrix. GdipSetMatrixElements (matrix, 2, 0, 0, 4, 2, 3); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 0.5f, 0, 0, 0.25f, -1, -0.75f); // Translate and shear only matrix. GdipSetMatrixElements (matrix, 1, 2, 3, 1, 2, 3); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, -0.2f, 0.4f, 0.6f, -0.2f, -1.4f, -0.2f); // Scale and shear only matrix. GdipSetMatrixElements (matrix, 2, 2, 3, 4, 0, 0); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 2, -1, -1.5, 1, 0, 0); // Complex matrix. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, -2, 1, 1.5f, -0.5f, 1, -2); status = GdipInvertMatrix (matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); // Negative tests. status = GdipInvertMatrix (NULL); assertEqualInt (status, InvalidParameter); status = GdipInvertMatrix (nonInvertibleMatrix); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); } static void test_transformMatrixPoints () { GpStatus status; GpMatrix *matrix; GpPointF points[3]; // Identity matrix. GdipCreateMatrix2 (1, 0, 0, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 1); assertEqualFloat (points[0].Y, 2); assertEqualFloat (points[1].X, 3); assertEqualFloat (points[1].Y, 4); assertEqualFloat (points[2].X, 5); assertEqualFloat (points[2].Y, 6); // Translate only matrix. GdipCreateMatrix2 (1, 0, 0, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 3); assertEqualFloat (points[0].Y, 5); assertEqualFloat (points[1].X, 5); assertEqualFloat (points[1].Y, 7); assertEqualFloat (points[2].X, 7); assertEqualFloat (points[2].Y, 9); // Scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 2); assertEqualFloat (points[0].Y, 8); assertEqualFloat (points[1].X, 6); assertEqualFloat (points[1].Y, 16); assertEqualFloat (points[2].X, 10); assertEqualFloat (points[2].Y, 24); // Shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 7); assertEqualFloat (points[0].Y, 4); assertEqualFloat (points[1].X, 15); assertEqualFloat (points[1].Y, 10); assertEqualFloat (points[2].X, 23); assertEqualFloat (points[2].Y, 16); // Translate and scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 4); assertEqualFloat (points[0].Y, 11); assertEqualFloat (points[1].X, 8); assertEqualFloat (points[1].Y, 19); assertEqualFloat (points[2].X, 12); assertEqualFloat (points[2].Y, 27); // Translate and shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 9); assertEqualFloat (points[0].Y, 7); assertEqualFloat (points[1].X, 17); assertEqualFloat (points[1].Y, 13); assertEqualFloat (points[2].X, 25); assertEqualFloat (points[2].Y, 19); // Scale and shear only matrix. GdipCreateMatrix2 (2, 2, 3, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 8); assertEqualFloat (points[0].Y, 10); assertEqualFloat (points[1].X, 18); assertEqualFloat (points[1].Y, 22); assertEqualFloat (points[2].X, 28); assertEqualFloat (points[2].Y, 34); // Complex matrix. GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 12); assertEqualFloat (points[0].Y, 16); assertEqualFloat (points[1].X, 20); assertEqualFloat (points[1].Y, 28); assertEqualFloat (points[2].X, 28); assertEqualFloat (points[2].Y, 40); // Rounding. GdipCreateMatrix2 (1.5, 0, 0, 1.5, 0, 0, &matrix); points[0].X = 1; points[0].Y = 3; status = GdipTransformMatrixPoints (matrix, points, 1); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 1.5); assertEqualFloat (points[0].Y, 4.5); // Negative tests. status = GdipTransformMatrixPoints (NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (NULL, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (matrix, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (matrix, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (matrix, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (matrix, points, 0); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPoints (matrix, points, -1); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_transformMatrixPointsI () { GpStatus status; GpMatrix *matrix; GpPoint points[3]; // Identity matrix. GdipCreateMatrix2 (1, 0, 0, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 1); assertEqualInt (points[0].Y, 2); assertEqualInt (points[1].X, 3); assertEqualInt (points[1].Y, 4); assertEqualInt (points[2].X, 5); assertEqualInt (points[2].Y, 6); // Translate only matrix. GdipCreateMatrix2 (1, 0, 0, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 3); assertEqualInt (points[0].Y, 5); assertEqualInt (points[1].X, 5); assertEqualInt (points[1].Y, 7); assertEqualInt (points[2].X, 7); assertEqualInt (points[2].Y, 9); // Scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 2); assertEqualInt (points[0].Y, 8); assertEqualInt (points[1].X, 6); assertEqualInt (points[1].Y, 16); assertEqualInt (points[2].X, 10); assertEqualInt (points[2].Y, 24); // Shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 7); assertEqualInt (points[0].Y, 4); assertEqualInt (points[1].X, 15); assertEqualInt (points[1].Y, 10); assertEqualInt (points[2].X, 23); assertEqualInt (points[2].Y, 16); // Translate and scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 4); assertEqualInt (points[0].Y, 11); assertEqualInt (points[1].X, 8); assertEqualInt (points[1].Y, 19); assertEqualInt (points[2].X, 12); assertEqualInt (points[2].Y, 27); // Translate and shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 9); assertEqualInt (points[0].Y, 7); assertEqualInt (points[1].X, 17); assertEqualInt (points[1].Y, 13); assertEqualInt (points[2].X, 25); assertEqualInt (points[2].Y, 19); // Scale and shear only matrix. GdipCreateMatrix2 (2, 2, 3, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 8); assertEqualInt (points[0].Y, 10); assertEqualInt (points[1].X, 18); assertEqualInt (points[1].Y, 22); assertEqualInt (points[2].X, 28); assertEqualInt (points[2].Y, 34); // Complex matrix. GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 12); assertEqualInt (points[0].Y, 16); assertEqualInt (points[1].X, 20); assertEqualInt (points[1].Y, 28); assertEqualInt (points[2].X, 28); assertEqualInt (points[2].Y, 40); // Rounding. GdipCreateMatrix2 (1.5, 0, 0, 1.5, 0, 0, &matrix); points[0].X = 1; points[0].Y = 3; status = GdipTransformMatrixPointsI (matrix, points, 1); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 2); assertEqualInt (points[0].Y, 5); // Negative tests. status = GdipTransformMatrixPointsI (NULL, points, 3); assertEqualInt (status, InvalidParameter); // This causes a null pointer dereference in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipTransformMatrixPointsI (NULL, NULL, 3); assertEqualInt (status, InvalidParameter); #endif status = GdipTransformMatrixPointsI (NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPointsI (NULL, points, -1); assertEqualInt (status, OutOfMemory); #if !defined(USE_WINDOWS_GDIPLUS) status = GdipTransformMatrixPointsI (matrix, NULL, 3); assertEqualInt (status, InvalidParameter); #endif status = GdipTransformMatrixPointsI (matrix, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPointsI (matrix, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipTransformMatrixPointsI (matrix, points, 0); assertEqualInt (status, InvalidParameter); status = GdipTransformMatrixPointsI (matrix, points, -1); assertEqualInt (status, OutOfMemory); GdipDeleteMatrix (matrix); } static void test_vectorTransformMatrixPoints () { GpStatus status; GpMatrix *matrix; GpPointF points[3]; // Identity matrix. GdipCreateMatrix2 (1, 0, 0, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 1); assertEqualFloat (points[0].Y, 2); assertEqualFloat (points[1].X, 3); assertEqualFloat (points[1].Y, 4); assertEqualFloat (points[2].X, 5); assertEqualFloat (points[2].Y, 6); // Translate only matrix. GdipCreateMatrix2 (1, 0, 0, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 1); assertEqualFloat (points[0].Y, 2); assertEqualFloat (points[1].X, 3); assertEqualFloat (points[1].Y, 4); assertEqualFloat (points[2].X, 5); assertEqualFloat (points[2].Y, 6); // Scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 2); assertEqualFloat (points[0].Y, 8); assertEqualFloat (points[1].X, 6); assertEqualFloat (points[1].Y, 16); assertEqualFloat (points[2].X, 10); assertEqualFloat (points[2].Y, 24); // Shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 7); assertEqualFloat (points[0].Y, 4); assertEqualFloat (points[1].X, 15); assertEqualFloat (points[1].Y, 10); assertEqualFloat (points[2].X, 23); assertEqualFloat (points[2].Y, 16); // Translate and scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 2); assertEqualFloat (points[0].Y, 8); assertEqualFloat (points[1].X, 6); assertEqualFloat (points[1].Y, 16); assertEqualFloat (points[2].X, 10); assertEqualFloat (points[2].Y, 24); // Translate and shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 7); assertEqualFloat (points[0].Y, 4); assertEqualFloat (points[1].X, 15); assertEqualFloat (points[1].Y, 10); assertEqualFloat (points[2].X, 23); assertEqualFloat (points[2].Y, 16); // Scale and shear only matrix. GdipCreateMatrix2 (2, 2, 3, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 8); assertEqualFloat (points[0].Y, 10); assertEqualFloat (points[1].X, 18); assertEqualFloat (points[1].Y, 22); assertEqualFloat (points[2].X, 28); assertEqualFloat (points[2].Y, 34); // Complex matrix. GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPoints (matrix, points, 3); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 7); assertEqualFloat (points[0].Y, 10); assertEqualFloat (points[1].X, 15); assertEqualFloat (points[1].Y, 22); assertEqualFloat (points[2].X, 23); assertEqualFloat (points[2].Y, 34); // Rounding. GdipCreateMatrix2 (1.5, 0, 0, 1.5, 0, 0, &matrix); points[0].X = 1; points[0].Y = 3; status = GdipVectorTransformMatrixPoints (matrix, points, 1); assertEqualInt (status, Ok); assertEqualFloat (points[0].X, 1.5); assertEqualFloat (points[0].Y, 4.5); // Negative tests. status = GdipVectorTransformMatrixPoints (NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (NULL, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (matrix, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (matrix, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (matrix, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (matrix, points, 0); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPoints (matrix, points, -1); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_vectorTransformMatrixPointsI () { GpStatus status; GpMatrix *matrix; GpPoint points[3]; // Identity matrix. GdipCreateMatrix2 (1, 0, 0, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 1); assertEqualInt (points[0].Y, 2); assertEqualInt (points[1].X, 3); assertEqualInt (points[1].Y, 4); assertEqualInt (points[2].X, 5); assertEqualInt (points[2].Y, 6); // Translate only matrix. GdipCreateMatrix2 (1, 0, 0, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 1); assertEqualInt (points[0].Y, 2); assertEqualInt (points[1].X, 3); assertEqualInt (points[1].Y, 4); assertEqualInt (points[2].X, 5); assertEqualInt (points[2].Y, 6); // Scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 2); assertEqualInt (points[0].Y, 8); assertEqualInt (points[1].X, 6); assertEqualInt (points[1].Y, 16); assertEqualInt (points[2].X, 10); assertEqualInt (points[2].Y, 24); // Shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 7); assertEqualInt (points[0].Y, 4); assertEqualInt (points[1].X, 15); assertEqualInt (points[1].Y, 10); assertEqualInt (points[2].X, 23); assertEqualInt (points[2].Y, 16); // Translate and scale only matrix. GdipCreateMatrix2 (2, 0, 0, 4, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 2); assertEqualInt (points[0].Y, 8); assertEqualInt (points[1].X, 6); assertEqualInt (points[1].Y, 16); assertEqualInt (points[2].X, 10); assertEqualInt (points[2].Y, 24); // Translate and shear only matrix. GdipCreateMatrix2 (1, 2, 3, 1, 2, 3, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 7); assertEqualInt (points[0].Y, 4); assertEqualInt (points[1].X, 15); assertEqualInt (points[1].Y, 10); assertEqualInt (points[2].X, 23); assertEqualInt (points[2].Y, 16); // Scale and shear only matrix. GdipCreateMatrix2 (2, 2, 3, 4, 0, 0, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 8); assertEqualInt (points[0].Y, 10); assertEqualInt (points[1].X, 18); assertEqualInt (points[1].Y, 22); assertEqualInt (points[2].X, 28); assertEqualInt (points[2].Y, 34); // Complex matrix. GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); points[0].X = 1; points[0].Y = 2; points[1].X = 3; points[1].Y = 4; points[2].X = 5; points[2].Y = 6; status = GdipVectorTransformMatrixPointsI (matrix, points, 3); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 7); assertEqualInt (points[0].Y, 10); assertEqualInt (points[1].X, 15); assertEqualInt (points[1].Y, 22); assertEqualInt (points[2].X, 23); assertEqualInt (points[2].Y, 34); // Rounding. GdipCreateMatrix2 (1.5, 0, 0, 1.5, 0, 0, &matrix); points[0].X = 1; points[0].Y = 3; status = GdipVectorTransformMatrixPointsI (matrix, points, 1); assertEqualInt (status, Ok); assertEqualInt (points[0].X, 2); assertEqualInt (points[0].Y, 5); // Negative tests. status = GdipVectorTransformMatrixPointsI (NULL, points, 3); assertEqualInt (status, InvalidParameter); // This causes a null pointer dereference in GDI+. status = GdipVectorTransformMatrixPointsI (NULL, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (matrix, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (matrix, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (matrix, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (matrix, points, 0); assertEqualInt (status, InvalidParameter); status = GdipVectorTransformMatrixPointsI (matrix, points, -1); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_getMatrixElements () { GpStatus status; GpMatrix *matrix; REAL elements[6]; GdipCreateMatrix (&matrix); // Negative tests. status = GdipGetMatrixElements (NULL, elements); assertEqualInt (status, InvalidParameter); status = GdipGetMatrixElements (matrix, NULL); assertEqualInt (status, InvalidParameter); } static void test_isMatrixInvertible () { GpStatus status; GpMatrix *matrix; BOOL isInvertible; GdipCreateMatrix (&matrix); // Identity matrix. GdipSetMatrixElements (matrix, 1, 0, 0, 1, 0, 0); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Translate only. GdipSetMatrixElements (matrix, 1, 0, 0, 1, 2, 3); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Scale only. GdipSetMatrixElements (matrix, 2, 0, 0, 4, 0, 0); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Shear only. GdipSetMatrixElements (matrix, 1, 2, 3, 1, 0, 0); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Translate and scale only. GdipSetMatrixElements (matrix, 2, 0, 0, 4, 2, 3); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Translate and shear only. GdipSetMatrixElements (matrix, 1, 2, 3, 1, 2, 3); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Scale and shear only. GdipSetMatrixElements (matrix, 2, 2, 3, 4, 0, 0); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Complex matrix. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == TRUE); // Not invertible. GdipSetMatrixElements (matrix, 123, 24, 82, 16, 47, 30); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == FALSE); // Empty. GdipSetMatrixElements (matrix, 0, 0, 0, 0, 0, 0); status = GdipIsMatrixInvertible (matrix, &isInvertible); assertEqualInt (status, Ok); assert (isInvertible == FALSE); // Negative tests. status = GdipIsMatrixInvertible (NULL, &isInvertible); assertEqualInt (status, InvalidParameter); status = GdipIsMatrixInvertible (matrix, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_isMatrixIdentity () { GpStatus status; GpMatrix *matrix; BOOL isIdentity; GdipCreateMatrix (&matrix); // Exactly identity. GdipSetMatrixElements (matrix, 1, 0, 0, 1, 0, 0); status = GdipIsMatrixIdentity (matrix, &isIdentity); assertEqualInt (status, Ok); assert (isIdentity == TRUE); // Close to identity. GdipSetMatrixElements (matrix, 0.9999f, -0.0001f, 0.0001f, 1.0001f, 0, 0); status = GdipIsMatrixIdentity (matrix, &isIdentity); assertEqualInt (status, Ok); assert (isIdentity == TRUE); // Less close to identity. GdipSetMatrixElements (matrix, 0.9998f, -0.0001f, 0.0001f, 1.0001f, 0, 0); status = GdipIsMatrixIdentity (matrix, &isIdentity); assertEqualInt (status, Ok); assert (isIdentity == TRUE); // Not identity. GdipSetMatrixElements (matrix, 1, 2, 3, 4, 5, 6); status = GdipIsMatrixIdentity (matrix, &isIdentity); assertEqualInt (status, Ok); assert (isIdentity == FALSE); // Negative tests. status = GdipIsMatrixIdentity (NULL, &isIdentity); assertEqualInt (status, InvalidParameter); status = GdipIsMatrixIdentity (matrix, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); } static void test_isMatrixEqual () { GpStatus status; GpMatrix *matrix; GpMatrix *other; BOOL isEqual; GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &other); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == TRUE); status = GdipIsMatrixEqual (matrix, matrix, &isEqual); assertEqualInt (status, Ok); assert (isEqual == TRUE); GdipSetMatrixElements (other, 2, 2, 3, 4, 5, 6); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == FALSE); GdipSetMatrixElements (other, 1, 3, 3, 4, 5, 6); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == FALSE); GdipSetMatrixElements (other, 1, 2, 4, 4, 5, 6); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == FALSE); GdipSetMatrixElements (other, 1, 2, 3, 5, 5, 6); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == FALSE); GdipSetMatrixElements (other, 1, 2, 3, 4, 6, 6); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == FALSE); GdipSetMatrixElements (other, 1, 2, 3, 4, 5, 7); status = GdipIsMatrixEqual (matrix, other, &isEqual); assertEqualInt (status, Ok); assert (isEqual == FALSE); // Negative tests. status = GdipIsMatrixEqual (NULL, other, &isEqual); assertEqualInt (status, InvalidParameter); status = GdipIsMatrixEqual (matrix, NULL, &isEqual); assertEqualInt (status, InvalidParameter); status = GdipIsMatrixEqual (matrix, other, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); GdipDeleteMatrix (other); } int main (int argc, char**argv) { STARTUP; test_createMatrix (); test_createMatrix2 (); test_createMatrix3 (); test_createMatrix3I (); test_cloneMatrix (); test_deleteMatrix (); test_setMatrixElements (); test_multiplyMatrix (); test_translateMatrix (); test_scaleMatrix (); test_rotateMatrix (); test_shearMatrix (); test_invertMatrix (); test_transformMatrixPoints (); test_transformMatrixPointsI (); test_vectorTransformMatrixPoints (); test_vectorTransformMatrixPointsI (); test_getMatrixElements (); test_isMatrixInvertible (); test_isMatrixIdentity (); test_isMatrixEqual (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.ico0000644000175000017500000024476613542672033020163 0ustar directhexdirecthex($&00 %N$( ʦkH%zbJs2PkHs%WUI=1%sPkkHH%%sPDZksHW%UI=1%sPԎkH%zbJs2PkH%ssPPkH%zbsJP2kHs%WUI=1s%PkkHH%%sPDZksHW%UI=1s%PԎkH%ܒzbsJP2kH%ssPPkH%zbJs2PksHW%UI=1%sPkkHH%%sPkHs%WUI=1s%PkH%ܒzbsJP2kH%ssPPzzznnnbbbVVVJJJ>>>222&&&??????????(0` %$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$%%##$$%%%%$$%%%%$$%%%%$$%%%%%%%%$$%%%%$$%%%%$$%%%%$$%%%%%%%%%%$$$$$$L%%t%%~$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%~%%{%%Z$$+%%%%%%$$ $$e%%$$%%%%##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%%% $$$$%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"%%$$$$a%%%%%%$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%%%%% $$%%$$$$%%$$%%$$$$%%$$$$%%$$$$%%$$$$%%$$$$$$$$%%$$$$%%$$$$%%$$$$%%$$$$%%$$%%%%%%C%%$$C$$$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$h%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$p%%%%%%$$$$%%$$$$%%$$$$%%$$$$%%$$$$%%$$$$$$$$%%$$$$%%$$$$%%$$$$%%$$$$%%$$%%%%%%$$%%%%$$p$$%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%%%$$q%%%%$$%%$$$$%%$$$$%%%%$$%%%%$$%%%%$$%%%%%%%%$$%%%%$$%%%%$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%%%$$q%%%%$$%%$$$$%%$$$$%%%%$$%%%%$$%%%%$$%%%%%%%%$$%%%%$$%%%%$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%%%$$q%%%%$$%%$$$$%%$$$$%%%%$$%%%%$$%%%%$$%%%%%%%%$$%%%%$$%%%%$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%%%$$q%%%%$$%%$$$$%%$$$$%%%%$$%%%%$$%%%%$$%%%%%%%%$$%%%%$$%%%%$$%%%%$$%%%%$$%%%%%%%%%%%%$$$$##q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$$$$$p$$$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$%%$$$$$$##q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$$$$$p$$$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$%%$$$$$$##q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$$$$$p$$$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$%%$$$$$$##q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%$$$$$$$$q%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$$$$$p$$$$%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$%%$$$$$$p$$%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$$$o%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$R$$$$$$%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%%%$$(%%$$$$%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$_%%$$$$$$$$$$$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%%%$$$$%%%%%%$$$$$$##%%%%##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$$$%%$$J%%$$$$*$$%%$$%%%%$$$$%%%%$$%%%%$$%%%%$$%%%%%%%%$$%%%%$$%%%%$$%%%%$$%%%%$$%%%%M%%$$$$%%V$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%%%%%p%% %%$$%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$$%%%%%%%%%%$$%%%%$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%??libgdiplus-6.0.4+dfsg/tests/testmetafile.c0000644000175000017500000005441713542673672021344 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static WCHAR wmfFilePath[] = {'t', 'e', 's', 't', '.', 'w', 'm', 'f', 0}; static WCHAR emfFilePath[] = {'t', 'e', 's', 't', '.', 'e', 'm', 'f', 0}; static void test_createMetafileFromFile () { GpStatus status; WCHAR *noSuchFilePath; WCHAR *invalidFilePath; WCHAR *bitmapFilePath; GpMetafile *metafile; noSuchFilePath = createWchar ("noSuchFile.wmf"); invalidFilePath = createWchar ("test.ttf"); bitmapFilePath = createWchar ("test.bmp"); // Create from WMF file. status = GdipCreateMetafileFromFile (wmfFilePath, &metafile); assertEqualInt (status, Ok); // FIXME: GDI+ converts wmf files to emf. #if defined(USE_WINDOWS_GDIPLUS) verifyImage(metafile, ImageTypeMetafile, emfRawFormat, PixelFormat32bppRGB, 0, 0, 2, 2, 0.017323f, 0.016807f, 0.458334f, 0.444445f, 327683, 0, TRUE); #endif GdipDisposeImage (metafile); // Create from EMF file. status = GdipCreateMetafileFromFile (emfFilePath, &metafile); assertEqualInt (status, Ok); verifyMetafile (metafile, emfRawFormat, 0, 0, 100, 100, 1944.444336f, 1888.888794f); GdipDisposeImage (metafile); // Negative tests. status = GdipCreateMetafileFromFile (NULL, &metafile); assertEqualInt (status, InvalidParameter); status = GdipCreateMetafileFromFile (noSuchFilePath, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateMetafileFromFile (noSuchFilePath, &metafile); assertEqualInt (status, GenericError); status = GdipCreateMetafileFromFile (invalidFilePath, &metafile); assertEqualInt (status, GenericError); status = GdipCreateMetafileFromFile (bitmapFilePath, &metafile); assertEqualInt (status, GenericError); } static void test_createMetafileFromStream () { GpStatus status; GpMetafile *metafile; #if !defined(USE_WINDOWS_GDIPLUS) int temp = 0; #endif // Negative tests. status = GdipCreateMetafileFromStream (NULL, &metafile); assertEqualInt (status, InvalidParameter); // Libgdiplus does not implement GdipCreateMetafileFromStream. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipCreateMetafileFromStream (&temp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateMetafileFromStream (&temp, &metafile); assertEqualInt (status, NotImplemented); #endif } static void test_createMetafileFromEmf () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; GpMetafile *metafile; HENHMETAFILE hWmfMetafile; HENHMETAFILE hEmfMetafile; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); #if defined(USE_WINDOWS_GDIPLUS) HDC wmfHdc = CreateMetaFileA (NULL); hWmfMetafile = (HENHMETAFILE) CloseMetaFile (wmfHdc); CopyMetaFileA ((HMETAFILE) hWmfMetafile, "test.wmf"); #else GdipGetHemfFromMetafile (wmfMetafile, &hWmfMetafile); #endif GdipGetHemfFromMetafile (emfMetafile, &hEmfMetafile); // Create from a WMF file. metafile = (GpMetafile *) 0xCC; status = GdipCreateMetafileFromEmf (hWmfMetafile, TRUE, &metafile); assertEqualInt (status, GenericError); assert (!metafile); metafile = (GpMetafile *) 0xCC; status = GdipCreateMetafileFromEmf (hWmfMetafile, FALSE, &metafile); assertEqualInt (status, GenericError); assert (!metafile); // Create from a EMF file. status = GdipCreateMetafileFromEmf (hEmfMetafile, FALSE, &metafile); assertEqualInt (status, Ok); verifyMetafile (metafile, emfRawFormat, 0, 0, 100, 100, 1944.444336f, 1888.888794f); GdipDisposeImage (metafile); status = GdipCreateMetafileFromEmf (hEmfMetafile, TRUE, &metafile); assertEqualInt (status, Ok); verifyMetafile (metafile, emfRawFormat, 0, 0, 100, 100, 1944.444336f, 1888.888794f); GdipDisposeImage (metafile); // Negative tests. status = GdipCreateMetafileFromEmf (NULL, TRUE, &metafile); assertEqualInt (status, InvalidParameter); status = GdipCreateMetafileFromEmf (hEmfMetafile, TRUE, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_createMetafileFromWmf () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; WmfPlaceableFileHeader wmfPlaceableFileHeader; GpMetafile *metafile; HMETAFILE hWmfMetafile; HMETAFILE hEmfMetafile; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); #if defined(USE_WINDOWS_GDIPLUS) HDC wmfHdc = CreateMetaFileA (NULL); hWmfMetafile = CloseMetaFile (wmfHdc); CopyMetaFileA (hWmfMetafile, "test.wmf"); #else GdipGetHemfFromMetafile (wmfMetafile, &hWmfMetafile); #endif GdipGetHemfFromMetafile (emfMetafile, (HENHMETAFILE *) &hEmfMetafile); // Create from WMF file - no placeable header. status = GdipCreateMetafileFromWmf (hWmfMetafile, FALSE, NULL, &metafile); assertEqualInt (status, Ok); // FIXME: GDI+ converts wmf files to emf. #if defined(USE_WINDOWS_GDIPLUS) verifyImage(metafile, ImageTypeMetafile, emfRawFormat, PixelFormat32bppRGB, 0, 0, 2, 2, 0.017323f, 0.016807f, 0.458334f, 0.444445f, 327683, 0, TRUE); #endif GdipDisposeImage (metafile); status = GdipCreateMetafileFromWmf (hWmfMetafile, TRUE, NULL, &metafile); assertEqualInt (status, Ok); // FIXME: GDI+ converts wmf files to emf. #if defined(USE_WINDOWS_GDIPLUS) verifyImage(metafile, ImageTypeMetafile, emfRawFormat, PixelFormat32bppRGB, 0, 0, 2, 2, 0.017323f, 0.016807f, 0.458334f, 0.444445f, 327683, 0, TRUE); #endif GdipDisposeImage (metafile); // Create from EMF file. metafile = (GpMetafile *) 0xCC; status = GdipCreateMetafileFromWmf (hEmfMetafile, TRUE, &wmfPlaceableFileHeader, &metafile); assertEqualInt (status, GenericError); assert (!metafile); metafile = (GpMetafile *) 0xCC; status = GdipCreateMetafileFromWmf (hEmfMetafile, FALSE, &wmfPlaceableFileHeader, &metafile); assertEqualInt (status, GenericError); assert (!metafile); // Negative tests. status = GdipCreateMetafileFromWmf (NULL, TRUE, &wmfPlaceableFileHeader, &metafile); assertEqualInt (status, InvalidParameter); status = GdipCreateMetafileFromWmf (hWmfMetafile, TRUE, &wmfPlaceableFileHeader, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_getMetafileHeaderFromWmf () { #if !defined(USE_WINDOWS_GDIPLUS) GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; WmfPlaceableFileHeader wmfPlaceableFileHeader; MetafileHeader header; HMETAFILE hWmfMetafile; HMETAFILE hEmfMetafile; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); #if defined(USE_WINDOWS_GDIPLUS) HDC wmfHdc = CreateMetaFileA (NULL); hWmfMetafile = CloseMetaFile (wmfHdc); CopyMetaFileA (hWmfMetafile, "test.wmf"); #else GdipGetHemfFromMetafile (wmfMetafile, &hWmfMetafile); #endif GdipGetHemfFromMetafile (emfMetafile, (HENHMETAFILE *) &hEmfMetafile); // Get from WMF file. status = GdipGetMetafileHeaderFromWmf (hWmfMetafile, &wmfPlaceableFileHeader, &header); assertEqualInt (status, Ok); assertEqualInt (header.Type, 2); assertEqualInt (header.Size, 68142); assertEqualInt (header.Version, 768); assertEqualInt (header.EmfPlusFlags, 0); // FIXME: these values constantly fluctuate with libgdiplus - potential UB? #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (header.DpiX, 0); assertEqualInt (header.DpiY, 0); assertEqualInt (header.X, 0); assertEqualInt (header.Y, 0); assertEqualInt (header.Width, 0); assertEqualInt (header.Height, 0); #endif // Get from EMF file. status = GdipGetMetafileHeaderFromWmf (hEmfMetafile, &wmfPlaceableFileHeader, &header); assertEqualInt (status, Ok); assertEqualInt (header.Type , 2); assertEqualInt (header.Size, 0); assertEqualInt (header.Version, 108); assertEqualInt (header.EmfPlusFlags, 0); // FIXME: these values constantly fluctuate with libgdiplus - potential UB? #if defined(USE_WINDOWS_GDIPLUS) assert (header.DpiX > 0); assert (header.DpiY > 0); assertEqualInt (header.X, 0); assertEqualInt (header.Y, 0); assertEqualInt (header.Width, 0); assertEqualInt (header.Height, 0); #endif // Negative tests. status = GdipGetMetafileHeaderFromWmf (NULL, &wmfPlaceableFileHeader, &header); assertEqualInt (status, InvalidParameter); status = GdipGetMetafileHeaderFromWmf (hWmfMetafile, NULL, &header); assertEqualInt (status, InvalidParameter); status = GdipGetMetafileHeaderFromWmf (hWmfMetafile, &wmfPlaceableFileHeader, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); #endif } static void test_getMetafileHeaderFromEmf () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; HENHMETAFILE hWmfMetafile; HENHMETAFILE hEmfMetafile; MetafileHeader header; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); #if defined(USE_WINDOWS_GDIPLUS) HDC wmfHdc = CreateMetaFileA (NULL); hWmfMetafile = (HENHMETAFILE) CloseMetaFile (wmfHdc); CopyMetaFileA ((HMETAFILE) hWmfMetafile, "test.wmf"); #else GdipGetHemfFromMetafile (wmfMetafile, &hWmfMetafile); #endif GdipGetHemfFromMetafile (emfMetafile, &hEmfMetafile); // Get from EMF file. status = GdipGetMetafileHeaderFromEmf (hEmfMetafile, &header); assertEqualInt (status, Ok); assertEqualInt (header.Type, 3); assertEqualInt (header.Size, 30284); assertEqualInt (header.Version, 65536); assertEqualInt (header.EmfPlusFlags, 0); assert (header.DpiX > 0); assert (header.DpiY > 0); assertEqualInt (header.X, 0); assertEqualInt (header.Y, 0); assertEqualInt (header.Width, 100); assertEqualInt (header.Height, 100); assertEqualInt (header.EmfPlusHeaderSize, 0); // Get from WMF file. status = GdipGetMetafileHeaderFromEmf (hWmfMetafile, &header); assertEqualInt (status, InvalidParameter); // Negative tests. status = GdipGetMetafileHeaderFromEmf (NULL, &header); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetMetafileHeaderFromEmf (hWmfMetafile, NULL); assertEqualInt (status, InvalidParameter); #endif GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_getMetafileHeaderFromFile () { GpStatus status; MetafileHeader header; // Get from WMF file. status = GdipGetMetafileHeaderFromFile (wmfFilePath, &header); assertEqualInt (status, Ok); // FIXME: GDI+ converts wmf files to emf. #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (header.Type, MetafileTypeEmf); assertEqualInt (header.Size, 256); assertEqualInt (header.Version, 65536); assertEqualInt (header.EmfPlusFlags, 0); assertEqualFloat (header.DpiX, 95.9999924); assertEqualFloat (header.DpiY, 96.0504150); assertEqualInt (header.X, -1); assertEqualInt (header.Y, -1); assertEqualInt (header.Width, 2); assertEqualInt (header.Height, 2); #endif // Get from EMF file. status = GdipGetMetafileHeaderFromFile (emfFilePath, &header); assertEqualInt (status, Ok); assertEqualInt (header.Type, MetafileTypeEmf); assertEqualInt (header.Size, 30284); assertEqualInt (header.Version, 65536); assertEqualInt (header.EmfPlusFlags, 0); assertEqualFloat (header.DpiX, 130.628555f); assertEqualFloat (header.DpiY, 134.470581f); assertEqualInt (header.X, 0); assertEqualInt (header.Y, 0); assertEqualInt (header.Width, 100); assertEqualInt (header.Height, 100); assertEqualInt (header.EmfPlusHeaderSize, 0); // Negative tests. status = GdipGetMetafileHeaderFromFile (NULL, &header); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetMetafileHeaderFromFile (wmfFilePath, NULL); assertEqualInt (status, InvalidParameter); #endif } static void test_getMetafileHeaderFromStream () { GpStatus status; MetafileHeader header; #if !defined(USE_WINDOWS_GDIPLUS) int temp = 0; #endif // Negative tests. status = GdipGetMetafileHeaderFromStream (NULL, &header); assertEqualInt (status, InvalidParameter); // Libgdiplus does not implement GdipGetMetafileHeaderFromStream. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetMetafileHeaderFromStream (&temp, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetMetafileHeaderFromStream (&temp, &header); assertEqualInt (status, NotImplemented); #endif } static void test_getMetafileHeaderFromMetafile () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; MetafileHeader header; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); // Get from WMF file. status = GdipGetMetafileHeaderFromMetafile (wmfMetafile, &header); assertEqualInt (status, Ok); // FIXME: GDI+ converts wmf files to emf. #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (header.Type, MetafileTypeEmf); assertEqualInt (header.Size, 256); assertEqualInt (header.Version, 65536); assertEqualInt (header.EmfPlusFlags, 0); assertEqualFloat (header.DpiX, 95.9999924); assertEqualFloat (header.DpiY, 96.0504150); assertEqualInt (header.X, -1); assertEqualInt (header.Y, -1); assertEqualInt (header.Width, 2); assertEqualInt (header.Height, 2); #endif // Get from EMF file. status = GdipGetMetafileHeaderFromMetafile (emfMetafile, &header); assertEqualInt (status, Ok); assertEqualInt (header.Type, MetafileTypeEmf); assertEqualInt (header.Size, 30284); assertEqualInt (header.Version, 65536); assertEqualInt (header.EmfPlusFlags, 0); assertEqualFloat (header.DpiX, 130.628555f); assertEqualFloat (header.DpiY, 134.470581f); assertEqualInt (header.X, 0); assertEqualInt (header.Y, 0); assertEqualInt (header.Width, 100); assertEqualInt (header.Height, 100); assertEqualInt (header.EmfPlusHeaderSize, 0); // Negative tests. status = GdipGetMetafileHeaderFromMetafile (NULL, &header); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetMetafileHeaderFromMetafile (emfMetafile, NULL); assertEqualInt (status, InvalidParameter); #endif GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_gettHemfFromMetafile () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; HENHMETAFILE hEmfMetafile; GpMetafile *metafileFromEmf; HENHMETAFILE hemf; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); GdipGetHemfFromMetafile (emfMetafile, &hEmfMetafile); GdipCreateMetafileFromEmf (hEmfMetafile, FALSE, &metafileFromEmf); // The definition of HENHMETAFILE is different between libgdiplus and GDI+. #if !defined(USE_WINDOWS_GDIPLUS) // Get from WMF file. status = GdipGetHemfFromMetafile (wmfMetafile, &hemf); assertEqualInt (status, Ok); assert (hemf == wmfMetafile); // Get from EMF file. status = GdipGetHemfFromMetafile (emfMetafile, &hemf); assertEqualInt (status, Ok); assert (hemf == emfMetafile); // Get from EMF file from EMF file. status = GdipGetHemfFromMetafile (metafileFromEmf, &hemf); assertEqualInt (status, Ok); assert (hemf == metafileFromEmf); status = GdipGetHemfFromMetafile (metafileFromEmf, &hemf); assertEqualInt (status, Ok); assert (hemf == metafileFromEmf); #endif // Negative tests. status = GdipGetHemfFromMetafile (NULL, &hemf); assertEqualInt (status, InvalidParameter); status = GdipGetHemfFromMetafile (NULL, &hemf); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); GdipDisposeImage (metafileFromEmf); } static void test_getMetafileDownLevelRasterizationLimit () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; UINT metafileRasterizationLimitDpi; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); // Get from EMF file. // FIXME: GDI+ returns WrongState. #if defined(USE_WINDOWS_GDIPLUS) status = GdipGetMetafileDownLevelRasterizationLimit (emfMetafile, &metafileRasterizationLimitDpi); assertEqualInt (status, WrongState); #endif // Get from WMF file. status = GdipGetMetafileDownLevelRasterizationLimit (wmfMetafile, &metafileRasterizationLimitDpi); assertEqualInt (status, WrongState); // Negative tests. status = GdipGetMetafileDownLevelRasterizationLimit (NULL, &metafileRasterizationLimitDpi); assertEqualInt (status, InvalidParameter); status = GdipGetMetafileDownLevelRasterizationLimit (emfMetafile, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_setMetafileDownLevelRasterizationLimit () { GpStatus status; GpMetafile *emfMetafile; GpMetafile *wmfMetafile; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); // Get from EMF file. // FIXME: GDI+ returns InvalidParameter/WrongState. #if defined(USE_WINDOWS_GDIPLUS) status = GdipSetMetafileDownLevelRasterizationLimit (emfMetafile, 5); assertEqualInt (status, InvalidParameter); # status = GdipSetMetafileDownLevelRasterizationLimit (emfMetafile, 15); assertEqualInt (status, WrongState); #endif // Get from WMF file. status = GdipSetMetafileDownLevelRasterizationLimit (wmfMetafile, 10); assertEqualInt (status, WrongState); // Negative tests. status = GdipSetMetafileDownLevelRasterizationLimit (NULL, 5); assertEqualInt (status, InvalidParameter); // FIXME: GDI+ returns WrongState. #if defined(USE_WINDOWS_GDIPLUS) status = GdipSetMetafileDownLevelRasterizationLimit (emfMetafile, -1); assertEqualInt (status, WrongState); #endif GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_playMetafileRecord () { GpStatus status; GpMetafile *emfMetafile; GpMetafile *wmfMetafile; BYTE data[] = {1}; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); // Negative tests. status = GdipPlayMetafileRecord (NULL, EmfPlusRecordTypeClear, 0, 1, data); assertEqualInt (status, InvalidParameter); status = GdipPlayMetafileRecord (emfMetafile, EmfPlusRecordTypeClear, 0, 1, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); } static void test_recordMetafile () { GpStatus status; GpMetafile *wmfMetafile; GpMetafile *emfMetafile; GpImage *bitmap; GpGraphics *graphics; HDC hdc; GpRectF rect = {5, 10, 30, 40}; GpRectF zeroWidth = {0, 0, 0, 100}; GpRectF zeroHeight = {0, 0, 100, 0}; GpMetafile *metafile; GdipCreateMetafileFromFile (wmfFilePath, &wmfMetafile); GdipCreateMetafileFromFile (emfFilePath, &emfMetafile); GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat32bppRGB, NULL, (GpBitmap **) &bitmap); GdipGetImageGraphicsContext (bitmap, &graphics); GdipGetDC (graphics, &hdc); // FIXME: this returns Ok with GDI+. #if defined(USE_WINDOWS_GDIPLUS) status = GdipRecordMetafile (hdc, EmfTypeEmfPlusDual, NULL, MetafileFrameUnitPixel, wmfFilePath, &metafile); assertEqualInt (status, Ok); #endif // Negative tests. status = GdipRecordMetafile (NULL, EmfTypeEmfPlusDual, &rect, MetafileFrameUnitPixel, wmfFilePath, &metafile); assertEqualInt (status, InvalidParameter); status = GdipRecordMetafile (hdc, (EmfType)(EmfTypeEmfOnly - 1), &rect, MetafileFrameUnitPixel, wmfFilePath, &metafile); assertEqualInt (status, InvalidParameter); status = GdipRecordMetafile (hdc, (EmfType)(EmfTypeEmfPlusDual + 1), &rect, MetafileFrameUnitPixel, wmfFilePath, &metafile); assertEqualInt (status, InvalidParameter); status = GdipRecordMetafile (hdc, EmfTypeEmfPlusDual, &rect, (MetafileFrameUnit)(MetafileFrameUnitPixel - 1), wmfFilePath, &metafile); assertEqualInt (status, InvalidParameter); status = GdipRecordMetafile (hdc, EmfTypeEmfPlusDual, &rect, (MetafileFrameUnit)(MetafileFrameUnitGdi + 1), wmfFilePath, &metafile); assertEqualInt (status, InvalidParameter); status = GdipRecordMetafile (hdc, EmfTypeEmfPlusDual, &zeroWidth, MetafileFrameUnitPixel, wmfFilePath, &metafile); assertEqualInt (status, GenericError); status = GdipRecordMetafile (hdc, EmfTypeEmfPlusDual, &zeroHeight, MetafileFrameUnitPixel, wmfFilePath, &metafile); assertEqualInt (status, GenericError); status = GdipRecordMetafile (hdc, EmfTypeEmfPlusDual, &rect, MetafileFrameUnitPixel, wmfFilePath, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (wmfMetafile); GdipDisposeImage (emfMetafile); GdipDisposeImage (bitmap); GdipDeleteGraphics (graphics); } int main (int argc, char**argv) { STARTUP; test_createMetafileFromFile (); test_createMetafileFromStream (); test_createMetafileFromEmf (); test_createMetafileFromWmf (); test_getMetafileHeaderFromWmf (); test_getMetafileHeaderFromEmf (); test_getMetafileHeaderFromFile (); test_getMetafileHeaderFromStream (); test_getMetafileHeaderFromMetafile (); test_gettHemfFromMetafile (); test_getMetafileDownLevelRasterizationLimit (); test_setMetafileDownLevelRasterizationLimit (); test_playMetafileRecord (); test_recordMetafile (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testadjustablearrowcap.c0000644000175000017500000004324313542674535023425 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include #include #include #include "testhelpers.h" static void verifyArrowCap (GpAdjustableArrowCap *cap, REAL expectedHeight, REAL expectedWidth, BOOL expectedIsFilled) { assert (cap && "Expected cap to be initialized."); GpStatus status; REAL height; REAL width; BOOL isFilled; REAL middleInset; CustomLineCapType capType; LineCap baseCap; REAL baseInset; LineCap startCap; LineCap endCap; LineJoin strokeJoin; REAL widthScale; status = GdipGetAdjustableArrowCapHeight (cap, &height); assertEqualInt (status, Ok); assertEqualFloat (height, expectedHeight); status = GdipGetAdjustableArrowCapWidth (cap, &width); assertEqualInt (status, Ok); assertEqualFloat (width, expectedWidth); status = GdipGetAdjustableArrowCapFillState (cap, &isFilled); assertEqualInt (status, Ok); assert (isFilled == expectedIsFilled); status = GdipGetAdjustableArrowCapMiddleInset (cap, &middleInset); assertEqualInt (status, Ok); assertEqualFloat (middleInset, 0); status = GdipGetCustomLineCapType ((GpCustomLineCap *) cap, &capType); assertEqualInt (status, Ok); assertEqualInt (capType, CustomLineCapTypeAdjustableArrow); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, (expectedWidth == 0 ? 0 : (expectedHeight / expectedWidth))); status = GdipGetCustomLineCapStrokeCaps ((GpCustomLineCap *) cap, &startCap, &endCap); assertEqualInt (status, Ok); assertEqualInt (startCap, LineCapFlat); assertEqualInt (endCap, LineCapFlat); status = GdipGetCustomLineCapStrokeJoin ((GpCustomLineCap *) cap, &strokeJoin); assertEqualInt (status, Ok); assertEqualInt (strokeJoin, LineJoinMiter); status = GdipGetCustomLineCapWidthScale ((GpCustomLineCap *) cap, &widthScale); assertEqualInt (status, Ok); assertEqualFloat (widthScale, 1); } static void test_createAdjustableArrowCap () { GpStatus status; GpAdjustableArrowCap *cap; status = GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, 10, 11, TRUE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (0, 0, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, 0, 0, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (2, 0, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, 2, 0, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (0, 2, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, 0, 2, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (-1, -2, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, -1, -2, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (NAN, -2, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, NAN, -2, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (1, NAN, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, 1, NAN, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (-INFINITY, 1, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, -INFINITY, 1, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); status = GdipCreateAdjustableArrowCap (1, INFINITY, FALSE, &cap); assertEqualInt (status, Ok); verifyArrowCap (cap, 1, INFINITY, FALSE); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); // Negative tests. status = GdipCreateAdjustableArrowCap (10, 11, TRUE, NULL); assertEqualInt (status, InvalidParameter); } static void test_cloneAdjustableArrowCap () { GpStatus status; GpAdjustableArrowCap *cap; GpCustomLineCap *clonedCap; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); status = GdipCloneCustomLineCap ((GpCustomLineCap *) cap, &clonedCap); assertEqualInt (status, Ok); assert (clonedCap && clonedCap != cap); verifyArrowCap ((GpAdjustableArrowCap *) clonedCap, 10, 11, TRUE); GdipDeleteCustomLineCap ((GpCustomLineCap *) clonedCap); // Negative tests. status = GdipCloneCustomLineCap (NULL, &clonedCap); assertEqualInt (status, InvalidParameter); // This causes a null pointer reference in GDI+. #if !defined(_WIN32) status = GdipCloneCustomLineCap (cap, NULL); assertEqualInt (status, InvalidParameter); #endif GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_deleteAdjustableArrowCap () { GpStatus status; GpAdjustableArrowCap *cap; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); status = GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteCustomLineCap (NULL); assertEqualInt (status, InvalidParameter); } static void test_setAdjustableArrowCapHeight () { GpStatus status; GpAdjustableArrowCap *cap; REAL height; REAL baseInset; LineCap baseCap; GdipCreateAdjustableArrowCap (150, 3, TRUE, &cap); // Positive value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapHeight (cap, 30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapHeight (cap, &height); assertEqualInt (status, Ok); assertEqualFloat (height, 30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 10); // Same value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapHeight (cap, 30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapHeight (cap, &height); assertEqualInt (status, Ok); assertEqualFloat (height, 30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 120); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapRound); // Zero. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapHeight (cap, 0); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapHeight (cap, &height); assertEqualInt (status, Ok); assertEqualFloat (height, 0); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 0); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Negative value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapHeight (cap, -30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapHeight (cap, &height); assertEqualInt (status, Ok); assertEqualFloat (height, -30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, -10); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Negative tests. status = GdipSetAdjustableArrowCapHeight (NULL, 30); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_getAdjustableArrowCapHeight () { GpStatus status; GpAdjustableArrowCap *cap; REAL height; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); // Negative tests. status = GdipGetAdjustableArrowCapHeight (NULL, &height); assertEqualInt (status, InvalidParameter); status = GdipGetAdjustableArrowCapHeight (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_setAdjustableArrowCapWidth () { GpStatus status; GpAdjustableArrowCap *cap; REAL width; REAL baseInset; LineCap baseCap; GdipCreateAdjustableArrowCap (150, 3, TRUE, &cap); // Positive value. GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); status = GdipSetAdjustableArrowCapWidth (cap, 30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapWidth (cap, &width); assertEqualInt (status, Ok); assertEqualFloat (width, 30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 5); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Same value. GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); status = GdipSetAdjustableArrowCapWidth (cap, 30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapWidth (cap, &width); assertEqualInt (status, Ok); assertEqualFloat (width, 30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 120); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapRound); // Zero. GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); status = GdipSetAdjustableArrowCapWidth (cap, 0); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapWidth (cap, &width); assertEqualInt (status, Ok); assertEqualFloat (width, 0); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 0); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Negative value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); status = GdipSetAdjustableArrowCapWidth (cap, -30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapWidth (cap, &width); assertEqualInt (status, Ok); assertEqualFloat (width, -30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, -5); // Negative tests. status = GdipSetAdjustableArrowCapWidth (NULL, 30); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_getAdjustableArrowCapWidth () { GpStatus status; GpAdjustableArrowCap *cap; REAL width; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); // Negative tests. status = GdipGetAdjustableArrowCapWidth (NULL, &width); assertEqualInt (status, InvalidParameter); status = GdipGetAdjustableArrowCapWidth (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_setAdjustableArrowCapMiddleInset () { GpStatus status; GpAdjustableArrowCap *cap; REAL middleInset; REAL baseInset; LineCap baseCap; GdipCreateAdjustableArrowCap (150, 3, TRUE, &cap); // Positive value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapMiddleInset (cap, 30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapMiddleInset (cap, &middleInset); assertEqualInt (status, Ok); assertEqualFloat (middleInset, 30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 50); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Same value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapMiddleInset (cap, 30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapMiddleInset (cap, &middleInset); assertEqualInt (status, Ok); assertEqualFloat (middleInset, 30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 120); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapRound); // Zero. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapMiddleInset (cap, 0); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapMiddleInset (cap, &middleInset); assertEqualInt (status, Ok); assertEqualFloat (middleInset, 0); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 50); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Negative value. GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapMiddleInset (cap, -30); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapMiddleInset (cap, &middleInset); assertEqualInt (status, Ok); assertEqualFloat (middleInset, -30); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 50); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapTriangle); // Negative tests. status = GdipSetAdjustableArrowCapMiddleInset (NULL, 30); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_getAdjustableArrowCapMiddleInset () { GpStatus status; GpAdjustableArrowCap *cap; REAL middleInset; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); // Negative tests. status = GdipGetAdjustableArrowCapMiddleInset (NULL, &middleInset); assertEqualInt (status, InvalidParameter); status = GdipGetAdjustableArrowCapMiddleInset (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_setAdjustableArrowCapFillState () { GpStatus status; GpAdjustableArrowCap *cap; BOOL isFilled; REAL baseInset; LineCap baseCap; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); // FALSE GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapFillState (cap, FALSE); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapFillState (cap, &isFilled); assertEqualInt (status, Ok); assert (isFilled == FALSE); // TRUE GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapFillState (cap, TRUE); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapFillState (cap, &isFilled); assertEqualInt (status, Ok); assert (isFilled == TRUE); // Same value GdipSetCustomLineCapBaseInset ((GpCustomLineCap *) cap, 120); GdipSetCustomLineCapBaseCap ((GpCustomLineCap *) cap, LineCapRound); status = GdipSetAdjustableArrowCapFillState (cap, TRUE); assertEqualInt (status, Ok); status = GdipGetAdjustableArrowCapFillState (cap, &isFilled); assertEqualInt (status, Ok); assert (isFilled == TRUE); status = GdipGetCustomLineCapBaseInset ((GpCustomLineCap *) cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 120); status = GdipGetCustomLineCapBaseCap ((GpCustomLineCap *) cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, LineCapRound); // Negative tests. status = GdipSetAdjustableArrowCapFillState (NULL, 30); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } static void test_getAdjustableArrowCapFillState () { GpStatus status; GpAdjustableArrowCap *cap; BOOL isFilled; GdipCreateAdjustableArrowCap (10, 11, TRUE, &cap); // Negative tests. status = GdipGetAdjustableArrowCapFillState (NULL, &isFilled); assertEqualInt (status, InvalidParameter); status = GdipGetAdjustableArrowCapFillState (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteCustomLineCap ((GpCustomLineCap *) cap); } int main(int argc, char**argv) { STARTUP; test_createAdjustableArrowCap (); test_cloneAdjustableArrowCap (); test_deleteAdjustableArrowCap (); test_setAdjustableArrowCapHeight (); test_getAdjustableArrowCapHeight (); test_setAdjustableArrowCapWidth (); test_getAdjustableArrowCapWidth (); test_setAdjustableArrowCapMiddleInset (); test_getAdjustableArrowCapMiddleInset (); test_setAdjustableArrowCapFillState (); test_getAdjustableArrowCapFillState (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testgeneral.c0000644000175000017500000003674313542674535021174 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #define GDIPVER 0x0110 #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void test_startup () { GpStatus status; ULONG_PTR gdiplusToken = 0; #if defined(USE_WINDOWS_GDIPLUS) GdiplusStartupInput gdiplusStartupInput; #else GdiplusStartupInput gdiplusStartupInput = {1, NULL, FALSE, FALSE}; #endif GdiplusStartupOutput gdiplusStartupOutput = {NULL, NULL}; // Version 1 - no output. status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, Ok); assert (gdiplusToken); GdiplusShutdown (gdiplusToken); // Version 1 - output. status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, &gdiplusStartupOutput); assertEqualInt (status, Ok); assert (gdiplusToken); assert (!gdiplusStartupOutput.NotificationHook && !gdiplusStartupOutput.NotificationUnhook); GdiplusShutdown (gdiplusToken); // Version 2 - no output. gdiplusStartupInput.GdiplusVersion = 2; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, Ok); assert (gdiplusToken); GdiplusShutdown (gdiplusToken); // Version 2 - output. gdiplusStartupInput.GdiplusVersion = 2; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, &gdiplusStartupOutput); assertEqualInt (status, Ok); assert (gdiplusToken); assert (!gdiplusStartupOutput.NotificationHook && !gdiplusStartupOutput.NotificationUnhook); GdiplusShutdown (gdiplusToken); gdiplusStartupInput.GdiplusVersion = 1; // SuppressBackgroundThread is true. gdiplusStartupInput.SuppressBackgroundThread = TRUE; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, &gdiplusStartupOutput); assertEqualInt (status, Ok); assert (gdiplusToken); assert (gdiplusStartupOutput.NotificationHook && gdiplusStartupOutput.NotificationUnhook); GdiplusShutdown (gdiplusToken); gdiplusStartupInput.SuppressBackgroundThread = FALSE; // Startup multiple times. status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, Ok); status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, Ok); GdiplusShutdown (gdiplusToken); // Negative tests. status = GdiplusStartup (NULL, &gdiplusStartupInput, NULL); assertEqualInt (status, InvalidParameter); status = GdiplusStartup (&gdiplusToken, NULL, NULL); assertEqualInt (status, InvalidParameter); gdiplusStartupInput.GdiplusVersion = 0; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, UnsupportedGdiplusVersion); gdiplusStartupInput.GdiplusVersion = 3; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, UnsupportedGdiplusVersion); gdiplusStartupInput.GdiplusVersion = 1; gdiplusStartupInput.SuppressBackgroundThread = TRUE; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, InvalidParameter); gdiplusStartupInput.GdiplusVersion = 3; gdiplusStartupInput.SuppressBackgroundThread = TRUE; status = GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); assertEqualInt (status, InvalidParameter); } static void test_shutdown () { ULONG_PTR gdiplusToken = 0; #if defined(USE_WINDOWS_GDIPLUS) GdiplusStartupInput gdiplusStartupInput; #else GdiplusStartupInput gdiplusStartupInput = {1, NULL, FALSE, FALSE}; #endif GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); // Valid token. GdiplusShutdown (gdiplusToken); // Valid token again. GdiplusShutdown (gdiplusToken); // Invalid token. GdiplusShutdown ((ULONG_PTR) 1); // Null token. GdiplusShutdown ((ULONG_PTR) 0); } static void test_notificationHook () { GpStatus status; ULONG_PTR gdiplusToken = 0; ULONG_PTR notificationToken; #if defined(USE_WINDOWS_GDIPLUS) GdiplusStartupInput gdiplusStartupInput; #else GdiplusStartupInput gdiplusStartupInput = {1, NULL, FALSE, FALSE}; #endif gdiplusStartupInput.SuppressBackgroundThread = TRUE; GdiplusStartupOutput gdiplusStartupOutput = {NULL, NULL}; GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, &gdiplusStartupOutput); status = GdiplusNotificationHook (¬ificationToken); assertEqualInt (status, Ok); assert (notificationToken); GdiplusNotificationUnhook (notificationToken); // Negative tests. // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdiplusNotificationHook (NULL); assertEqualInt (status, InvalidParameter); #endif GdiplusShutdown (gdiplusToken); // SupressBackgroundThread is false. gdiplusStartupInput.SuppressBackgroundThread = FALSE; GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); status = GdiplusNotificationHook (¬ificationToken); assertEqualInt (status, GenericError); status = GdiplusNotificationHook (NULL); assertEqualInt (status, GenericError); GdiplusShutdown (gdiplusToken); } static void test_notificationUnhook () { ULONG_PTR gdiplusToken = 0; ULONG_PTR notificationToken; #if defined(USE_WINDOWS_GDIPLUS) GdiplusStartupInput gdiplusStartupInput; #else GdiplusStartupInput gdiplusStartupInput = {1, NULL, FALSE, FALSE}; #endif gdiplusStartupInput.SuppressBackgroundThread = TRUE; GdiplusStartupOutput gdiplusStartupOutput = {NULL, NULL}; GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, &gdiplusStartupOutput); GdiplusNotificationHook (¬ificationToken); // Valid token. GdiplusNotificationUnhook (notificationToken); // Valid token again. GdiplusNotificationUnhook (notificationToken); // Invalid token. GdiplusNotificationUnhook ((ULONG_PTR) 1); // Zero token. GdiplusNotificationUnhook ((ULONG_PTR) 0); GdiplusShutdown (gdiplusToken); // SupressBackgroundThread is false. gdiplusStartupInput.SuppressBackgroundThread = FALSE; GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); // Valid token. GdiplusNotificationUnhook (notificationToken); // Valid token again. GdiplusNotificationUnhook (notificationToken); // Invalid token. GdiplusNotificationUnhook ((ULONG_PTR) 1); // Zero token. GdiplusNotificationUnhook ((ULONG_PTR) 0); GdiplusShutdown (gdiplusToken); } static void test_alloc() { void *data; data = GdipAlloc (0); GdipFree (data); data = GdipAlloc (1); GdipFree (data); } static void test_free() { void *data; // Valid pointer. data = GdipAlloc (1); GdipFree (data); // Null pointer. GdipFree (NULL); } static void test_notInitialized () { GpStatus status; void *data = GdipAlloc (10); assert (!data); status = GdipCloneRegion (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateAdjustableArrowCap (0, 0, FALSE, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromFile (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromFileICM (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); // Libgdiplus does not implement GdipCreateBitmapFromGdiDib. #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreateBitmapFromGdiDib (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); #endif status = GdipCreateBitmapFromGraphics (0, 0, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromHBITMAP (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromHICON (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromResource (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromScan0 (0, 0, 0, PixelFormat32bppARGB, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromStream (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateBitmapFromStreamICM (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); // Libgdiplus does not implement GdipCreateCachedBitmap. #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreateCachedBitmap (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); #endif status = GdipCreateCustomLineCap (NULL, NULL, LineCapFlat, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFont (NULL, 0, 0, UnitPixel, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFontFamilyFromName (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipGetGenericFontFamilySansSerif (NULL); assertEqualInt (status, InvalidParameter); status = GdipGetGenericFontFamilySerif (NULL); assertEqualInt (status, InvalidParameter); status = GdipGetGenericFontFamilyMonospace (NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateFontFromDC (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFontFromLogfontA (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFontFromLogfontW (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFromHDC (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFromHDC2 (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFromHWND (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateFromHWNDICM (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateHBITMAPFromBitmap (NULL, NULL, 0); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateHICONFromBitmap (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateHatchBrush (HatchStyle05Percent, 0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateImageAttributes (NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateLineBrush (NULL, NULL, 0, 0, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateLineBrushFromRect (NULL, 0, 0, LinearGradientModeVertical, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateLineBrushFromRectI (NULL, 0, 0, LinearGradientModeVertical, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateLineBrushFromRectWithAngle (NULL, 0, 0, 0, FALSE, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateLineBrushFromRectWithAngleI (NULL, 0, 0, 0, FALSE, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateLineBrushI (NULL, NULL, 0, 0, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMatrix (NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMatrix2 (0, 0, 0, 0, 0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMatrix3 (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMatrix3I (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMetafileFromEmf (NULL, FALSE, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMetafileFromFile (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMetafileFromStream (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateMetafileFromWmf (NULL, FALSE, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); // Libgdiplus does not implement GdipCreateMetafileFromWmfFile. #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreateMetafileFromWmfFile (NULL, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); #endif status = GdipCreatePath (FillModeAlternate, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePath2 (NULL, NULL, 0, FillModeAlternate, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePath2I (NULL, NULL, 0, FillModeAlternate, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePathGradient (NULL, 0, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePathGradientFromPath (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePathGradientI (NULL, 0, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePathIter (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePen1 (0, 0, UnitPixel, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreatePen2 (NULL, 0, UnitPixel, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateRegion (NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateRegionPath (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateRegionRect (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateRegionRectI (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateRegionRgnData (NULL, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateSolidFill (0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateStringFormat (0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipStringFormatGetGenericDefault (NULL); assertEqualInt (status, InvalidParameter); status = GdipStringFormatGetGenericTypographic (NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateTexture (NULL, WrapModeClamp, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateTexture2 (NULL, WrapModeClamp, 0, 0, 0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateTexture2I (NULL, WrapModeClamp, 0, 0, 0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateTextureIA (NULL, NULL, 0, 0, 0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipCreateTextureIAI (NULL, NULL, 0, 0, 0, 0, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipDeletePrivateFontCollection (NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipGetTextureImage (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipLoadImageFromStream (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipLoadImageFromStreamICM (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipLoadImageFromFile (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipLoadImageFromFileICM (NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipNewPrivateFontCollection (NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipRecordMetafile (NULL, EmfTypeEmfPlusDual, NULL, MetafileFrameUnitMillimeter, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipRecordMetafileFileName (NULL, NULL, EmfTypeEmfPlusDual, NULL, MetafileFrameUnitMillimeter, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipRecordMetafileStream (NULL, NULL, EmfTypeEmfPlusDual, NULL, MetafileFrameUnitMillimeter, NULL, NULL); assertEqualInt (status, GdiplusNotInitialized); status = GdipSetPathGradientSurroundColorsWithCount (NULL, NULL, 0); assertEqualInt (status, GdiplusNotInitialized); } int main (int argc, char**argv) { test_startup (); test_shutdown (); test_notificationHook (); test_notificationUnhook (); test_alloc (); test_free (); test_notInitialized (); return 0; } libgdiplus-6.0.4+dfsg/tests/testbmpcodec.c0000644000175000017500000075310013545154623021316 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include "testhelpers.h" static const char *file = "temp_asset.bmp"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'b', 'm', 'p', 0}; GpImage *image; INT bmpFlags = ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccessDispose(buffer, expectedFormat, width, height, expectedFlags, dispose) \ { \ createFile (buffer, Ok); \ verifyBitmap (image, bmpRawFormat, expectedFormat, width, height, expectedFlags, 0, TRUE); \ if (dispose) \ GdipDisposeImage (image); \ } #define createFileSuccess(buffer, expectedFormat, width, height, expectedFlags) \ createFileSuccessDispose(buffer, expectedFormat, width, height, expectedFlags, TRUE) static void test_validImage1bppOS2Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x24, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x20, 0x00, 0x00, 0x00, // -- BITMAPCOREHEADER -- // /* SIze */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, /* Height */ 0x01, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x0, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00 }; BYTE image24x4[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x30, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x20, 0x00, 0x00, 0x00, // -- BITMAPCOREHEADER -- // /* SIze */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x18, 0x00, /* Height */ 0x04, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); createFileSuccessDispose (image24x4, PixelFormat1bppIndexed, 24, 4, bmpFlags, FALSE); ARGB image24x4Pixels[] = { 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, image24x4Pixels); verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage1bppBitmapInfoHeader () { BYTE image1x1ZeroColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00 }; BYTE image1x1SmallColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x3E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x01, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0xFF, 0x00, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00 }; BYTE image24x4LargeColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x18, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00 }; BYTE image1x1NegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00 }; BYTE image24x4NegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x18, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // -- Image Data -- // 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00 }; createFileSuccessDispose (image1x1ZeroColorsUsed, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1ZeroColorsUsedPixels[] = {0xFF00FF00}; verifyPixels (image, image1x1ZeroColorsUsedPixels); ARGB fullPalette[] = {0xFFFF00FF, 0xFF00FF00}; verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image1x1SmallColorsUsed, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1SmallColorsUsedPixels[] = {0xFF000000}; verifyPixels (image, image1x1SmallColorsUsedPixels); ARGB shortPalette[] = {0xFFFF00FF}; verifyPalette (image, 0, shortPalette); GdipDisposeImage (image); createFileSuccessDispose (image24x4LargeColorsUsed, PixelFormat1bppIndexed, 24, 4, bmpFlags, FALSE); ARGB image24x4LargeColorsUsedPixels[] = { 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00 }; verifyPixels (image, image24x4LargeColorsUsedPixels); verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image1x1NegativeHeight, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1NegativeHeightPixels[] = {0xFF00FF00}; verifyPixels (image, image1x1NegativeHeightPixels); verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image24x4NegativeHeight, PixelFormat1bppIndexed, 24, 4, bmpFlags, FALSE); ARGB image24x4NegativeHeightPixels[] = { 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF }; verifyPixels (image, image24x4NegativeHeightPixels); verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); } static void test_validImage1bppBitmapV3Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage1bppBitmapV4Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x86, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x82, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x6C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage1bppBitmapV5Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x96, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x92, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x7C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV5CSType */ 0x00, 0x00, 0x00, 0x00, /* bV5Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV5GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaBlue */ 0x00, 0x00, 0x00, 0x00, /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage4bppOS2Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x0, 0x0, 0x0, /* Offset */ 0x49, 0x0, 0x0, 0x0, // -- BITMAPCOREHEADER -- // /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, /* Height */ 0x01, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, // -- Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, // Image Data 0x12, 0x00, 0x00, 0x00 }; BYTE image6x4[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x5A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x0, 0x0, 0x0, /* Offset */ 0x49, 0x0, 0x0, 0x0, // -- BITMAPCOREHEADER -- // /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, /* Height */ 0x04, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, // -- Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, // -- Image Data -- // 0x13, 0xFF, 0x31, 0x00, 0x13, 0xAA, 0x31, 0x00, 0x13, 0x33, 0x31, 0x00, 0x11, 0x11, 0x11, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat4bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFF00FF}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0808FF, 0xFFFF0808, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat4bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFF00, 0xFFFF0808, 0xFFFF0808, 0xFFFFFF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFF00, 0xFFFF00FF }; verifyPixels (image, image6x4Pixels); verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage4bppBitmapInfoHeader () { BYTE image1x1ZeroColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x7A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x75, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x12, 0x00, 0x00, 0x00 }; BYTE image6x4SmallColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // 0x13, 0xFF, 0x31, 0x00, 0x13, 0xAA, 0x31, 0x00, 0x13, 0x33, 0x31, 0x00, 0x11, 0x11, 0x11, 0x00 }; BYTE image6x4LargeColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x82, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x14, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data -- // 0x13, 0xFF, 0x31, 0x00, 0x13, 0xAA, 0x31, 0x00, 0x13, 0x33, 0x31, 0x00, 0x11, 0x11, 0x11, 0x00 }; BYTE image1x1NegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x7A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x75, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x12, 0x00, 0x00, 0x00 }; BYTE image6x4NegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x7A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // 0x13, 0xFF, 0x31, 0x00, 0x13, 0xAA, 0x31, 0x00, 0x13, 0x33, 0x31, 0x00, 0x11, 0x11, 0x11, 0x00 }; createFileSuccessDispose (image1x1ZeroColorsUsed, PixelFormat4bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1ZeroColorsUsedPixels[] = {0xFF00FF00}; verifyPixels (image, image1x1ZeroColorsUsedPixels); ARGB fullPalette[] = {0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000}; verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4SmallColorsUsed, PixelFormat4bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4SmallColorsUsedPixels[] = { 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00 }; verifyPixels (image, image6x4SmallColorsUsedPixels); ARGB smallPalette[] = {0xFF0000FF, 0xFF00FF00, 0xFFFF0000}; verifyPalette (image, 0, smallPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4LargeColorsUsed, PixelFormat4bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4LargeColorsUsedPixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, image6x4LargeColorsUsedPixels); ARGB largePalette[] = {0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF}; verifyPalette (image, 0, largePalette); GdipDisposeImage (image); createFileSuccessDispose (image1x1NegativeHeight, PixelFormat4bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1NegativeHeightPixels[] = {0xFF00FF00}; verifyPixels (image, image1x1NegativeHeightPixels); verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4NegativeHeight, PixelFormat4bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4NegativeHeightPixels[] = { 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00 }; verifyPixels (image, image6x4NegativeHeightPixels); verifyPalette (image, 0, smallPalette); GdipDisposeImage (image); } static void test_validImage4bppBitmapV3Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x02, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x10, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat4bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage4bppBitmapV4Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x86, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x82, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x6C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x02, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x10, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat4bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage4bppBitmapV5Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x96, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x92, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x7C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x02, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV5CSType */ 0x00, 0x00, 0x00, 0x00, /* bV5Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV5GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaBlue */ 0x00, 0x00, 0x00, 0x00, /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x10, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat4bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage4bppRle4Compression () { BYTE fullNoTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x00, /* New Line */ 0x00, 0x00 }; BYTE fullTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x54, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|0|0|0|0|0] */ 0x06, 0x00, /* New Line */ 0x00, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE split[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x58, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* [1|1|1|1] */ 0x04, 0x11, /* New Line */ 0x00, 0x00, /* [0|0|0] */ 0x03, 0x00, /* [1|1|1] */ 0x03, 0x11, /* New Line */ 0x00, 0x00, /* [3|3|3|3|3]*/ 0x05, 0x33, /* New Line */ 0x00, 0x00, /* [0] */ 0x01, 0x00, /* [3|3] */ 0x02, 0x33, /* New Line */ 0x00, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE overflowNoTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x44, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|0|0...] */ 0xFF, 0x00 }; BYTE overflowTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|0|0...] */ 0xFF, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE jump[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [1, 2] */ 0x00, 0x02, 0x01, 0x02, /* [1|1|1] */ 0x03, 0x11, /* Terminator */ 0x00, 0x01 }; BYTE jumpMissingDx[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x44, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [?, ?] */ 0x00, 0x02 }; BYTE jumpMissingDy[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x45, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [0, ?] */ 0x00, 0x02, 0x00 }; BYTE jumpInvalidDx[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [255, 2] */ 0x00, 0x02, 0xFF, 0x02, /* [1|1|1] */ 0x03, 0x11, /* Terminator */ 0x00, 0x01 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE jumpInvalidDy[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [1, 255] */ 0x00, 0x02, 0x01, 0xFF, /* [1|1|1] */ 0x03, 0x11, /* Terminator */ 0x00, 0x01 }; #endif BYTE absoluteModeOddPixels[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x48, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [1|3|1] */ 0x00, 0x03, 0x13, 0x01, /* Terminator */ 0x00, 0x01 }; BYTE absoluteModeEvenPixels[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x48, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [1|3|1|0] */ 0x00, 0x04, 0x13, 0x01, /* Terminator */ 0x00, 0x01 }; BYTE absoluteModeNoData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x44, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [?|?|?] */ 0x00, 0x03 }; BYTE absoluteModeShortData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x45, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|?] */ 0x00, 0x03, 0x01 }; BYTE absoluteModeNoPadding[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x45, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|2|0] */ 0x00, 0x05, 0x01, 0x02, 0x01 }; BYTE fullNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x54, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|0|0|0|0|0] */ 0x06, 0x00, /* New Line */ 0x00, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE incompleteAfterLineBreak[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1|0] */ 0x06, 0x01, /* New Line */ 0x00, 0x00 }; BYTE noImageData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF }; BYTE singleByteData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x43, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ 0x03 }; BYTE singleEscapeCode[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x43, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ 0x00 }; BYTE earlyTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ /* [0|0] */ 0x02, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE earlyTerminatorWithTrailingBytes[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ /* [0|0] */ 0x02, 0x00, /* Terminator */ 0x00, 0x01, /* Trailing */ 0x06, 0x02, 0xFF, 0xFF }; BYTE tooManyNewLines[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x50, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x04, 0x00, /* Compression */ 0x02, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* [1|1|1|1|1|1] */ 0x06, 0x00, /* Terminator */ 0x00, 0x01 }; // FIXME: GDI+ converts BI_RLE4 bitmaps to 32bpp. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat expectedRle4Format = PixelFormat32bppRGB; #else PixelFormat expectedRle4Format = PixelFormat4bppIndexed; #endif createFileSuccessDispose (fullNoTerminator, expectedRle4Format, 6, 4, bmpFlags, FALSE); ARGB fullNoTerminatorPixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00 }; verifyPixels (image, fullNoTerminatorPixels); GdipDisposeImage(image); createFileSuccessDispose (fullTerminator, expectedRle4Format, 6, 4, bmpFlags, FALSE); ARGB fullTerminatorPixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00 }; verifyPixels (image, fullTerminatorPixels); GdipDisposeImage(image); createFileSuccessDispose (split, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB splitPixels[] = { 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000 }; verifyPixels (image, splitPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (overflowNoTerminator, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB overflowNoTerminatorPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, overflowNoTerminatorPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (overflowTerminator, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB overflowTerminatorPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, overflowTerminatorPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (jump, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpPixels) #endif GdipDisposeImage(image); createFileSuccessDispose (jumpMissingDx, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpMissingDxPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpMissingDxPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (jumpMissingDy, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpMissingDyPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpMissingDyPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (jumpInvalidDx, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpInvalidDxPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpInvalidDxPixels); #endif GdipDisposeImage(image); // FIXME: this causes a heap buffer overflow in libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccessDispose (jumpInvalidDy, expectedRle4Format, 6, 4, bmpFlags, FALSE); ARGB jumpInvalidDyPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpInvalidDyPixels); GdipDisposeImage(image); #endif createFileSuccessDispose (absoluteModeOddPixels, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeOddPixelsPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeOddPixelsPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (absoluteModeEvenPixels, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeEvenPixelsPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeEvenPixelsPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (absoluteModeNoData, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeNoDataPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeNoDataPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (absoluteModeShortData, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeShortDataPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeShortDataPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (absoluteModeNoPadding, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeNoPaddingPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFFFF0000, 0xFF0000FF, 0xFF000000 }; verifyPixels (image, absoluteModeNoPaddingPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (fullNegativeHeight, expectedRle4Format, 6, 4, bmpFlags, FALSE); // according to the docs (https://docs.microsoft.com/en-us/windows/desktop/gdi/bitmap-header-types) negative height (top-down bitmap) // isn't supported for RLE compression but GDI+ still accepts it #if defined(USE_WINDOWS_GDIPLUS) ARGB fullNegativeHeightPixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, fullNegativeHeightPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (incompleteAfterLineBreak, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB incompleteAfterLineBreakPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00, 0xFF0000FF, 0xFF00FF00 }; verifyPixels (image, incompleteAfterLineBreakPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (noImageData, expectedRle4Format, 6, 4, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (singleByteData, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB singleByteDataPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, singleByteDataPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (singleEscapeCode, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB singleEscapeCodePixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, singleEscapeCodePixels); #endif GdipDisposeImage(image); createFileSuccessDispose (earlyTerminator, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB earlyTerminatorPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, earlyTerminatorPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (earlyTerminatorWithTrailingBytes, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB earlyTerminatorWithTrailingBytesPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, earlyTerminatorWithTrailingBytesPixels); #endif GdipDisposeImage(image); createFileSuccessDispose (tooManyNewLines, expectedRle4Format, 6, 4, bmpFlags, FALSE); // FIXME: rle4 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB tooManyNewLinesPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, tooManyNewLinesPixels); #endif GdipDisposeImage(image); } static void test_validImage8bppOS2Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x0C, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPCOREHEADER -- // /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, /* Height */ 0x01, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x01, 0x00, 0x00, 0x00 }; BYTE image6x4[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x3A, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPCOREHEADER -- // /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, /* Height */ 0x04, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x01, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat8bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFF0000}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0808FF, 0xFFFF0808, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF000000, 0xFF00FFFF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF08FF00, 0xFF080808, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0000FF, 0xFFFFFF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF080808, 0xFF00FF08, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0808FF, 0xFFFF0808, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF000000, 0xFF00FFFF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF08FF00, 0xFF080808, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0000FF, 0xFFFFFF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF080808, 0xFF00FF08, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0808FF, 0xFFFF0808, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF000000, 0xFF00FFFF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF08FF00, 0xFF080808, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0000FF, 0xFFFFFF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF080808, 0xFF00FF08, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0808FF, 0xFFFF0808, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF000000, 0xFF00FFFF, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF08FF00, 0xFF080808, 0xFF0000FF, 0xFFFF00FF, 0xFF00FF00, 0xFFFFFF00, 0xFF00FFFF, 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF0000FF, 0xFFFFFF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFFFF, 0xFFFF00FF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF00FFFF, 0xFFFF0000, 0xFF080808, 0xFF00FF08, 0xFF00FF00, 0xFFFF00FF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFF00, 0xFFFFFF00, 0xFFFFFFFF, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat8bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFFFF0000, 0xFF000000, 0xFF000000, 0xFFFF0000, 0xFF0000FF, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFF0000FF, 0xFF0000FF, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFF0000FF, 0xFF0000FF, 0xFFFF0000, 0xFF0000FF, 0xFFFF0000 }; verifyPixels (image, image6x4Pixels); verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage8bppBitmapInfoHeader () { BYTE image1x1ZeroColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x3A, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x01, 0x00, 0x00, 0x00 }; BYTE image6x4SmallColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x62, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00 }; BYTE image6x4LargeColorsUsed[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x96, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x10, 0x01, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00 }; BYTE image1x1NegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x3A, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 8, 8, 8, 8, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x01, 0x00, 0x00, 0x00 }; BYTE image6x4NegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x62, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, // -- Image Data -- // 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00 }; createFileSuccessDispose (image1x1ZeroColorsUsed, PixelFormat8bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1ZeroColorsUsedPixels[] = {0xFF00FF00}; verifyPixels (image, image1x1ZeroColorsUsedPixels); ARGB fullPalette[] = {0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF080808, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF, 0xFF000000, 0xFF000000}; verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4SmallColorsUsed, PixelFormat8bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4SmallColorsUsedPixels[] = { 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF00FF00 }; verifyPixels (image, image6x4SmallColorsUsedPixels); ARGB smallPalette[] = {0xFF0000FF, 0xFF00FF00, 0xFF000000}; verifyPalette (image, 0, smallPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4LargeColorsUsed, PixelFormat8bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4LargeColorsUsedPixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000 }; verifyPixels (image, image6x4LargeColorsUsedPixels); verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image1x1NegativeHeight, PixelFormat8bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1NegativeHeightPixels[] = {0xFF00FF00}; verifyPixels (image, image1x1NegativeHeightPixels); verifyPalette (image, 0, fullPalette); GdipDisposeImage (image); createFileSuccessDispose (image6x4NegativeHeight, PixelFormat8bppIndexed, 6, 4, bmpFlags, FALSE); ARGB image6x4NegativeHeightPixels[] = { 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF0000FF, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00 }; verifyPixels (image, image6x4NegativeHeightPixels); verifyPalette (image, 0, smallPalette); GdipDisposeImage (image); } static void test_validImage8bppBitmapV3Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x02, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x01, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat8bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage8bppBitmapV4Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x86, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x82, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x6C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x02, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x01, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat8bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage8bppBitmapV5Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x96, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x92, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER -- // /* Header Size */ 0x7C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x02, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0xFF, 0x00, /* Blue Mask */ 0x00, 0xFF, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV5CSType */ 0x00, 0x00, 0x00, 0x00, /* bV5Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV5GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV5HEADER --// /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x01, 0x00, 0x00, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat8bppIndexed, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFF00FF00}; verifyPixels (image, image1x1Pixels); ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_validImage8bppRle8Compression () { BYTE fullNoTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x52, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x00, /* New Line */ 0x00, 0x00 }; BYTE fullTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x54, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|0|0|0|0|0] */ 0x06, 0x00, /* New Line */ 0x00, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE split[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x58, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* [1|1|1|1] */ 0x04, 0x01, /* New Line */ 0x00, 0x00, /* [0|0|0] */ 0x03, 0x00, /* [1|1|1] */ 0x03, 0x01, /* New Line */ 0x00, 0x00, /* [3|3|3|3|3]*/ 0x05, 0x03, /* New Line */ 0x00, 0x00, /* [0] */ 0x01, 0x00, /* [3|3] */ 0x02, 0x03, /* New Line */ 0x00, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE overflowNoTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x44, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|0|0...] */ 0xFF, 0x00 }; BYTE overflowTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|0|0...] */ 0xFF, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE jump[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [1, 2] */ 0x00, 0x02, 0x01, 0x02, /* [1|1|1] */ 0x03, 0x01, /* Terminator */ 0x00, 0x01 }; BYTE jumpMissingDx[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x44, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [?, ?] */ 0x00, 0x02 }; BYTE jumpMissingDy[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x45, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [0, ?] */ 0x00, 0x02, 0x00 }; BYTE jumpInvalidDx[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [255, 2] */ 0x00, 0x02, 0xFF, 0x02, /* [1|1|1] */ 0x03, 0x01, /* Terminator */ 0x00, 0x01 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE jumpInvalidDy[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* Jump to [1, 255] */ 0x00, 0x02, 0x01, 0xFF, /* [1|1|1] */ 0x03, 0x01, /* Terminator */ 0x00, 0x01 }; #endif BYTE absoluteModeOddPixels[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x49, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [1|3|1] */ 0x00, 0x03, 0x01, 0x03, 0x01, /* Terminator */ 0x00, 0x01 }; BYTE absoluteModeEvenPixels[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [1|3|1|0] */ 0x00, 0x04, 0x01, 0x03, 0x01, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE absoluteModeNoData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x44, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [?|?|?] */ 0x00, 0x03 }; BYTE absoluteModeShortData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x45, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|?|?] */ 0x00, 0x03, 0x00 }; BYTE absoluteModeNoPadding[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x47, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [1|2|1] */ 0x00, 0x03, 0x01, 0x02, 0x01 }; BYTE fullNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x54, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|1|0|1|0|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00, /* [0|0|0|0|0|0] */ 0x06, 0x00, /* New Line */ 0x00, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE incompleteAfterLineBreak[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, // -- Image Data -- // /* [1|1|1|1|1|1|1] */ 0x06, 0x01, /* New Line */ 0x00, 0x00 }; BYTE noImageData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF }; BYTE singleByteData[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x43, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ 0x03 }; BYTE singleEscapeCode[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x43, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ 0x00 }; BYTE earlyTerminator[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ /* [0|0] */ 0x02, 0x00, /* Terminator */ 0x00, 0x01 }; BYTE earlyTerminatorWithTrailingBytes[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ /* [0|0] */ 0x02, 0x00, /* Terminator */ 0x00, 0x01, /* Trailing */ 0x06, 0x02, 0xFF, 0xFF }; BYTE tooManyNewLines[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x50, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // BITMAPINFOHEADER -- // /* Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x08, 0x00, /* Compression */ 0x01, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x03, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, /* -- Image Data -- */ /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* New Line */ 0x00, 0x00, /* [1|1|1|1|1|1] */ 0x06, 0x00, /* Terminator */ 0x00, 0x01 }; // FIXME: GDI+ converts BI_RLE8 bitmaps to 32bpp. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat expectedRle8Format = PixelFormat32bppRGB; #else PixelFormat expectedRle8Format = PixelFormat8bppIndexed; #endif createFileSuccessDispose (fullNoTerminator, expectedRle8Format, 6, 4, bmpFlags, FALSE); ARGB fullNoTerminatorPixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00 }; verifyPixels (image, fullNoTerminatorPixels); GdipDisposeImage (image); createFileSuccessDispose (fullTerminator, expectedRle8Format, 6, 4, bmpFlags, FALSE); ARGB fullTerminatorPixels[] = { 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00 }; verifyPixels (image, fullTerminatorPixels); GdipDisposeImage (image); createFileSuccessDispose (split, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB splitPixels[] = { 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000 }; verifyPixels (image, splitPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (overflowNoTerminator, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB overflowNoTerminatorPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, overflowNoTerminatorPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (overflowTerminator, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB overflowTerminatorPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, overflowTerminatorPixels); GdipDisposeImage (image); #endif GdipDisposeImage (image); createFileSuccessDispose (jump, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (jumpMissingDx, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpMissingDxPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpMissingDxPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (jumpMissingDy, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpMissingDyPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpMissingDyPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (jumpInvalidDx, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB jumpInvalidDxPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpInvalidDxPixels); #endif GdipDisposeImage (image); // FIXME: this causes a heap buffer overflow in libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccessDispose (jumpInvalidDy, expectedRle8Format, 6, 4, bmpFlags, FALSE); ARGB jumpInvalidDyPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, jumpInvalidDyPixels); GdipDisposeImage (image); #endif createFileSuccessDispose (absoluteModeOddPixels, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeOddPixelsPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeOddPixelsPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (absoluteModeEvenPixels, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeEvenPixelsPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF000000, 0xFF00FF00, 0xFF0000FF, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeEvenPixelsPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (absoluteModeNoData, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeNoDataPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeNoDataPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (absoluteModeShortData, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeShortDataPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeShortDataPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (absoluteModeNoPadding, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB absoluteModeNoPaddingPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, absoluteModeNoPaddingPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (fullNegativeHeight, expectedRle8Format, 6, 4, bmpFlags, FALSE); // according to the docs (https://docs.microsoft.com/en-us/windows/desktop/gdi/bitmap-header-types) negative height (top-down bitmap) // isn't supported for RLE compression but GDI+ still accepts it #if defined(USE_WINDOWS_GDIPLUS) ARGB fullNegativeHeightPixels[] = { 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF }; verifyPixels (image, fullNegativeHeightPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (incompleteAfterLineBreak, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB incompleteAfterLineBreakPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00 }; verifyPixels (image, incompleteAfterLineBreakPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (noImageData, expectedRle8Format, 6, 4, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (singleByteData, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB singleByteDataPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, singleByteDataPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (singleEscapeCode, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB singleEscapeCodePixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, singleEscapeCodePixels); #endif GdipDisposeImage (image); createFileSuccessDispose (earlyTerminator, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB earlyTerminatorPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, earlyTerminatorPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (earlyTerminatorWithTrailingBytes, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB earlyTerminatorWithTrailingBytesPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF0000FF, 0xFF0000FF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, earlyTerminatorWithTrailingBytesPixels); #endif GdipDisposeImage (image); createFileSuccessDispose (tooManyNewLines, expectedRle8Format, 6, 4, bmpFlags, FALSE); // FIXME: rle8 encoding edgecases are not properly handled by libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) ARGB tooManyNewLinesPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 }; verifyPixels (image, tooManyNewLinesPixels); #endif GdipDisposeImage (image); } static void test_validImage16bppOS2Header () { BYTE image1x1[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x1E, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x1A, 0x00, 0x00, 0x00, // -- BITMAPCOREHEADER -- // /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, /* Height */ 0x01, 0x00, /* Planes */ 0x01, 0x00, /* Bit Cunt */ 0x10, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x04, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x1A, 0x00, 0x00, 0x00, // -- BITMAPCOREHEADER -- // /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, /* Height */ 0x04, 0x00, /* Planes */ 0x01, 0x00, /* Bit Cunt */ 0x10, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFD6AD6B}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6, 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6 }; verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage16bppBitmapInfoHeader () { BYTE image1x1NoCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x3A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x35, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4NoCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x66, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x35, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1NoCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x3A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x35, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4NoCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x66, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x35, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1RGB555MaskBitfieldsCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0x7C, 0x00, 0x00, /* Green Mask */ 0xE0, 0x03, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4RGB555MaskBitfieldsCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x72, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0x7C, 0x00, 0x00, /* Green Mask */ 0xE0, 0x03, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1RGB565MaskBitfieldsCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0xF8, 0x00, 0x00, /* Green Mask */ 0xE0, 0x07, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4RGB565MaskBitfieldsCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x72, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0xF8, 0x00, 0x00, /* Green Mask */ 0xE0, 0x07, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1InvalidMaskBitfieldsCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x7F, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0xFF, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4InvalidMaskBitfieldsCompression[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x72, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0x04, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0xFF, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0xFF, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1RGB555MaskBitfieldsCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0x7C, 0x00, 0x00, /* Green Mask */ 0xE0, 0x03, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4RGB555MaskBitfieldsCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x72, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0x7C, 0x00, 0x00, /* Green Mask */ 0xE0, 0x03, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1RGB565MaskBitfieldsCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0xF8, 0x00, 0x00, /* Green Mask */ 0xE0, 0x07, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4RGB565MaskBitfieldsCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x72, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0x00, 0xF8, 0x00, 0x00, /* Green Mask */ 0xE0, 0x07, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; BYTE image1x1InvalidMaskBitfieldsCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x46, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0xFF, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0xFF, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0xFF, 0x00, // -- Image Data -- // B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4InvalidMaskBitfieldsCompressionNegativeHeight[] = { // -- BITMAPFILEHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x72, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x42, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x06, 0x00, 0x00, 0x00, /* Height */ 0xFC, 0xFF, 0xFF, 0xFF, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x03, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Masks -- // /* Red Mask */ 0xFF, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x7F, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0xFF, 0x00, // -- Image Data -- // B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; #if defined(USE_WINDOWS_GDIPLUS) BYTE rle4Compression16bpp[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, BI_RLE4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0 }; BYTE rle8Compression16bpp[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, BI_RLE8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0 }; #endif createFileSuccessDispose (image1x1NoCompression, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1NoCompressionPixels[] = {0xFFD6AD6B}; verifyPixels (image, image1x1NoCompressionPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4NoCompression, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4NoCompressionPixels[] = { 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6, 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6 }; verifyPixels (image, image6x4NoCompressionPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1NoCompressionNegativeHeight, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1NoCompressionNegativeHeightPixels[] = {0xFFD6AD6B}; verifyPixels (image, image1x1NoCompressionNegativeHeightPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4NoCompressionNegativeHeight, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4NoCompressionNegativeHeightPixels[] = { 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6, 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6, 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000 }; verifyPixels (image, image6x4NoCompressionNegativeHeightPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1RGB555MaskBitfieldsCompression, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); verifyPixels (image, image1x1NoCompressionPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4RGB555MaskBitfieldsCompression, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); verifyPixels (image, image6x4NoCompressionPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1RGB565MaskBitfieldsCompression, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1RGB565MaskBitfieldsPixels[] = {0xFF6B556B}; verifyPixels (image, image1x1RGB565MaskBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4RGB565MaskBitfieldsCompression, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4RGB565MaskBitfieldsPixels[] = { 0xFFFFDFFF, 0xFFC61CFF, 0xFF001CC6, 0xFFFFC339, 0xFF39DFC6, 0xFF000000, 0xFFC61CFF, 0xFFFFDFFF, 0xFFFFC339, 0xFF001CC6, 0xFF000000, 0xFF39DFC6, 0xFFFFDFFF, 0xFFC61CFF, 0xFF001CC6, 0xFFFFC339, 0xFF39DFC6, 0xFF000000, 0xFFC61CFF, 0xFFFFDFFF, 0xFFFFC339, 0xFF001CC6, 0xFF000000, 0xFF39DFC6 }; verifyPixels (image, image6x4RGB565MaskBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1InvalidMaskBitfieldsCompression, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); // FIXME: invalid mask images are interpreted as (and not converted to) 32bpp images by GDI+. // https://github.com/mono/libgdiplus/issues/158 #if defined(USE_WINDOWS_GDIPLUS) ARGB image1x1InvalidMaskBitfieldsCompressionPixels[] = {0xFFADD56B}; verifyPixels (image, image1x1InvalidMaskBitfieldsCompressionPixels); verifyNoPalette (image, 0); #endif GdipDisposeImage (image); createFileSuccessDispose (image6x4InvalidMaskBitfieldsCompression, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); // FIXME: invalid mask images are interpreted as (and not converted to) 32bpp images by GDI+. // https://github.com/mono/libgdiplus/issues/158 #if defined(USE_WINDOWS_GDIPLUS) ARGB image6x4InvalidMaskBitfieldsCompressionPixels[] = { 0xFFFFFE00, 0xFFFFC000, 0xFFF80000, 0xFF07FE00, 0xFFF83E00, 0xFF000000, 0xFFFFC000, 0xFFFFFE00, 0xFF07FE00, 0xFFF80000, 0xFF000000, 0xFFF83E00, 0xFFFFFE00, 0xFFFFC000, 0xFFF80000, 0xFF07FE00, 0xFFF83E00, 0xFF000000, 0xFFFFC000, 0xFFFFFE00, 0xFF07FE00, 0xFFF80000, 0xFF000000, 0xFFF83E00 }; verifyPixels (image, image6x4InvalidMaskBitfieldsCompressionPixels); verifyNoPalette (image, 0); #endif GdipDisposeImage (image); createFileSuccessDispose (image1x1RGB555MaskBitfieldsCompressionNegativeHeight, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); verifyPixels (image, image1x1NoCompressionNegativeHeightPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4RGB555MaskBitfieldsCompressionNegativeHeight, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); verifyPixels (image, image6x4NoCompressionNegativeHeightPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1RGB565MaskBitfieldsCompressionNegativeHeight, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1RGB565MaskNegativeHeightBitfieldsPixels[] = {0xFF6B556B}; verifyPixels (image, image1x1RGB565MaskNegativeHeightBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4RGB565MaskBitfieldsCompressionNegativeHeight, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4RGB565MaskNegativeHeightBitfieldsPixels[] = { 0xFFC61CFF, 0xFFFFDFFF, 0xFFFFC339, 0xFF001CC6, 0xFF000000, 0xFF39DFC6, 0xFFFFDFFF, 0xFFC61CFF, 0xFF001CC6, 0xFFFFC339, 0xFF39DFC6, 0xFF000000, 0xFFC61CFF, 0xFFFFDFFF, 0xFFFFC339, 0xFF001CC6, 0xFF000000, 0xFF39DFC6, 0xFFFFDFFF, 0xFFC61CFF, 0xFF001CC6, 0xFFFFC339, 0xFF39DFC6, 0xFF000000 }; verifyPixels (image, image6x4RGB565MaskNegativeHeightBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1InvalidMaskBitfieldsCompressionNegativeHeight, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); // FIXME: invalid mask images are interpreted as (and not converted to) 32bpp images by GDI+. // https://github.com/mono/libgdiplus/issues/158 #if defined(USE_WINDOWS_GDIPLUS) ARGB image1x1InvalidMaskNegativeHeightBitfieldsPixels[] = {0xFFAD6A00}; verifyPixels (image, image1x1InvalidMaskNegativeHeightBitfieldsPixels); verifyNoPalette (image, 0); #endif GdipDisposeImage (image); createFileSuccessDispose (image6x4InvalidMaskBitfieldsCompressionNegativeHeight, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); // FIXME: invalid mask images are interpreted as (and not converted to) 32bpp images by GDI+. // https://github.com/mono/libgdiplus/issues/158 #if defined(USE_WINDOWS_GDIPLUS) ARGB image6x4InvalidMaskBitfieldsNegativeHeightBitfieldsPixels[] = { 0xFFFF81FF, 0xFFFFFDFF, 0xFF07FD39, 0xFFF800C6, 0xFF000000, 0xFFF87CC6, 0xFFFFFDFF, 0xFFFF81FF, 0xFFF800C6, 0xFF07FD39, 0xFFF87CC6, 0xFF000000, 0xFFFF81FF, 0xFFFFFDFF, 0xFF07FD39, 0xFFF800C6, 0xFF000000, 0xFFF87CC6, 0xFFFFFDFF, 0xFFFF81FF, 0xFFF800C6, 0xFF07FD39, 0xFFF87CC6, 0xFF000000 }; verifyPixels (image, image6x4InvalidMaskBitfieldsNegativeHeightBitfieldsPixels); verifyNoPalette (image, 0); #endif GdipDisposeImage (image); // FIXME: this returns OutOfMemory libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccessDispose (rle4Compression16bpp, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (rle8Compression16bpp, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); #endif } static void test_validImage16bppBitmapV3Header () { BYTE image1x1RGB565[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x46, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER --// /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0xF8, 0x00, 0x00, /* Green Mask */ 0xE0, 0x07, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xD7, 0xFE, 0x00, 0x00 }; BYTE image1x1RGB555[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x46, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x7C, 0x00, 0x00, 0x00, /* Green Mask */ 0xE0, 0x03, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xD7, 0xFE, 0x00, 0x00 }; createFileSuccessDispose (image1x1RGB565, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1RGB565Pixels[] = {0xFFFFB5BD}; verifyPixels (image, image1x1RGB565Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1RGB555, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1RGB555Pixels[] = {0xFFFFB5BD}; verifyPixels (image, image1x1RGB555Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage16bppBitmapV4Header () { BYTE image1x1[] = { 'B', 'M', 126, 0, 0, 0, 0, 0, 0, 0, 0x79, 0, 0, 0, 108, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 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, 124, 0, 0, 224, 3, 0, 0, 0x1F, 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, B8(10101101), B8(01101010), 0, 0 }; BYTE image6x4[] = { 'B', 'M', 126, 0, 0, 0, 0, 0, 0, 0, 0x79, 0, 0, 0, 108, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 1, 0, 16, 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, 124, 0, 0, 224, 3, 0, 0, 0x1F, 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, B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000), B8(11111111), B8(11000000), B8(11111111), B8(11111110), B8(00000111), B8(11111110), B8(11111000), B8(00000000), B8(00000000), B8(00000000), B8(11111000), B8(00111110), B8(11111111), B8(11111110), B8(11111111), B8(11000000), B8(11111000), B8(00000000), B8(00000111), B8(11111110), B8(11111000), B8(00111110), B8(00000000), B8(00000000) }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFD6AD6B}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6, 0xFFFFBDFF, 0xFF8439FF, 0xFF0039C6, 0xFFFF8439, 0xFF7BBDC6, 0xFF000000, 0xFF8439FF, 0xFFFFBDFF, 0xFFFF8439, 0xFF0039C6, 0xFF000000, 0xFF7BBDC6 }; verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage16bppBitmapV5Header () { BYTE image1x1RGB565[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x8E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x8A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x7C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0x00, 0xF8, 0x00, 0x00, /* Green Mask */ 0xE0, 0x07, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV5CSType */ 0x00, 0x00, 0x00, 0x00, /* bV5Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV5GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV5HEADER --// /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xD7, 0xFE, 0x00, 0x00 }; BYTE image1x1RGB555[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x8E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x8A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x7C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x10, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3HEADER -- // /* Red Mask */ 0x7C, 0x00, 0x00, 0x00, /* Green Mask */ 0xE0, 0x03, 0x00, 0x00, /* Blue Mask */ 0x1F, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV5CSType */ 0x00, 0x00, 0x00, 0x00, /* bV5Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV5GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV5GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV5HEADER --// /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xD7, 0xFE, 0x00, 0x00 }; createFileSuccessDispose (image1x1RGB565, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1RGB565Pixels[] = {0xFFFFB5BD}; verifyPixels (image, image1x1RGB565Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1RGB555, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1RGB555Pixels[] = {0xFFFFB5BD}; verifyPixels (image, image1x1RGB555Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage24bppOS2Header () { BYTE image1x1[] = { 'B', 'M', 29, 0, 0, 0, 0, 0, 0, 0, 0x1A, 0, 0, 0, 12, 0, 0, 0, 1, 0, 1, 0, 1, 0, 24, 0, 0, 0, 255, 0 }; BYTE image6x4[] = { 'B', 'M', 106, 0, 0, 0, 0, 0, 0, 0, 0x1A, 0, 0, 0, 12, 0, 0, 0, 6, 0, 4, 0, 1, 0, 24, 0, 0, 0, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 0, 0, 0, 0, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 0, 0 }; createFileSuccessDispose (image1x1, PixelFormat24bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFF0000}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat24bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFFFFFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFFFFFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF }; verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage24bppBitmapInfoHeader () { BYTE image1x1[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 24, 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, 255, 0 }; BYTE image6x4[] = { 'B', 'M', 126, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 1, 0, 24, 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, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 0, 0, 0, 0, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 0, 0 }; BYTE image1x1NegativeHeight[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 255, 255, 255, 255, 1, 0, 24, 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, 255, 0 }; BYTE image6x4NegativeHeight[] = { 'B', 'M', 126, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 6, 0, 0, 0, 252, 255, 255, 255, 1, 0, 24, 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, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 0, 0, 0, 0, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 0, 0, 0, 0, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0 }; BYTE rle4Compression24bpp[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 24, 0, BI_RLE4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0 }; BYTE rle8Compression24bpp[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 24, 0, BI_RLE8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0 }; createFileSuccessDispose (image1x1, PixelFormat24bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFF0000}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat24bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFFFFFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFFFFFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF }; verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image1x1NegativeHeight, PixelFormat24bppRGB, 1, 1, bmpFlags, FALSE); verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4NegativeHeight, PixelFormat24bppRGB, 6, 4, bmpFlags, FALSE); verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); // FIXME: GDI+ converts RLE compressed 24bpp images to 32bppRGB. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat expectedRleFormat = PixelFormat32bppRGB; #else PixelFormat expectedRleFormat = PixelFormat24bppRGB; #endif createFileSuccessDispose (rle4Compression24bpp, expectedRleFormat, 1, 1, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (rle8Compression24bpp, expectedRleFormat, 1, 1, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); } static void test_validImage24bppBitmapV3Header () { BYTE image1x1[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x46, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x18, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xB9, 0xDA, 0xFF, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat24bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFFDAB9}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage24bppBitmapV4Header () { BYTE image1x1[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x7E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x7A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x6C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x18, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xB9, 0xDA, 0xFF, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat24bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFFDAB9}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage24bppBitmapV5Header () { BYTE image1x1[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x8A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x8A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x6C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x18, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV5HEADER --// /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xB9, 0xDA, 0xFF, 0x00 }; createFileSuccessDispose (image1x1, PixelFormat24bppRGB, 1, 1, bmpFlags, FALSE); // FIXME: match GDI+ behaviour. #if defined(USE_WINDOWS_GDIPLUS) ARGB image1x1Pixels[] = {0xFFFFDAB9}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); #endif GdipDisposeImage (image); } static void test_validImage32bppOS2Header () { BYTE image1x1[] = { 'B', 'M', 30, 0, 0, 0, 0, 0, 0, 0, 0x1A, 0, 0, 0, 12, 0, 0, 0, 1, 0, 1, 0, 1, 0, 32, 0, 0, 0, 255, 255 }; BYTE image6x4[] = { 'B', 'M', 122, 0, 0, 0, 0, 0, 0, 0, 0x1A, 0, 0, 0, 12, 0, 0, 0, 6, 0, 4, 0, 1, 0, 32, 0, 0, 0, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 127, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 255, 255, 127, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 127, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 255, 255, 127, 255, 0, 255, 0, 255 }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFF0000}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFF7FFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFF7FFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF }; verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage32bppBitmapInfoHeader () { BYTE image1x1[] = { 'B', 'M', 59, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 32, 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, 255, 255 }; BYTE image6x4[] = { 'B', 'M', 150, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 1, 0, 32, 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, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 127, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 255, 255, 127, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 127, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 255, 255, 127, 255, 0, 255, 0, 255 }; BYTE image6x4NegativeHeight[] = { 'B', 'M', 150, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 6, 0, 0, 0, 252, 255, 255, 255, 1, 0, 32, 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, 255, 0, 255, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 255, 255, 127, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 127, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 255, 255, 127, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 127 }; BYTE planesNotZero[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 4, 0, 32, 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, 255, 255 }; BYTE rle4Compression32bpp[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 32, 0, BI_RLE4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0 }; BYTE rle8Compression32bpp[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x36, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 32, 0, BI_RLE8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0 }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFF0000}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); ARGB image6x4Pixels[] = { 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFF7FFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFF00, 0xFF7FFFFF, 0xFF00FF00, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFFFFFF }; verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (image6x4NegativeHeight, PixelFormat32bppRGB, 6, 4, bmpFlags, FALSE); verifyPixels (image, image6x4Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (planesNotZero, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (rle4Compression32bpp, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (rle8Compression32bpp, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); } static void test_validImage32bppBitmapV3Header () { BYTE image1x1[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x46, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x38, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x20, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xB9, 0xDA, 0xFF, 0X7F }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFFDAB9}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage32bppBitmapV4Header () { BYTE image1x1[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x7E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x7A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x6C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x20, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xB9, 0xDA, 0xFF, 0X7F }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFFDAB9}; verifyPixels (image, image1x1Pixels); verifyNoPalette (image, 0); GdipDisposeImage (image); } static void test_validImage32bppBitmapV5Header () { BYTE image1x1[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x8A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x8A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x7C, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x20, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, /* Alpha Mask */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4HEADER --// /* bV4CSType */ 0x00, 0x00, 0x00, 0x00, /* bV4Endpoints */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bV4GammaRed */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaGreen */ 0x00, 0x00, 0x00, 0x00, /* bV4GammaBlue */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV5HEADER --// /* bV5Intent */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileData */ 0x00, 0x00, 0x00, 0x00, /* bV5ProfileSize */ 0x00, 0x00, 0x00, 0x00, /* bV5Reserved */ 0x00, 0x00, 0x00, 0x00, // -- Image Data --/ 0xB9, 0xDA, 0xFF, 0X7F }; createFileSuccessDispose (image1x1, PixelFormat32bppRGB, 1, 1, bmpFlags, FALSE); ARGB image1x1Pixels[] = {0xFFFFDAB9}; verifyPixels (image, image1x1Pixels); GdipDisposeImage (image); } static void test_validImage32bppBitfields () { #if defined(USE_WINDOWS_GDIPLUS) // Order: B, G, R BYTE bitmapInfoHeaderBitfieldsDefault[] = { 'B', 'M', 98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // Order: R, B, G BYTE bitmapInfoHeaderBitfieldsCustom[] = { 'B', 'M', 98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // Order: R, B, G BYTE bitmapV3HeaderBitfieldsZeroAlphaMask[] = { 'B', 'M', 98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 56, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0x00, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // Order: R, B, G BYTE bitmapV3HeaderBitfieldsNonZeroAlphaMask[] = { 'B', 'M', 98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 56, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0xFF, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // Order: R, B, G BYTE bitmapV4HeaderBitfields[] = { 'B', 'M', 154, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 108, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0xFF, // -- BITMAPV4 -- // 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, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // Order: R, B, G BYTE bitmapV5HeaderBitfields[] = { 'B', 'M', 154, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0x00, 0x00, 0x00, 124, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0xFF, // -- BITMAPV4 -- // 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, // -- BitmapV5 -- // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; BYTE bitmapInfoHeaderAllMasksZero[] = { 'B', 'M', 98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; BYTE bitmapV3HeaderAllMasksZero[] = { 'B', 'M', 98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 56, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0x00, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; BYTE bitmapV4HeaderAllMasksZero[] = { 'B', 'M', 154, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 108, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4 -- // 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, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; BYTE bitmapV5HeaderAllMasksZero[] = { 'B', 'M', 154, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0x00, 0x00, 0x00, 124, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // -- BITMAPV2 -- // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // -- BITMAPV3 -- // 0x00, 0x00, 0x00, 0x00, // -- BITMAPV4 -- // 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, // -- BitmapV5 -- // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ---- Bitmap Data ---- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; #endif // FIXME: libgdiplus can't decode these images. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccessDispose (bitmapInfoHeaderBitfieldsDefault, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); ARGB bitmapInfoHeaderBitfieldsDefaultPixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFFFFFFFF, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFFFFFFFF }; verifyPixels (image, bitmapInfoHeaderBitfieldsDefaultPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (bitmapInfoHeaderBitfieldsCustom, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); ARGB customBitfieldsPixels[] = { 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFFFFFF, 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFFFFFF }; verifyPixels (image, customBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (bitmapV3HeaderBitfieldsNonZeroAlphaMask, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); verifyPixels (image, customBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (bitmapV4HeaderBitfields, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); verifyPixels (image, customBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (bitmapV5HeaderBitfields, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); verifyPixels (image, customBitfieldsPixels); verifyNoPalette (image, 0); GdipDisposeImage (image); createFileSuccessDispose (bitmapInfoHeaderAllMasksZero, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (bitmapV3HeaderAllMasksZero, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (bitmapV4HeaderAllMasksZero, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); createFileSuccessDispose (bitmapV5HeaderAllMasksZero, PixelFormat32bppRGB, 4, 2, bmpFlags, FALSE); // Don't verify the pixels, as the pixel data changes every time the program is run // due to a bug in GDI+. GdipDisposeImage (image); #endif } static void test_valid () { BYTE nonZeroHorizontal[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x01, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; BYTE nonZeroVertical[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x01, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; BYTE nonZeroHorizontalNonZeroVertical[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x28, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x01, 0x00, 0x00, 0x00, /* Vertical */ 0x01, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; createFileSuccessDispose (nonZeroHorizontal, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); ARGB nonZeroHorizontalPixels[] = {0xFF00FF00}; ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00}; verifyPalette (image, 0, expectedPalette); verifyPixels (image, nonZeroHorizontalPixels); GdipDisposeImage (image); createFileSuccessDispose (nonZeroVertical, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE); verifyPixels (image, nonZeroHorizontalPixels); verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); createFileSuccessDispose (nonZeroHorizontalNonZeroVertical, PixelFormat1bppIndexed, 1, 1, bmpFlags | ImageFlagsHasRealDPI, FALSE); verifyPixels (image, nonZeroHorizontalPixels); verifyPalette (image, 0, expectedPalette); GdipDisposeImage (image); } static void test_invalidFileHeader () { BYTE shortSignature[] = {'B'}; BYTE noImageSize[] = {'B', 'M'}; BYTE shortImageSize[] = {'B', 'M', 5, 0, 0}; BYTE noReserved1[] = {'B', 'M', 6, 0, 0, 0}; BYTE shortReserved1[] = {'B', 'M', 7, 0, 0, 0, 0}; BYTE noReserved2[] = {'B', 'M', 8, 0, 0, 0, 0, 0}; BYTE shortReserved2[] = {'B', 'M', 9, 0, 0, 0, 0, 0, 0}; BYTE noOffset[] = {'B', 'M', 10, 0, 0, 0, 0, 0, 0, 0}; BYTE shortOffset[] = {'B', 'M', 13, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0}; createFile (shortSignature, OutOfMemory); createFile (noImageSize, OutOfMemory); createFile (shortImageSize, OutOfMemory); createFile (noReserved1, OutOfMemory); createFile (shortReserved1, OutOfMemory); createFile (noReserved2, OutOfMemory); createFile (shortReserved2, OutOfMemory); createFile (noOffset, OutOfMemory); createFile (shortOffset, OutOfMemory); } static void test_invalidHeader () { BYTE noHeader[] = {'B', 'M', 14, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0}; BYTE zeroHeaderSize[] = {'B', 'M', 18, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE newFormatNoWidth[] = {'B', 'M', 18, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0}; BYTE newFormatNoHeight[] = {'B', 'M', 22, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0}; BYTE os2FormatNoWidthHeight[] = {'B', 'M', 18, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 12, 0, 0, 0}; BYTE noColorPlanes[] = {'B', 'M', 26, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}; BYTE noBitsPerPixel[] = {'B', 'M', 28, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0}; BYTE noCompression[] = {'B', 'M', 30, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0}; BYTE noSize[] = {'B', 'M', 34, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0}; BYTE noHorizontalResolution[] = {'B', 'M', 38, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0}; BYTE noVerticalResolution[] = {'B', 'M', 42, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0}; BYTE noColors[] = {'B', 'M', 46, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE noImportantColors[] = {'B', 'M', 50, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE image2bpp[] = { 'B', 'M', 66, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, 255, 255, 255, 255, B8(00000000), 0, 0, 0 }; BYTE image16bppNoRedMask[] = { 'B', 'M', 54, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; BYTE image16bppShortRedMask[] = { 'B', 'M', 57, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }; BYTE image16bppNoGreenMask[] = { 'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0 }; BYTE image16bppShortGreenMask[] = { 'B', 'M', 61, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0 }; BYTE image16bppNoBlueMask[] = { 'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0, 0 }; BYTE image16bppShortBlueMask[] = { 'B', 'M', 65, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0, 0, 3, 0, 0 }; BYTE image16bppNoData[] = { 'B', 'M', 66, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0, 0, 0x1F, 0, 0, 0 }; BYTE bitfields32bppNoRedMask[] = { 'B', 'M', 54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; BYTE bitfields32bppShortRedMask[] = { 'B', 'M', 57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0 }; BYTE bitfields32bppNoBlueMask[] = { 'B', 'M', 58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0 }; BYTE bitfields32bppShortBlueMask[] = { 'B', 'M', 61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0 }; BYTE bitfields32bppNoGreenMask[] = { 'B', 'M', 62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0, 0 }; BYTE bitfields32bppShortGreenMask[] = { 'B', 'M', 65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0, 0, 0, 3, 0, 0 }; BYTE bitfields32bppNoImageData[] = { 'B', 'M', 66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 32, 0, BI_BITFIELDS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 224, 3, 0, 0, 0, 3, 0, 0, 0 }; createFile (noHeader, OutOfMemory); createFile (zeroHeaderSize, OutOfMemory); createFile (newFormatNoWidth, OutOfMemory); createFile (newFormatNoHeight, OutOfMemory); createFile (os2FormatNoWidthHeight, OutOfMemory); createFile (noColorPlanes, OutOfMemory); createFile (noBitsPerPixel, OutOfMemory); createFile (noCompression, OutOfMemory); createFile (noSize, OutOfMemory); createFile (noHorizontalResolution, OutOfMemory); createFile (noVerticalResolution, OutOfMemory); createFile (noColors, OutOfMemory); createFile (noImportantColors, OutOfMemory); createFile (image2bpp, OutOfMemory); createFile (image16bppNoRedMask, OutOfMemory); createFile (image16bppShortRedMask, OutOfMemory); createFile (image16bppNoGreenMask, OutOfMemory); createFile (image16bppShortGreenMask, OutOfMemory); createFile (image16bppNoBlueMask, OutOfMemory); createFile (image16bppShortBlueMask, OutOfMemory); createFile (image16bppNoData, OutOfMemory); createFile (bitfields32bppNoRedMask, OutOfMemory); createFile (bitfields32bppShortRedMask, OutOfMemory); createFile (bitfields32bppNoBlueMask, OutOfMemory); createFile (bitfields32bppShortBlueMask, OutOfMemory); createFile (bitfields32bppNoGreenMask, OutOfMemory); createFile (bitfields32bppShortGreenMask, OutOfMemory); createFile (bitfields32bppNoImageData, OutOfMemory); } static void test_invalidHeaderSize () { BYTE zeroHeaderSize[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x00, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; BYTE largeHeaderSize[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x42, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x3E, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0xFF, 0xFF, 0xFF, 0xFF, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; BYTE os22xHeader[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x5A, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x56, 0x00, 0x00, 0x00, // -- Os22xBitmapHeader /* Header Size */ 0x40, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, /* Units */ 0x00, 0x00, /* Reserved */ 0x00, 0x00, /* Recording */ 0x00, 0x00, /* Rendering */ 0x00, 0x00, /* Size1 */ 0x00, 0x00, 0x00, 0x00, /* Size2 */ 0x00, 0x00, 0x00, 0x00, /* ColorEncoding */ 0x00, 0x00, 0x00, 0x00, /* Identifier */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; BYTE v2Header[] = { // -- BITMAPCOREHEADER -- // /* Signature */ 0x42, 0x4D, /* File Size */ 0x4E, 0x00, 0x00, 0x00, /* Reserved */ 0x00, 0x00, 0x00, 0x00, /* Offset */ 0x4A, 0x00, 0x00, 0x00, // -- BITMAPINFOHEADER /* Header Size */ 0x34, 0x00, 0x00, 0x00, /* Width */ 0x01, 0x00, 0x00, 0x00, /* Height */ 0x01, 0x00, 0x00, 0x00, /* Planes */ 0x01, 0x00, /* Bit Count */ 0x01, 0x00, /* Compression */ 0x00, 0x00, 0x00, 0x00, /* Image Size */ 0x00, 0x00, 0x00, 0x00, /* Horizontal */ 0x00, 0x00, 0x00, 0x00, /* Vertical */ 0x00, 0x00, 0x00, 0x00, /* Colors Used */ 0x00, 0x00, 0x00, 0x00, /* Important Colors */ 0x00, 0x00, 0x00, 0x00, // -- BITMAPV2INFOHEADER -- // /* Red Mask */ 0x00, 0x00, 0x00, 0x00, /* Green Mask */ 0x00, 0x00, 0x00, 0x00, /* Blue Mask */ 0x00, 0x00, 0x00, 0x00, // -- Color Palette -- // 0xFF, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0xFF, // -- Image Data --/ 0x80, 0x00, 0x00, 0x00 }; createFile (zeroHeaderSize, OutOfMemory); createFile (largeHeaderSize, OutOfMemory); createFile (os22xHeader, OutOfMemory); createFile (v2Header, OutOfMemory); } static void test_invalidImageData () { BYTE noColorEntries[] = {'B', 'M', 54, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE notEnoughColorEntries[] = {'B', 'M', 58, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE noImageData[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0}; BYTE noImageDataBigSize[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0}; BYTE hasImageData4bpp[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 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, 255, 255, 255, 0, 128, 0, 0, 0}; BYTE hasImageData8bpp[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 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, 255, 255, 255, 0, 128, 0, 0, 0}; BYTE invalidBitsPerPixel[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 128, 0, 0, 0}; BYTE bitfieldsNon16Bpp[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 32, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 128, 0, 0, 0}; BYTE bitfields16Bpp[] = {'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 128, 0, 0, 0}; BYTE notPaddedTo4Bytes[] = { 'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, B8(10000000) }; BYTE missingNonFinalFinalLine[] = { 'B', 'M', 62, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 0x00, 0x00, 0x00, 0x00 }; BYTE missingFinalLine[] = { 'B', 'M', 66, 0, 0, 0, 0, 0, 0, 0, 0x3E, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; createFile (noColorEntries, OutOfMemory); createFile (notEnoughColorEntries, OutOfMemory); createFile (noImageData, OutOfMemory); createFile (noImageDataBigSize, OutOfMemory); createFile (hasImageData4bpp, OutOfMemory); createFile (hasImageData8bpp, OutOfMemory); createFile (invalidBitsPerPixel, OutOfMemory); createFile (bitfieldsNon16Bpp, OutOfMemory); createFile (bitfields16Bpp, OutOfMemory); createFile (notPaddedTo4Bytes, OutOfMemory); createFile (missingNonFinalFinalLine, OutOfMemory); createFile (missingFinalLine, OutOfMemory); } int main (int argc, char**argv) { STARTUP; test_validImage1bppOS2Header (); test_validImage1bppBitmapInfoHeader (); test_validImage1bppBitmapV3Header (); test_validImage1bppBitmapV4Header (); test_validImage1bppBitmapV5Header (); test_validImage4bppOS2Header (); test_validImage4bppBitmapInfoHeader (); test_validImage4bppBitmapV3Header (); test_validImage4bppBitmapV4Header (); test_validImage4bppBitmapV5Header (); test_validImage4bppRle4Compression (); test_validImage8bppOS2Header (); test_validImage8bppBitmapInfoHeader (); test_validImage8bppBitmapV3Header (); test_validImage8bppBitmapV4Header (); test_validImage8bppBitmapV5Header (); test_validImage8bppRle8Compression (); test_validImage16bppOS2Header (); test_validImage16bppBitmapInfoHeader (); test_validImage16bppBitmapV3Header (); test_validImage16bppBitmapV4Header (); test_validImage16bppBitmapV5Header (); test_validImage24bppOS2Header (); test_validImage24bppBitmapInfoHeader (); test_validImage24bppBitmapV3Header (); test_validImage24bppBitmapV4Header (); test_validImage24bppBitmapV5Header (); test_validImage32bppOS2Header (); test_validImage32bppBitmapInfoHeader (); test_validImage32bppBitmapV3Header (); test_validImage32bppBitmapV4Header (); test_validImage32bppBitmapV5Header (); test_validImage32bppBitfields (); test_invalidFileHeader (); test_invalidHeader (); test_invalidHeaderSize (); test_invalidImageData (); test_valid (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/teststringformat.c0000644000175000017500000007260313542674535022271 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void verifyStringFormat (GpStringFormat *format, INT expectedAttributes, StringTrimming expectedTrimming) { GpStatus status; INT flags; StringAlignment align; LANGID language; StringDigitSubstitute digitSubstitution; StringAlignment lineAlign; INT hotkeyPrefix; StringTrimming trimming; INT tabStopCount; REAL firstTabOffset; REAL tabStops[1]; INT measurableCharacterRangeCount; status = GdipGetStringFormatFlags (format, &flags); assertEqualInt (status, Ok); assertEqualInt (flags, expectedAttributes); status = GdipGetStringFormatAlign (format, &align); assertEqualInt (status,Ok); assertEqualInt (align, StringAlignmentNear); status = GdipGetStringFormatDigitSubstitution (format, &language, &digitSubstitution); assertEqualInt (status, Ok); assertEqualInt (language, 0); assertEqualInt (align, StringDigitSubstituteUser); status = GdipGetStringFormatLineAlign (format, &lineAlign); assertEqualInt (status, Ok); assertEqualInt (lineAlign, StringAlignmentNear); status = GdipGetStringFormatHotkeyPrefix (format, &hotkeyPrefix); assertEqualInt (status, Ok); assertEqualInt (hotkeyPrefix, HotkeyPrefixNone); status = GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (status, Ok); assertEqualInt (trimming, expectedTrimming); status = GdipGetStringFormatTabStopCount (format, &tabStopCount); assertEqualInt (status, Ok); assertEqualInt (tabStopCount, 0); status = GdipGetStringFormatTabStops (format, 0, &firstTabOffset, tabStops); assertEqualInt (status, Ok); assertEqualFloat (firstTabOffset, 0); status = GdipGetStringFormatMeasurableCharacterRangeCount (format, &measurableCharacterRangeCount); assertEqualInt (status, Ok); assertEqualInt (measurableCharacterRangeCount, 0); } static void test_createStringFormat () { GpStatus status; GpStringFormat *format; // Positive values. status = GdipCreateStringFormat (10, 11, &format); assertEqualInt (status, Ok); verifyStringFormat (format, 10, StringTrimmingCharacter); GdipDeleteStringFormat (format); // Zero values. status = GdipCreateStringFormat (0, 0, &format); assertEqualInt (status, Ok); verifyStringFormat (format, 0, StringTrimmingCharacter); GdipDeleteStringFormat (format); // Negative values. status = GdipCreateStringFormat (-1, -2, &format); assertEqualInt (status, Ok); verifyStringFormat (format, -1, StringTrimmingCharacter); GdipDeleteStringFormat (format); // Negative tests. status = GdipCreateStringFormat (10, 11, NULL); assertEqualInt (status, InvalidParameter); } static void test_getGenericDefault () { GpStatus status; GpStringFormat *format1; GpStringFormat *format2; StringAlignment lineAlign; // Should be a singleton. status = GdipStringFormatGetGenericDefault (&format1); assertEqualInt (status, Ok); assert (format1); verifyStringFormat (format1, 0, StringTrimmingCharacter); status = GdipStringFormatGetGenericDefault (&format2); assertEqualInt (status, Ok); assert (format2); verifyStringFormat (format2, 0, StringTrimmingCharacter); assert (format1 == format2); // Should not be deleted. status = GdipDeleteStringFormat (format2); assertEqualInt (status, Ok); status = GdipStringFormatGetGenericDefault (&format2); assertEqualInt (status, Ok); verifyStringFormat (format2, 0, StringTrimmingCharacter); assert (format1 == format2); // Should be mutable. status = GdipSetStringFormatLineAlign (format1, StringAlignmentFar); assertEqualInt (status, Ok); status = GdipSetStringFormatLineAlign (format1, StringAlignmentFar); assertEqualInt (status, Ok); status = GdipGetStringFormatLineAlign (format1, &lineAlign); assertEqualInt (status, Ok); assertEqualInt (lineAlign, StringAlignmentFar); // Set back to the default. status = GdipSetStringFormatLineAlign (format1, StringAlignmentNear); assertEqualInt (status, Ok); // Negative tests. status = GdipStringFormatGetGenericDefault (NULL); assertEqualInt (status, InvalidParameter); } static void test_getGenericTypographic () { GpStatus status; GpStringFormat *format1; GpStringFormat *format2; StringAlignment lineAlign; // Should be a singleton. status = GdipStringFormatGetGenericTypographic (&format1); assertEqualInt (status, Ok); verifyStringFormat (format1, StringFormatFlagsNoFitBlackBox | StringFormatFlagsLineLimit | StringFormatFlagsNoClip, StringTrimmingNone); status = GdipStringFormatGetGenericTypographic (&format2); assertEqualInt (status, Ok); verifyStringFormat (format2, StringFormatFlagsNoFitBlackBox | StringFormatFlagsLineLimit | StringFormatFlagsNoClip, StringTrimmingNone); assert (format1 == format2); // Should not be deleted. status = GdipDeleteStringFormat (format2); assertEqualInt (status, Ok); status = GdipStringFormatGetGenericTypographic (&format2); assertEqualInt (status, Ok); verifyStringFormat (format2, StringFormatFlagsNoFitBlackBox | StringFormatFlagsLineLimit | StringFormatFlagsNoClip, StringTrimmingNone); assert (format1 == format2); // Should be mutable. status = GdipSetStringFormatLineAlign (format1, StringAlignmentFar); assertEqualInt (status, Ok); status = GdipGetStringFormatLineAlign (format1, &lineAlign); assertEqualInt (status, Ok); assertEqualInt (lineAlign, StringAlignmentFar); // Set back to the default. status = GdipSetStringFormatLineAlign (format1, StringAlignmentNear); assertEqualInt (status, Ok); // Negative tests. status = GdipStringFormatGetGenericTypographic (NULL); assertEqualInt (status, InvalidParameter); } static void test_deleteStringFormat () { GpStatus status; GpStringFormat *format; GdipCreateStringFormat (10, 11, &format); status = GdipDeleteStringFormat (format); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteStringFormat (NULL); assertEqualInt (status, InvalidParameter); } static void test_cloneStringFormat () { GpStatus status; GpStringFormat *format; GpStringFormat *clonedFormat; GdipCreateStringFormat (10, 11, &format); status = GdipCloneStringFormat (format, &clonedFormat); assertEqualInt (status, Ok); verifyStringFormat (clonedFormat, 10, StringTrimmingCharacter); GdipDeleteStringFormat (clonedFormat); // Negative tests. status = GdipCloneStringFormat (NULL, &clonedFormat); assertEqualInt (status, InvalidParameter); status = GdipCloneStringFormat (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatAlign () { GpStatus status; GpStringFormat *format; StringAlignment align; GdipCreateStringFormat (10, 11, &format); // StringAlignmentCenter. status = GdipSetStringFormatAlign (format, StringAlignmentNear); assertEqualInt (status, Ok); GdipGetStringFormatAlign (format, &align); assertEqualInt (align, StringAlignmentNear); // Same. status = GdipSetStringFormatAlign (format, StringAlignmentNear); assertEqualInt (status, Ok); GdipGetStringFormatAlign (format, &align); assertEqualInt (align, StringAlignmentNear); // StringAlignmentCenter. status = GdipSetStringFormatAlign (format, StringAlignmentCenter); assertEqualInt (status, Ok); GdipGetStringFormatAlign (format, &align); assertEqualInt (align, StringAlignmentCenter); // StringAlignmentFar. status = GdipSetStringFormatAlign (format, StringAlignmentFar); assertEqualInt (status, Ok); GdipGetStringFormatAlign (format, &align); assertEqualInt (align, StringAlignmentFar); // Negative tests. status = GdipSetStringFormatAlign (NULL, StringAlignmentCenter); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatAlign (format, (StringAlignment)(StringAlignmentNear - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatAlign (format, (StringAlignment)(StringAlignmentFar + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatAlign () { GpStatus status; GpStringFormat *format; StringAlignment align; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatAlign (NULL, &align); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatAlign (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatLineAlign () { GpStatus status; GpStringFormat *format; StringAlignment lineAlign; GdipCreateStringFormat (10, 11, &format); // StringAlignmentNear. status = GdipSetStringFormatLineAlign (format, StringAlignmentNear); assertEqualInt (status, Ok); GdipGetStringFormatLineAlign (format, &lineAlign); assertEqualInt (lineAlign, StringAlignmentNear); // Same. status = GdipSetStringFormatLineAlign (format, StringAlignmentNear); assertEqualInt (status, Ok); GdipGetStringFormatLineAlign (format, &lineAlign); assertEqualInt (lineAlign, StringAlignmentNear); // StringAlignmentCenter. status = GdipSetStringFormatLineAlign (format, StringAlignmentCenter); assertEqualInt (status, Ok); GdipGetStringFormatLineAlign (format, &lineAlign); assertEqualInt (lineAlign, StringAlignmentCenter); // StringAlignmentFar. status = GdipSetStringFormatLineAlign (format, StringAlignmentFar); assertEqualInt (status, Ok); GdipGetStringFormatLineAlign (format, &lineAlign); assertEqualInt (lineAlign, StringAlignmentFar); // Negative tests. status = GdipSetStringFormatLineAlign (NULL, StringAlignmentCenter); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatLineAlign (format, (StringAlignment)(StringAlignmentNear - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatLineAlign (format, (StringAlignment)(StringAlignmentFar + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatLineAlign () { GpStatus status; GpStringFormat *format; StringAlignment lineAlign; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatLineAlign (NULL, &lineAlign); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatLineAlign (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatTrimming () { GpStatus status; GpStringFormat *format; StringTrimming trimming; GdipCreateStringFormat (10, 11, &format); // StringTrimmingNone status = GdipSetStringFormatTrimming (format, StringTrimmingNone); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingNone); // Same. status = GdipSetStringFormatTrimming (format, StringTrimmingNone); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingNone); // StringTrimmingEllipsisCharacter. status = GdipSetStringFormatTrimming (format, StringTrimmingCharacter); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingCharacter); // StringTrimmingWord. status = GdipSetStringFormatTrimming (format, StringTrimmingWord); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingWord); // StringTrimmingEllipsisCharacter. status = GdipSetStringFormatTrimming (format, StringTrimmingEllipsisCharacter); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingEllipsisCharacter); // StringTrimmingEllipsisWord. status = GdipSetStringFormatTrimming (format, StringTrimmingEllipsisWord); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingEllipsisWord); // StringTrimmingEllipsisPath. status = GdipSetStringFormatTrimming (format, StringTrimmingEllipsisPath); assertEqualInt (status, Ok); GdipGetStringFormatTrimming (format, &trimming); assertEqualInt (trimming, StringTrimmingEllipsisPath); // Negative tests. status = GdipSetStringFormatTrimming (NULL, StringTrimmingEllipsisCharacter); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatTrimming (format, (StringTrimming)(StringTrimmingNone - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatTrimming (format, (StringTrimming)(StringTrimmingEllipsisPath + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatTrimming () { GpStatus status; GpStringFormat *format; StringTrimming trimming; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatTrimming (NULL, &trimming); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTrimming (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatHotkeyPrefix () { GpStatus status; GpStringFormat *format; INT hotkeyPrefix; GdipCreateStringFormat (10, 11, &format); // HotkeyPrefixNone. status = GdipSetStringFormatHotkeyPrefix (format, HotkeyPrefixNone); assertEqualInt (status, Ok); GdipGetStringFormatHotkeyPrefix (format, &hotkeyPrefix); assertEqualInt (hotkeyPrefix, HotkeyPrefixNone); // Same. status = GdipSetStringFormatHotkeyPrefix (format, HotkeyPrefixNone); assertEqualInt (status, Ok); GdipGetStringFormatHotkeyPrefix (format, &hotkeyPrefix); assertEqualInt (hotkeyPrefix, HotkeyPrefixNone); // HotkeyPrefixShow. status = GdipSetStringFormatHotkeyPrefix (format, HotkeyPrefixShow); assertEqualInt (status, Ok); GdipGetStringFormatHotkeyPrefix (format, &hotkeyPrefix); assertEqualInt (hotkeyPrefix, HotkeyPrefixShow); // HotkeyPrefixHide. status = GdipSetStringFormatHotkeyPrefix (format, HotkeyPrefixHide); assertEqualInt (status, Ok); GdipGetStringFormatHotkeyPrefix (format, &hotkeyPrefix); assertEqualInt (hotkeyPrefix, HotkeyPrefixHide); // Negative tests. status = GdipSetStringFormatHotkeyPrefix (NULL, HotkeyPrefixNone); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatHotkeyPrefix (format, (HotkeyPrefix)(HotkeyPrefixNone - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatHotkeyPrefix (format, (HotkeyPrefix)(HotkeyPrefixHide + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatHotkeyPrefix () { GpStatus status; GpStringFormat *format; INT hotkeyPrefix; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatHotkeyPrefix (NULL, &hotkeyPrefix); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatHotkeyPrefix (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatTabStops () { GpStatus status; GpStringFormat *format; REAL firstTabOffset; REAL tabStops1[4] = {1, 0, 2, 3}; REAL tabStops2[4] = {3, 2, 0, 1}; REAL oneTabStop[1] = {0}; REAL negativeValueInTabStops[4] = {1, -1}; REAL formatTabStops[4]; GdipCreateStringFormat (10, 11, &format); // Count of 4. status = GdipSetStringFormatTabStops (format, 10, 4, tabStops1); assertEqualInt (status, Ok); GdipGetStringFormatTabStops (format, 4, &firstTabOffset, formatTabStops); assertEqualFloat (firstTabOffset, 10); assertEqualFloat (formatTabStops[0], 1); assertEqualFloat (formatTabStops[1], 0); assertEqualFloat (formatTabStops[2], 2); assertEqualFloat (formatTabStops[3], 3); // Count of 4 again. status = GdipSetStringFormatTabStops (format, FLT_MAX, 4, tabStops2); assertEqualInt (status, Ok); GdipGetStringFormatTabStops (format, 4, &firstTabOffset, formatTabStops); assertEqualFloat (firstTabOffset, FLT_MAX); assertEqualFloat (formatTabStops[0], 3); assertEqualFloat (formatTabStops[1], 2); assertEqualFloat (formatTabStops[2], 0); assertEqualFloat (formatTabStops[3], 1); // Count of 1. status = GdipSetStringFormatTabStops (format, 0, 1, oneTabStop); assertEqualInt (status, Ok); GdipGetStringFormatTabStops (format, 1, &firstTabOffset, formatTabStops); assertEqualFloat (firstTabOffset, 0); assertEqualFloat (formatTabStops[0], 0); // Count of 0. status = GdipSetStringFormatTabStops (format, 10, 0, oneTabStop); assertEqualInt (status, Ok); GdipGetStringFormatTabStops (format, 1, &firstTabOffset, formatTabStops); assertEqualFloat (firstTabOffset, 0); assertEqualFloat (formatTabStops[0], 0); // Count of -1. status = GdipSetStringFormatTabStops (format, 10, -1, oneTabStop); assertEqualInt (status, Ok); GdipGetStringFormatTabStops (format, 1, &firstTabOffset, formatTabStops); assertEqualFloat (firstTabOffset, 0); assertEqualFloat (formatTabStops[0], 0); // Count of 0, invalid first tab offset. status = GdipSetStringFormatTabStops (format, -1, 0, oneTabStop); assertEqualInt (status, Ok); GdipGetStringFormatTabStops (format, 1, &firstTabOffset, formatTabStops); assertEqualFloat (firstTabOffset, 0); assertEqualFloat (formatTabStops[0], 0); // Negative tests, status = GdipSetStringFormatTabStops (NULL, 10, -1, oneTabStop); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatTabStops (format, 10, -1, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatTabStops (format, -1, 10, oneTabStop); assertEqualInt (status, NotImplemented); // Negative value in tab stops. formatTabStops[0] = 10; status = GdipSetStringFormatTabStops (format, 40, 4, negativeValueInTabStops); assertEqualInt (status, NotImplemented); status = GdipGetStringFormatTabStops (format, 4, &firstTabOffset, formatTabStops); assertEqualInt (status, Ok); assertEqualFloat (firstTabOffset, 0); assertEqualFloat (formatTabStops[0], 0); GdipDeleteStringFormat (format); } static void test_getStringFormatTabStops () { GpStatus status; GpStringFormat *format; REAL firstTabOffset = 10; REAL tabStops[4] = {1, 2, 3, 4}; REAL formatTabStops[5] = {-1, -2, -3, -4, -5}; GdipCreateStringFormat (10, 11, &format); // Count of 0 - still overwrites the firstTabOffset value. status = GdipGetStringFormatTabStops (format, 0, &firstTabOffset, formatTabStops); assertEqualInt (status, Ok); assertEqualFloat (firstTabOffset, 0); // Count less than the number of tab stops. GdipSetStringFormatTabStops (format, 10, 4, tabStops); status = GdipGetStringFormatTabStops (format, 2, &firstTabOffset, formatTabStops); assertEqualInt (status, Ok); assertEqualFloat (firstTabOffset, 10); assertEqualFloat (formatTabStops[0], 1); assertEqualFloat (formatTabStops[1], 2); assertEqualFloat (formatTabStops[2], -3); assertEqualFloat (formatTabStops[3], -4); assertEqualFloat (formatTabStops[4], -5); // Count greater than the number of tab stops. GdipSetStringFormatTabStops (format, 10, 4, tabStops); status = GdipGetStringFormatTabStops (format, 5, &firstTabOffset, formatTabStops); assertEqualInt (status, Ok); assertEqualFloat (firstTabOffset, 10); assertEqualFloat (formatTabStops[0], 1); assertEqualFloat (formatTabStops[1], 2); assertEqualFloat (formatTabStops[2], 3); assertEqualFloat (formatTabStops[3], 4); assertEqualFloat (formatTabStops[4], -5); // Negative tests, status = GdipGetStringFormatTabStops (NULL, 0, &firstTabOffset, formatTabStops); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTabStops (NULL, -1, &firstTabOffset, formatTabStops); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTabStops (format, 0, NULL, formatTabStops); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTabStops (format, -1, NULL, formatTabStops); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTabStops (format, 0, &firstTabOffset, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTabStops (format, -1, &firstTabOffset, NULL); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetStringFormatTabStops (format, -1, &firstTabOffset, formatTabStops); assertEqualInt (status, InvalidParameter); #endif GdipDeleteStringFormat (format); } static void test_getStringFormatTabStopCount () { GpStatus status; GpStringFormat *format; INT tabStopCount; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatTabStopCount (NULL, &tabStopCount); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatTabStopCount (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatDigitSubstitution () { GpStatus status; GpStringFormat *format; LANGID language; StringDigitSubstitute substitute; GdipCreateStringFormat (10, 11, &format); // StringDigitSubstituteUser. status = GdipSetStringFormatDigitSubstitution (format, 10, StringDigitSubstituteUser); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 10); assertEqualInt (substitute, StringDigitSubstituteUser); // Same. status = GdipSetStringFormatDigitSubstitution (format, 10, StringDigitSubstituteUser); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 10); assertEqualInt (substitute, StringDigitSubstituteUser); // Different language, same substitute. status = GdipSetStringFormatDigitSubstitution (format, 12, StringDigitSubstituteUser); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 12); assertEqualInt (substitute, StringDigitSubstituteUser); // Same language, different substitute. status = GdipSetStringFormatDigitSubstitution (format, 12, StringDigitSubstituteNone); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 12); assertEqualInt (substitute, StringDigitSubstituteNone); // StringDigitSubstituteNone. status = GdipSetStringFormatDigitSubstitution (format, 10, StringDigitSubstituteNone); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 10); assertEqualInt (substitute, StringDigitSubstituteNone); // StringDigitSubstituteNational. status = GdipSetStringFormatDigitSubstitution (format, 10, StringDigitSubstituteNational); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 10); assertEqualInt (substitute, StringDigitSubstituteNational); // StringDigitSubstituteTraditional. status = GdipSetStringFormatDigitSubstitution (format, 10, StringDigitSubstituteTraditional); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 10); assertEqualInt (substitute, StringDigitSubstituteTraditional); // Invalid value - negative. status = GdipSetStringFormatDigitSubstitution (format, 0, (StringDigitSubstitute)(StringDigitSubstituteUser - 1)); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 0); assertEqualInt (substitute, (StringDigitSubstitute)(StringDigitSubstituteUser - 1)); // Invalid value - positive. status = GdipSetStringFormatDigitSubstitution (format, 0, (StringDigitSubstitute)(StringDigitSubstituteTraditional + 1)); assertEqualInt (status, Ok); GdipGetStringFormatDigitSubstitution (format, &language, &substitute); assertEqualInt (language, 0); assertEqualInt (substitute, (StringDigitSubstitute)(StringDigitSubstituteTraditional + 1)); // Negative tests. status = GdipSetStringFormatDigitSubstitution (NULL, 0, StringDigitSubstituteNational); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatDigitSubstitution () { GpStatus status; GpStringFormat *format; LANGID language; StringDigitSubstitute substitute; GdipCreateStringFormat (10, 11, &format); // Language null. status = GdipGetStringFormatDigitSubstitution (format, &language, NULL); assertEqualInt (status, Ok); assertEqualInt (language, 0); // Substitution null. status = GdipGetStringFormatDigitSubstitution (format, NULL, &substitute); assertEqualInt (status, Ok); assertEqualInt (substitute, StringDigitSubstituteUser); // Both null. status = GdipGetStringFormatDigitSubstitution (format, NULL, NULL); assertEqualInt (status, Ok); // Negative tests. status = GdipGetStringFormatDigitSubstitution (NULL, &language, &substitute); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatFlags () { GpStatus status; GpStringFormat *format; INT flags; GdipCreateStringFormat (10, 11, &format); // Custom flags. status = GdipSetStringFormatFlags (format, 1234); assertEqualInt (status, Ok); GdipGetStringFormatFlags (format, &flags); assertEqualInt (flags, 1234); // Same. status = GdipSetStringFormatFlags (format, 1234); assertEqualInt (status, Ok); GdipGetStringFormatFlags (format, &flags); assertEqualInt (flags, 1234); // Zero. status = GdipSetStringFormatFlags (format, 0); assertEqualInt (status, Ok); GdipGetStringFormatFlags (format, &flags); assertEqualInt (flags, 0); // Negative. status = GdipSetStringFormatFlags (format, -1234); assertEqualInt (status, Ok); GdipGetStringFormatFlags (format, &flags); assertEqualInt (flags, -1234); // Negative tests. status = GdipSetStringFormatFlags (NULL, 1234); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatFlags () { GpStatus status; GpStringFormat *format; INT flags; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatFlags (NULL, &flags); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatFlags (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_getStringFormatMeasurableCharacterRangeCount () { GpStatus status; GpStringFormat *format; INT measurableCharacterRangeCount; GdipCreateStringFormat (10, 11, &format); // Negative tests. status = GdipGetStringFormatMeasurableCharacterRangeCount (NULL, &measurableCharacterRangeCount); assertEqualInt (status, InvalidParameter); status = GdipGetStringFormatMeasurableCharacterRangeCount (format, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteStringFormat (format); } static void test_setStringFormatMeasurableCharacterRanges () { GpStatus status; GpStringFormat *format; CharacterRange ranges[32]; INT measurableCharacterRangeCount; GdipCreateStringFormat (10, 11, &format); // Count of 1. status = GdipSetStringFormatMeasurableCharacterRanges (format, 1, ranges); assertEqualInt (status, Ok); GdipGetStringFormatMeasurableCharacterRangeCount (format, &measurableCharacterRangeCount); assertEqualInt (measurableCharacterRangeCount, 1); // Count of 1 again. status = GdipSetStringFormatMeasurableCharacterRanges (format, 1, ranges); assertEqualInt (status, Ok); GdipGetStringFormatMeasurableCharacterRangeCount (format, &measurableCharacterRangeCount); assertEqualInt (measurableCharacterRangeCount, 1); // Count of 0. GdipSetStringFormatMeasurableCharacterRanges (format, 3, ranges); status = GdipSetStringFormatMeasurableCharacterRanges (format, 0, ranges); assertEqualInt (status, Ok); GdipGetStringFormatMeasurableCharacterRangeCount (format, &measurableCharacterRangeCount); assertEqualInt (measurableCharacterRangeCount, 0); // Count of -1. GdipSetStringFormatMeasurableCharacterRanges (format, 3, ranges); status = GdipSetStringFormatMeasurableCharacterRanges (format, -1, ranges); assertEqualInt (status, Ok); GdipGetStringFormatMeasurableCharacterRangeCount (format, &measurableCharacterRangeCount); assertEqualInt (measurableCharacterRangeCount, 0); // Count of 32. status = GdipSetStringFormatMeasurableCharacterRanges (format, 32, ranges); assertEqualInt (status, Ok); GdipGetStringFormatMeasurableCharacterRangeCount (format, &measurableCharacterRangeCount); assertEqualInt (measurableCharacterRangeCount, 32); // Negative tests. status = GdipSetStringFormatMeasurableCharacterRanges (NULL, 0, ranges); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatMeasurableCharacterRanges (format, 0, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetStringFormatMeasurableCharacterRanges (format, 33, ranges); assertEqualInt (status, ValueOverflow); GdipDeleteStringFormat (format); } int main (int argc, char**argv) { STARTUP; test_createStringFormat (); test_getGenericDefault (); test_getGenericTypographic (); test_deleteStringFormat (); test_cloneStringFormat (); test_setStringFormatAlign (); test_getStringFormatAlign (); test_setStringFormatLineAlign (); test_getStringFormatLineAlign (); test_setStringFormatTrimming (); test_getStringFormatTrimming (); test_setStringFormatHotkeyPrefix (); test_getStringFormatHotkeyPrefix (); test_setStringFormatTabStops (); test_getStringFormatTabStops (); test_getStringFormatTabStopCount (); test_setStringFormatDigitSubstitution (); test_getStringFormatDigitSubstitution (); test_setStringFormatFlags (); test_getStringFormatFlags (); test_getStringFormatMeasurableCharacterRangeCount (); test_setStringFormatMeasurableCharacterRanges (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testgifcodec.c0000644000175000017500000004111013542672033021271 0ustar directhexdirecthex#ifdef _WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include "testhelpers.h" static const char *file = "temp_asset.gif"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'g', 'i', 'f', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccess(buffer, expectedWidth, expectedHeight) \ { \ createFile(buffer, Ok); \ verifyBitmap (image, gifRawFormat, PixelFormat8bppIndexed, 3, 5, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 0, TRUE); \ GdipDisposeImage (image); \ } static void test_validData () { GpImage *image; BYTE localColorTable89[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE globalColorTable89[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 0, 0, 0, 255, 255, 255, ',', 0, 0, 0, 0, 3, 0, 5, 0, 0, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE localAndGlobalColorTable89[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 0, 0, 0, 255, 255, 255, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 255, 255, 255, 0, 0, 0, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE localColorTable87[] = {'G', 'I', 'F', '8', '7', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE globalColorTable87[] = {'G', 'I', 'F', '8', '7', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 0, 0, 0, 255, 255, 255, ',', 0, 0, 0, 0, 3, 0, 5, 0, 0, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE localAndGlobalColorTable87[] = {'G', 'I', 'F', '8', '7', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 0, 0, 0, 255, 255, 255, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 255, 255, 255, 0, 0, 0, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE extraData[] = {'G', 'I', 'F', '8', '7', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 0, 0, 0, 255, 255, 255, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 255, 255, 255, 0, 0, 0, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';', ';'}; BYTE noColorTables[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, 0, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE emptyExtensionBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE unknownExtensionBlock87[] = {'G', 'I', 'F', '8', '7', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 1, 2, 3, 4, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE unknownExtensionBlock89[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 1, 2, 3, 4, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE graphicsControlBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xF9, 0x04, 0, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; #if defined(USE_WINDOWS_GDIPLUS) BYTE graphicsControlBlockMissingTerminator[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xF9, 0x04, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; #endif BYTE severalGraphicsControlBlocks[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xF9, 0x04, 0, 0, 0, 0, 0, '!', 0xF9, 0x04, 0, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE misplacedGraphicsControlBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, '!', 0xF9, 0x04, B8(11111111), 0, 0, 0, 0, ';'}; BYTE plainTextControlBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0x01, 0x0C, 0, 0, 0, 0, 3, 0, 5, 0, 1, 1, 0, 1, 2, 'H', 'I', 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE invalidTextControlBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0x01, 0x0C, 200, 0, 200, 0, 100, 0, 100, 0, 255, 255, 40, 40, 2, 'H', 'I', 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE applicationTextControlBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xFF, 0x0B, '1', '2', '3', '4', '5', '6', '7', '8', 1, 2, 3, 2, 'H', 'I', 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE commentControlBlock[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xFE, 2, 'H', 'I', 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; createFileSuccess (localColorTable89, 3, 5); createFileSuccess (globalColorTable89, 3, 5); createFileSuccess (localAndGlobalColorTable89, 3, 5); createFileSuccess (localColorTable87, 3, 5); createFileSuccess (globalColorTable87, 3, 5); createFileSuccess (localAndGlobalColorTable87, 3, 5); createFileSuccess (extraData, 3, 5); createFileSuccess (noColorTables, 3, 5); createFileSuccess (emptyExtensionBlock, 3, 5); createFileSuccess (unknownExtensionBlock87, 3, 5); createFileSuccess (unknownExtensionBlock89, 3, 5); createFileSuccess (graphicsControlBlock, 3, 5); // FIXME: it appears that GDI+ allows a graphics control extension block without a // terminating 0 byte. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (graphicsControlBlockMissingTerminator, 3, 5); #endif createFileSuccess (severalGraphicsControlBlocks, 3, 5); createFileSuccess (misplacedGraphicsControlBlock, 3, 5); createFileSuccess (plainTextControlBlock, 3, 5); createFileSuccess (invalidTextControlBlock, 3, 5); createFileSuccess (applicationTextControlBlock, 3, 5); createFileSuccess (commentControlBlock, 3, 5); } static void test_invalidHeader () { BYTE noScreenWidth87[] = {'G', 'I', 'F', '8', '7', 'a'}; BYTE noScreenWidth89[] = {'G', 'I', 'F', '8', '9', 'a'}; BYTE shortScreenWidth[] = {'G', 'I', 'F', '8', '9', 'a', 3}; BYTE noScreenHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0}; BYTE shortScreenHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5}; BYTE noColorTableFlags[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0}; BYTE noBackgroundColor[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0}; BYTE noPixelAspectRatio[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0}; BYTE noGlobalColorTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, B8(10000000), 0, 0}; BYTE shortGlobalColorTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 255}; BYTE smallGlobalColorTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 255, 255, 255}; BYTE noRecords[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0}; BYTE unknownChunk[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '_'}; createFile (noScreenWidth87, OutOfMemory); createFile (noScreenWidth89, OutOfMemory); createFile (shortScreenWidth, OutOfMemory); createFile (noScreenHeight, OutOfMemory); createFile (shortScreenHeight, OutOfMemory); createFile (noColorTableFlags, OutOfMemory); createFile (noBackgroundColor, OutOfMemory); createFile (noPixelAspectRatio, OutOfMemory); createFile (noGlobalColorTable, OutOfMemory); createFile (shortGlobalColorTable, OutOfMemory); createFile (smallGlobalColorTable, OutOfMemory); createFile (noRecords, OutOfMemory); createFile (unknownChunk, OutOfMemory); } static void test_invalidImageRecord () { BYTE noImageLeft[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ','}; BYTE shortImageLeft[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0}; BYTE noImageTop[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0}; BYTE shortImageTop[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0}; BYTE noImageWidth[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0}; BYTE shortImageWidth[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3}; BYTE noImageHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0}; BYTE shortImageHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5}; BYTE noImagePacked[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0}; BYTE noLocalColorTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000)}; BYTE shortLocalColorTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0}; BYTE smallLocalColorTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0}; BYTE noCodeSizeWithTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255}; BYTE noCodeSizeNoTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, 0}; BYTE noData[] = {'G', 'I', 'F', '8', '7', 'a', 3, 0, 5, 0, B8(10000000), 0, 0, 0, 0, 0, 255, 255, 255, ';'}; BYTE noColorTables[] = {'G', 'I', 'F', '8', '9', 'a', 10, 0, 11, 0, 0, 0, 1, ';'}; #if !defined(USE_WINDOWS_GDIPLUS) BYTE noImageDataWithTable[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0}; BYTE noCompressedData[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06}; BYTE notEnoughImageData[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84}; BYTE noImageDataTerminator[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, }; BYTE noTerminator[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00}; BYTE invalidCompression[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, ';'}; #endif BYTE zeroHeaderWidth[] = {'G', 'I', 'F', '8', '9', 'a', 0, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE zeroHeaderHeight[] = {'G', 'I', 'F', '8', '9', 'a', 0, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; #if !defined(USE_WINDOWS_GDIPLUS) BYTE invalidImageLeft[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 3, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE invalidImageTop[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 3, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; #endif BYTE zeroImageWidth[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 0, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE zeroImageHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 0, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; #if !defined(USE_WINDOWS_GDIPLUS) BYTE invalidImageWidth[] = {'G', 'I', 'F', '8', '9', 'a', 2, 0, 5, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE invalidImageHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 4, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE invalidImageLeftWidth[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 1, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; BYTE invalidImageTopHeight[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, ',', 0, 0, 1, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; #endif createFile (noImageLeft, OutOfMemory); createFile (shortImageLeft, OutOfMemory); createFile (noImageTop, OutOfMemory); createFile (shortImageTop, OutOfMemory); createFile (noImageWidth, OutOfMemory); createFile (shortImageWidth, OutOfMemory); createFile (noImageHeight, OutOfMemory); createFile (shortImageHeight, OutOfMemory); createFile (noImagePacked, OutOfMemory); createFile (noLocalColorTable, OutOfMemory); createFile (shortLocalColorTable, OutOfMemory); createFile (smallLocalColorTable, OutOfMemory); createFile (noCodeSizeWithTable, OutOfMemory); createFile (noCodeSizeNoTable, OutOfMemory); createFile (noData, OutOfMemory); createFile (noColorTables, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) createFile (noImageDataWithTable, OutOfMemory); createFile (noImageDataTerminator, OutOfMemory); createFile (noCompressedData, OutOfMemory); createFile (notEnoughImageData, OutOfMemory); createFile (noTerminator, OutOfMemory); createFile (invalidCompression, OutOfMemory); #endif createFile (zeroHeaderWidth, OutOfMemory); createFile (zeroHeaderHeight, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) createFile (invalidImageLeft, OutOfMemory); createFile (invalidImageTop, OutOfMemory); #endif createFile (zeroImageWidth, OutOfMemory); createFile (zeroImageHeight, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) createFile (invalidImageWidth, OutOfMemory); createFile (invalidImageHeight, OutOfMemory); createFile (invalidImageLeftWidth, OutOfMemory); createFile (invalidImageTopHeight, OutOfMemory); #endif } static void test_invalidExtensionRecord () { BYTE noExtensionLabel[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!'}; BYTE noExtensionSize[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xF9}; BYTE noExtensionContent[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xF9, 1, 0, ';'}; BYTE multipleGraphicsControlBlocks[] = {'G', 'I', 'F', '8', '9', 'a', 3, 0, 5, 0, 0, 0, 0, '!', 0xF9, 0x04, 0, 0, 0, 0, 0x04, 0, 0, 0, 0, 0, ',', 0, 0, 0, 0, 3, 0, 5, 0, B8(10000000), 0, 0, 0, 255, 255, 255, 0x02, 0x06, 0x84, 0x03, 0x81, 0x9a, 0x06, 0x05, 0x00, ';'}; createFile (noExtensionLabel, OutOfMemory); createFile (noExtensionSize, OutOfMemory); createFile (noExtensionContent, OutOfMemory); createFile (multipleGraphicsControlBlocks, OutOfMemory); } int main (int argc, char**argv) { STARTUP; test_validData (); test_invalidHeader (); test_invalidImageRecord (); test_invalidExtensionRecord (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testpng.c0000644000175000017500000000670513542672033020325 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static int status_counter = 0; #define CHECK_STATUS(x) do { if (status != Ok) { printf ("status[%d] == %d!\n", status_counter++, status); if(x) { exit(-1); } } else { printf ("status[%d] == Ok\n", status_counter++); } } while (0) #define CHECK_ASSERT(x) do { if (!(x)) { printf ("check %s at %s:%d failed\n", #x, __FILE__, __LINE__); exit(-1); } else { printf("check %s at %s:%d passed\n", #x, __FILE__, __LINE__); } } while (0) CLSID png_clsid = { 0x557cf406, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; int main (int argc, char **argv) { GpImage *img; WCHAR *unis; GpBitmap *bitmap; GpStatus status; int original_palette_size; int reloaded_palette_size; ColorPalette *original_palette; ColorPalette *reloaded_palette; PixelFormat pixel_format; ARGB color; STARTUP; // PNG resave should preserve the palette transparency. Let's test it // by loading a PNG file and its palette, then resaving it and loading // it again for comparison. unis = createWchar ("test-trns.png"); status = GdipLoadImageFromFile (unis, &img); CHECK_STATUS(1); freeWchar (unis); status = GdipGetImagePaletteSize (img, &original_palette_size); CHECK_STATUS(1); CHECK_ASSERT(original_palette_size > 0); original_palette = (ColorPalette *) malloc (original_palette_size); GdipGetImagePalette (img, original_palette, original_palette_size); CHECK_STATUS(1); unis = createWchar ("test-trns-resave.png"); status = GdipSaveImageToFile (img, unis, &png_clsid, NULL); CHECK_STATUS(1); GdipDisposeImage (img); status = GdipLoadImageFromFile (unis, &img); CHECK_STATUS(1); freeWchar (unis); status = GdipGetImagePaletteSize (img, &reloaded_palette_size); CHECK_STATUS(1); CHECK_ASSERT(reloaded_palette_size > 0); CHECK_ASSERT(reloaded_palette_size == original_palette_size); reloaded_palette = (ColorPalette *) malloc (reloaded_palette_size); GdipGetImagePalette (img, reloaded_palette, reloaded_palette_size); CHECK_STATUS(1); CHECK_ASSERT(memcmp (original_palette, reloaded_palette, original_palette_size) == 0); GdipDisposeImage (img); img = NULL; #if defined(_WIN32) _unlink ("test-trns-resave.png"); #else unlink ("test-trns-resave.png"); #endif free (original_palette); free (reloaded_palette); // Test grayscale image with alpha channel. The image should be converted // into 32-bit ARGB format and the alpha channel should be preserved. unis = createWchar ("test-gsa.png"); status = GdipCreateBitmapFromFile (unis, &bitmap); CHECK_STATUS(1); freeWchar (unis); status = GdipGetImagePixelFormat (bitmap, &pixel_format); CHECK_STATUS(1); CHECK_ASSERT(pixel_format == PixelFormat32bppARGB); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); CHECK_STATUS(1); CHECK_ASSERT(color == 0xffffff); status = GdipBitmapGetPixel (bitmap, 1, 7, &color); CHECK_STATUS(1); CHECK_ASSERT(color == 0xe8b3b3b3); GdipDisposeImage (bitmap); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testtexturebrush.c0000644000175000017500000021513113542674535022311 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" const WCHAR bitmapFile[] = {'t', 'e', 's', 't', '.', 'b', 'm', 'p', 0}; const WCHAR wmfFile[] = {'t', 'e', 's', 't', '.', 'w', 'm', 'f', 0}; const WCHAR emfFile[] = {'t', 'e', 's', 't', '.', 'e', 'm', 'f', 0}; static void verifyTexture (GpTexture *brush, GpWrapMode expectedWrapMode, REAL expectedBrushWidth, REAL expectedBrushHeight) { assert (brush && "Expected the brush to be initialized."); GpStatus status; GpBrushType brushType; GpWrapMode wrapMode; GpImage *brushImage; REAL brushWidth; REAL brushHeight; GpMatrix *brushTransform; GdipCreateMatrix (&brushTransform); status = GdipGetBrushType (brush, &brushType); assertEqualInt (brushType, BrushTypeTextureFill); status = GdipGetTextureWrapMode (brush, &wrapMode); assertEqualInt (status, Ok); assertEqualInt (wrapMode, expectedWrapMode); status = GdipGetTextureImage (brush, &brushImage); assertEqualInt (status, Ok); GdipGetImageDimension (brushImage, &brushWidth, &brushHeight); assertEqualFloat (brushWidth, expectedBrushWidth); assertEqualFloat (brushHeight, expectedBrushHeight); status = GdipGetTextureTransform (brush, brushTransform); assertEqualInt (status, Ok); verifyMatrix (brushTransform, 1, 0, 0, 1, 0, 0); GdipDisposeImage (brushImage); GdipDeleteMatrix (brushTransform); } static void test_clone () { GpStatus status; GpTexture *brush; GpBrushType brushType; GpBrush *clone; GpImage *image1; GpImage *image2; REAL brushWidth; REAL brushHeight; GpWrapMode wrapMode; GdipLoadImageFromFile (bitmapFile, &image1); GdipCreateTexture (image1, WrapModeTile, &brush); status = GdipCloneBrush ((GpBrush *) brush, &clone); assertEqualInt (status, Ok); assert (clone && brush != clone); GdipGetBrushType (clone, &brushType); assertEqualInt (brushType, BrushTypeTextureFill); GdipGetTextureImage ((GpTexture *) clone, &image2); GdipGetImageDimension (image2, &brushWidth, &brushHeight); assertEqualFloat (brushWidth, 100); assertEqualFloat (brushHeight, 68); GdipGetTextureWrapMode ((GpTexture *) clone, &wrapMode); assertEqualInt (wrapMode, WrapModeTile); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteBrush (clone); GdipDisposeImage (image1); GdipDisposeImage (image2); } static void test_delete () { GpStatus status; GpTexture *brush; GpImage *image; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); status = GdipDeleteBrush ((GpBrush *) brush); assertEqualInt (status, Ok); GdipDisposeImage (image); } static void test_createTexture () { GpStatus status; GpImage *bitmapImage; GpImage *wmfImage; GpImage *emfImage; GpTexture *brush; GdipLoadImageFromFile (bitmapFile, &bitmapImage); GdipLoadImageFromFile (wmfFile, &wmfImage); GdipLoadImageFromFile (emfFile, &emfImage); // Bitmap image - WrapModeTile. status = GdipCreateTexture (bitmapImage, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipX. status = GdipCreateTexture (bitmapImage, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipY. status = GdipCreateTexture (bitmapImage, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipXY. status = GdipCreateTexture (bitmapImage, WrapModeTileFlipXY, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeClamp. status = GdipCreateTexture (bitmapImage, WrapModeClamp, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTile. status = GdipCreateTexture (wmfImage, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipX. status = GdipCreateTexture (wmfImage, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipY. status = GdipCreateTexture (wmfImage, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipXY. status = GdipCreateTexture (wmfImage, WrapModeTileFlipXY, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeClamp. status = GdipCreateTexture (wmfImage, WrapModeClamp, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTile. status = GdipCreateTexture (emfImage, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipX. status = GdipCreateTexture (emfImage, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipY. status = GdipCreateTexture (emfImage, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipXY. status = GdipCreateTexture (emfImage, WrapModeTileFlipXY, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeClamp. status = GdipCreateTexture (emfImage, WrapModeClamp, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpTexture *) 0xCC; status = GdipCreateTexture (NULL, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (NULL, (GpWrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (bitmapImage, (GpWrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (wmfImage, (GpWrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (emfImage, (GpWrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (bitmapImage, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (wmfImage, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture (emfImage, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); GdipDisposeImage (bitmapImage); GdipDisposeImage (wmfImage); GdipDisposeImage (emfImage); } static void test_createTexture2 () { GpStatus status; GpImage *bitmapImage; GpImage *wmfImage; GpImage *emfImage; GpTexture *brush; GdipLoadImageFromFile (bitmapFile, &bitmapImage); GdipLoadImageFromFile (wmfFile, &wmfImage); GdipLoadImageFromFile (emfFile, &emfImage); // Bitmap image - WrapModeTile. status = GdipCreateTexture2 (bitmapImage, WrapModeTile, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipX. status = GdipCreateTexture2 (bitmapImage, WrapModeTileFlipX, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipY. status = GdipCreateTexture2 (bitmapImage, WrapModeTileFlipY, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipXY. status = GdipCreateTexture2 (bitmapImage, WrapModeTileFlipXY, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - clamp. status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 5, 6, 7, 8, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 7, 8); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTile, non zero. status = GdipCreateTexture2 (wmfImage, WrapModeTile, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipX, non zero. status = GdipCreateTexture2 (wmfImage, WrapModeTileFlipX, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipY, non zero. status = GdipCreateTexture2 (wmfImage, WrapModeTileFlipY, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipXY, non zero. status = GdipCreateTexture2 (wmfImage, WrapModeTileFlipXY, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - clamp, non zero. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, 1, 1, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - negative x and y. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - large x and y. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero width. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero height. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative width. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative height. status = GdipCreateTexture2 (wmfImage, WrapModeClamp, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTile, non zero. status = GdipCreateTexture2 (emfImage, WrapModeTile, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipX, non zero. status = GdipCreateTexture2 (emfImage, WrapModeTileFlipX, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipY, non zero. status = GdipCreateTexture2 (emfImage, WrapModeTileFlipY, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipXY, non zero. status = GdipCreateTexture2 (emfImage, WrapModeTileFlipXY, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeClamp, non zero. status = GdipCreateTexture2 (emfImage, WrapModeClamp, 1, 1, 50, 60, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 50, 60); GdipDeleteBrush ((GpBrush *) brush); // Emf image - negative x and y. status = GdipCreateTexture2 (emfImage, WrapModeClamp, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - large x and y. status = GdipCreateTexture2 (emfImage, WrapModeClamp, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero width. status = GdipCreateTexture2 (emfImage, WrapModeClamp, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero height. status = GdipCreateTexture2 (emfImage, WrapModeClamp, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative width. status = GdipCreateTexture2 (emfImage, WrapModeClamp, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative height. status = GdipCreateTexture2 (emfImage, WrapModeClamp, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (NULL, WrapModeClamp, 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (NULL, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (NULL, WrapModeClamp, 0, 0, 0, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (NULL, WrapModeClamp, 0, 0, -1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (NULL, WrapModeClamp, 0, 0, 1, 0, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (NULL, WrapModeClamp, 0, 0, 1, -1, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (wmfImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (emfImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, -1, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, -1, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, -1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 0, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 1, 0, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 1, -1, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 101, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 1, 0, 100, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 100, 69, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 1, 100, 68, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 0, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, -1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 1, 0, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2 (bitmapImage, WrapModeClamp, 0, 0, 1, -1, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); GdipDisposeImage (bitmapImage); GdipDisposeImage (wmfImage); GdipDisposeImage (emfImage); } static void test_createTexture2I () { GpStatus status; GpImage *bitmapImage; GpImage *wmfImage; GpImage *emfImage; GpTexture *brush; GdipLoadImageFromFile (bitmapFile, &bitmapImage); GdipLoadImageFromFile (wmfFile, &wmfImage); GdipLoadImageFromFile (emfFile, &emfImage); // Bitmap image - WrapModeTile. status = GdipCreateTexture2I (bitmapImage, WrapModeTile, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipX. status = GdipCreateTexture2I (bitmapImage, WrapModeTileFlipX, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipXY. status = GdipCreateTexture2I (bitmapImage, WrapModeTileFlipXY, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - WrapModeTileFlipY. status = GdipCreateTexture2I (bitmapImage, WrapModeTileFlipY, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - clamp. status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 5, 6, 7, 8, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 7, 8); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTile, non zero. status = GdipCreateTexture2I (wmfImage, WrapModeTile, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipX, non zero. status = GdipCreateTexture2I (wmfImage, WrapModeTileFlipX, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipY, non zero. status = GdipCreateTexture2I (wmfImage, WrapModeTileFlipY, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - WrapModeTileFlipXY, non zero. status = GdipCreateTexture2I (wmfImage, WrapModeTileFlipXY, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - clamp, non zero. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, 1, 1, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - negative x and y. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - large x and y. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero width. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero height. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative width. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative height. status = GdipCreateTexture2I (wmfImage, WrapModeClamp, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTile, non zero. status = GdipCreateTexture2I (emfImage, WrapModeTile, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipX, non zero. status = GdipCreateTexture2I (emfImage, WrapModeTileFlipX, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipX, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipY, non zero. status = GdipCreateTexture2I (emfImage, WrapModeTileFlipY, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipY, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeTileFlipXY, non zero. status = GdipCreateTexture2I (emfImage, WrapModeTileFlipXY, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - tile, non zero. status = GdipCreateTexture2I (emfImage, WrapModeTile, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - WrapModeClamp, non zero. status = GdipCreateTexture2I (emfImage, WrapModeClamp, 1, 1, 50, 60, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 50, 60); GdipDeleteBrush ((GpBrush *) brush); // Emf image - negative x and y. status = GdipCreateTexture2I (emfImage, WrapModeClamp, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - large x and y. status = GdipCreateTexture2I (emfImage, WrapModeClamp, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero width. status = GdipCreateTexture2I (emfImage, WrapModeClamp, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero height. status = GdipCreateTexture2I (emfImage, WrapModeClamp, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative width. status = GdipCreateTexture2I (emfImage, WrapModeClamp, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative height. status = GdipCreateTexture2I (emfImage, WrapModeClamp, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (NULL, WrapModeClamp, 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (NULL, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (NULL, WrapModeClamp, 0, 0, 0, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (NULL, WrapModeClamp, 0, 0, -1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (NULL, WrapModeClamp, 0, 0, 1, 0, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (NULL, WrapModeClamp, 0, 0, 1, -1, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (wmfImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (emfImage, (WrapMode)(WrapModeClamp + 1), 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, -1, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, -1, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 0, -1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 0, 0, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 0, 1, 0, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 0, 1, -1, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 0, 101, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 1, 0, 100, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 0, 100, 69, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 1, 100, 68, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 1, 100, 68, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, (WrapMode)(WrapModeClamp + 1), 0, 1, 100, 68, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 1, 0, 68, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 1, -1, 68, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 1, 100, 0, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTexture2I (bitmapImage, WrapModeClamp, 0, 1, 100, -1, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); GdipDisposeImage (bitmapImage); GdipDisposeImage (wmfImage); GdipDisposeImage (emfImage); } static void test_createTextureIA () { GpStatus status; GpImage *bitmapImage; GpImage *wmfImage; GpImage *emfImage; GpImageAttributes *attributes; GpImageAttributes *customAttributes; GpImageAttributes *customAttributesClamp; GpImageAttributes *customAttributesInvalidWrap; GpTexture *brush; GdipLoadImageFromFile (bitmapFile, &bitmapImage); GdipLoadImageFromFile (wmfFile, &wmfImage); GdipLoadImageFromFile (emfFile, &emfImage); GdipCreateImageAttributes (&attributes); GdipCreateImageAttributes (&customAttributes); GdipCreateImageAttributes (&customAttributesClamp); GdipCreateImageAttributes (&customAttributesInvalidWrap); GdipSetImageAttributesWrapMode (customAttributes, WrapModeTileFlipXY, 0xFF00FF00, FALSE); GdipSetImageAttributesWrapMode (customAttributesClamp, WrapModeTileFlipXY, 0xFF00FF00, TRUE); GdipSetImageAttributesWrapMode (customAttributesInvalidWrap, (WrapMode)(WrapModeClamp + 1), 0xFF00FF00, TRUE); // Bitmap image - full size. status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - custom size. status = GdipCreateTextureIA (bitmapImage, NULL, 5, 6, 7, 8, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 7, 8); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - attributes with default wrap mode. status = GdipCreateTextureIA (bitmapImage, attributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - attributes with custom wrap mode. status = GdipCreateTextureIA (bitmapImage, customAttributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - attributes with custom wrap mode and clamp. status = GdipCreateTextureIA (bitmapImage, customAttributesClamp, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - full. status = GdipCreateTextureIA (wmfImage, NULL, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - small size. status = GdipCreateTextureIA (wmfImage, NULL, 1, 1, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - negative x and y. status = GdipCreateTextureIA (wmfImage, NULL, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - large x and y. status = GdipCreateTextureIA (wmfImage, NULL, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero width. status = GdipCreateTextureIA (wmfImage, NULL, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero height. status = GdipCreateTextureIA (wmfImage, NULL, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative width. status = GdipCreateTextureIA (wmfImage, NULL, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative height. status = GdipCreateTextureIA (wmfImage, NULL, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - attributes with default wrap mode. status = GdipCreateTextureIA (wmfImage, attributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - attributes with custom wrap mode. status = GdipCreateTextureIA (wmfImage, customAttributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - attributes with custom wrap mode and clamp. status = GdipCreateTextureIA (wmfImage, customAttributesClamp, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - non zero. status = GdipCreateTextureIA (emfImage, NULL, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - non zero. status = GdipCreateTextureIA (emfImage, NULL, 1, 1, 50, 60, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 50, 60); GdipDeleteBrush ((GpBrush *) brush); // Emf image - negative x and y. status = GdipCreateTextureIA (emfImage, NULL, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - large x and y. status = GdipCreateTextureIA (emfImage, NULL, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero width. status = GdipCreateTextureIA (emfImage, NULL, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero height. status = GdipCreateTextureIA (emfImage, NULL, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative width. status = GdipCreateTextureIA (emfImage, NULL, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative height. status = GdipCreateTextureIA (emfImage, NULL, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - attributes with default wrap mode. status = GdipCreateTextureIA (emfImage, attributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - attributes with custom wrap mode. status = GdipCreateTextureIA (emfImage, customAttributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - attributes with custom wrap mode and clamp. status = GdipCreateTextureIA (emfImage, customAttributesClamp, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (NULL, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (NULL, NULL, 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (NULL, customAttributesInvalidWrap, 0, 0, 0, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (NULL, customAttributesInvalidWrap, 0, 0, -1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (NULL, customAttributesInvalidWrap, 0, 0, 1, 0, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (NULL, customAttributesInvalidWrap, 0, 0, 1, -1, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (wmfImage, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (emfImage, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); status = GdipCreateTextureIA (bitmapImage, NULL, -1, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, -1, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, -1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 0, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 1, 0, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 1, -1, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 101, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 1, 0, 100, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 100, 69, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 1, 100, 68, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, NULL, 0, 0, 1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, customAttributesInvalidWrap, 0, 0, 0, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, customAttributesInvalidWrap, 0, 0, -1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, 0, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIA (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, -1, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); GdipDisposeImage (bitmapImage); GdipDisposeImage (wmfImage); GdipDisposeImage (emfImage); GdipDisposeImageAttributes (attributes); GdipDisposeImageAttributes (customAttributes); GdipDisposeImageAttributes (customAttributesClamp); GdipDisposeImageAttributes (customAttributesInvalidWrap); } static void test_createTextureIAI () { GpStatus status; GpImage *bitmapImage; GpImage *wmfImage; GpImage *emfImage; GpImageAttributes *attributes; GpImageAttributes *customAttributes; GpImageAttributes *customAttributesClamp; GpImageAttributes *customAttributesInvalidWrap; GpTexture *brush; GdipLoadImageFromFile (bitmapFile, &bitmapImage); GdipLoadImageFromFile (wmfFile, &wmfImage); GdipLoadImageFromFile (emfFile, &emfImage); GdipCreateImageAttributes (&attributes); GdipCreateImageAttributes (&customAttributes); GdipCreateImageAttributes (&customAttributesClamp); GdipCreateImageAttributes (&customAttributesInvalidWrap); GdipSetImageAttributesWrapMode (customAttributes, WrapModeTileFlipXY, 0xFF00FF00, FALSE); GdipSetImageAttributesWrapMode (customAttributesClamp, WrapModeTileFlipXY, 0xFF00FF00, TRUE); GdipSetImageAttributesWrapMode (customAttributesInvalidWrap, (WrapMode)(WrapModeClamp + 1), 0xFF00FF00, TRUE); // Bitmap image - full size. status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 100, 68, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 68); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - custom size. status = GdipCreateTextureIAI (bitmapImage, NULL, 5, 6, 7, 8, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 7, 8); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - attributes with default wrap mode. status = GdipCreateTextureIAI (bitmapImage, attributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - attributes with custom wrap mode. status = GdipCreateTextureIAI (bitmapImage, customAttributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Bitmap image - attributes with custom wrap mode and clamp. status = GdipCreateTextureIAI (bitmapImage, customAttributesClamp, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - full. status = GdipCreateTextureIAI (wmfImage, NULL, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - small size. status = GdipCreateTextureIAI (wmfImage, NULL, 1, 1, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - negative x and y. status = GdipCreateTextureIAI (wmfImage, NULL, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - large x and y. status = GdipCreateTextureIAI (wmfImage, NULL, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero width. status = GdipCreateTextureIAI (wmfImage, NULL, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, zero height. status = GdipCreateTextureIAI (wmfImage, NULL, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative width. status = GdipCreateTextureIAI (wmfImage, NULL, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image, negative height. status = GdipCreateTextureIAI (wmfImage, NULL, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 770, 649); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - attributes with default wrap mode. status = GdipCreateTextureIAI (wmfImage, attributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - attributes with custom wrap mode. status = GdipCreateTextureIAI (wmfImage, customAttributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Wmf image - attributes with custom wrap mode and clamp. status = GdipCreateTextureIAI (wmfImage, customAttributesClamp, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - non zero. status = GdipCreateTextureIAI (emfImage, NULL, 0, 0, 100, 100, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - non zero. status = GdipCreateTextureIAI (emfImage, NULL, 1, 1, 50, 60, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 50, 60); GdipDeleteBrush ((GpBrush *) brush); // Emf image - negative x and y. status = GdipCreateTextureIAI (emfImage, NULL, -10, -10, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - large x and y. status = GdipCreateTextureIAI (emfImage, NULL, 2000, 2000, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero width. status = GdipCreateTextureIAI (emfImage, NULL, 1, 1, 0, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, zero height. status = GdipCreateTextureIAI (emfImage, NULL, 1, 1, 2, 0, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative width. status = GdipCreateTextureIAI (emfImage, NULL, 1, 1, -1, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image, negative height. status = GdipCreateTextureIAI (emfImage, NULL, 1, 1, 2, -1, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTile, 100, 100); GdipDeleteBrush ((GpBrush *) brush); // Emf image - attributes with default wrap mode. status = GdipCreateTextureIAI (emfImage, attributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeClamp, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - attributes with custom wrap mode. status = GdipCreateTextureIAI (emfImage, customAttributes, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Emf image - attributes with custom wrap mode and clamp. status = GdipCreateTextureIAI (emfImage, customAttributesClamp, 0, 0, 2, 2, &brush); assertEqualInt (status, Ok); verifyTexture (brush, WrapModeTileFlipXY, 2, 2); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (NULL, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (NULL, NULL, 0, 0, 1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (NULL, customAttributesInvalidWrap, 0, 0, 0, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (NULL, customAttributesInvalidWrap, 0, 0, -1, 2, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (NULL, customAttributesInvalidWrap, 0, 0, 1, 0, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (NULL, customAttributesInvalidWrap, 0, 0, 1, -1, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (wmfImage, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (emfImage, customAttributesInvalidWrap, 0, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); status = GdipCreateTextureIAI (bitmapImage, NULL, -1, 0, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, -1, 1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, -1, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 0, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 1, 0, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 1, -1, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 101, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 1, 0, 100, 2, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 100, 69, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 1, 100, 68, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, NULL, 0, 0, 1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, customAttributesInvalidWrap, 0, 0, 0, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, customAttributesInvalidWrap, 0, 0, -1, 2, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, 0, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); brush = (GpTexture *) 0xCC; status = GdipCreateTextureIAI (bitmapImage, customAttributesInvalidWrap, 0, 0, 1, -1, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpTexture *) 0xCC); GdipDisposeImage (bitmapImage); GdipDisposeImage (wmfImage); GdipDisposeImage (emfImage); GdipDisposeImageAttributes (attributes); GdipDisposeImageAttributes (customAttributes); GdipDisposeImageAttributes (customAttributesClamp); GdipDisposeImageAttributes (customAttributesInvalidWrap); } static void test_getTextureImage () { GpStatus status; GpImage *image; GpTexture *brush; GpImage *brushImage1; GpImage *brushImage2; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); status = GdipGetTextureImage (brush, &brushImage1); assertEqualInt (status, Ok); assert (brushImage1 != image && "The texture image should be a clone."); status = GdipGetTextureImage (brush, &brushImage2); assertEqualInt (status, Ok); assert (brushImage2 != brushImage1 && "The texture image should be a clone."); // Negative tests. status = GdipGetTextureImage (NULL, &brushImage1); assertEqualInt (status, InvalidParameter); status = GdipGetTextureImage (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDisposeImage (brushImage1); GdipDisposeImage (brushImage2); } static void test_getTextureWrapMode () { GpStatus status; GpImage *image; GpTexture *brush; GpWrapMode wrapMode; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); // Negative tests. status = GdipGetTextureWrapMode (NULL, &wrapMode); assertEqualInt (status, InvalidParameter); status = GdipGetTextureWrapMode (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); } static void test_setTextureWrapMode () { GpStatus status; GpImage *image; GpTexture *brush; GpWrapMode wrapMode; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); // WrapModeTileFlipX. status = GdipSetTextureWrapMode (brush, WrapModeTileFlipX); assertEqualInt (status, Ok); GdipGetTextureWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipX); // WrapModeTileFlipY. status = GdipSetTextureWrapMode (brush, WrapModeTileFlipY); assertEqualInt (status, Ok); GdipGetTextureWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipY); // WrapModeTileFlipXY. status = GdipSetTextureWrapMode (brush, WrapModeTileFlipXY); assertEqualInt (status, Ok); GdipGetTextureWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipXY); // WrapModeClamp. status = GdipSetTextureWrapMode (brush, WrapModeClamp); assertEqualInt (status, Ok); GdipGetTextureWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeClamp); // Invalid WrapMode - nop. status = GdipSetTextureWrapMode (brush, (WrapMode)(WrapModeClamp + 1)); assertEqualInt (status, Ok); GdipGetTextureWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeClamp); // Negative tests. status = GdipSetTextureWrapMode (NULL, wrapMode); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); } static void test_getTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix (&transform); // Negative tests. status = GdipGetTextureTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipGetTextureTransform (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (transform); } static void test_setTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); status = GdipSetTextureTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Changing the original transform should not modify the brush's transform. GdipSetMatrixElements (matrix, 2, 3, 4, 5, 6, 7); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Negative tests. status = GdipSetTextureTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipSetTextureTransform (brush, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetTextureTransform (brush, nonInvertibleMatrix); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDeleteMatrix (transform); } static void test_resetTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *matrix; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix (&transform); GdipSetTextureTransform (brush, matrix); status = GdipResetTextureTransform (brush); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // Negative tests. status = GdipResetTextureTransform (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (matrix); } static void test_multiplyTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *originalTransform; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix2 (2, 3, 4, 5, 6, 7, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetTextureTransform (brush, originalTransform); status = GdipMultiplyTextureTransform (brush, matrix, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // MatrixOrderPrepend. GdipSetTextureTransform (brush, originalTransform); status = GdipMultiplyTextureTransform (brush, matrix, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Null matrix. status = GdipMultiplyTextureTransform (brush, NULL, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Invalid MatrixOrder - negative. GdipSetTextureTransform (brush, originalTransform); status = GdipMultiplyTextureTransform (brush, matrix, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Invalid MatrixOrder - positive. GdipSetTextureTransform (brush, originalTransform); status = GdipMultiplyTextureTransform (brush, matrix, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Negative tests. status = GdipMultiplyTextureTransform (NULL, matrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipMultiplyTextureTransform (brush, nonInvertibleMatrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDeleteMatrix (transform); } static void test_translateTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *originalTransform; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetTextureTransform (brush, originalTransform); status = GdipTranslateTextureTransform (brush, 5, 6, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 10, 12); // MatrixOrderPrepend. GdipSetTextureTransform (brush, originalTransform); status = GdipTranslateTextureTransform (brush, 5, 6, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 28, 40); // Negative tests. status = GdipTranslateTextureTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipTranslateTextureTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipTranslateTextureTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_scaleTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *originalTransform; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetTextureTransform (brush, originalTransform); status = GdipScaleTextureTransform (brush, 0.5, 0.75, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 0.5, 1.5, 1.5, 3, 2.5, 4.5); // MatrixOrderPrepend. GdipSetTextureTransform (brush, originalTransform); status = GdipScaleTextureTransform (brush, 0.5, 0.75, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 0.5, 1, 2.25, 3, 5, 6); // Negative tests. status = GdipScaleTextureTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipScaleTextureTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipScaleTextureTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_rotateTextureTransform () { GpStatus status; GpImage *image; GpTexture *brush; GpMatrix *originalTransform; GpMatrix *transform; GdipLoadImageFromFile (bitmapFile, &image); GdipCreateTexture (image, WrapModeTile, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetTextureTransform (brush, originalTransform); status = GdipRotateTextureTransform (brush, 90, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, -2, 1, -4, 3, -6, 5); // MatrixOrderPrepend. GdipSetTextureTransform (brush, originalTransform); status = GdipRotateTextureTransform (brush, 90, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetTextureTransform (brush, transform); verifyMatrix (transform, 3, 4, -1, -2, 5, 6); // Negative tests. status = GdipRotateTextureTransform (NULL, 90, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipRotateTextureTransform (brush, 90, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipRotateTextureTransform (brush, 90, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDisposeImage (image); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } int main (int argc, char**argv) { STARTUP; test_clone (); test_delete (); test_createTexture (); test_createTexture2 (); test_createTexture2I (); test_createTextureIA (); test_createTextureIAI (); test_getTextureImage (); test_getTextureWrapMode (); test_setTextureWrapMode (); test_getTextureTransform (); test_setTextureTransform (); test_resetTextureTransform (); test_multiplyTextureTransform (); test_translateTextureTransform (); test_scaleTextureTransform (); test_rotateTextureTransform (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.tif0000644000175000017500000007134212377405421020157 0ustar directhexdirecthexII* d ?W[ь pIrDh;'`l< [5"(׾:{ ","{'O.4E[h3HɒF}uΐ m%iy2]chϠSθo|aMH.g)Y@ ًudxB+u9+,x g[$\^1X'⿈ԣ 1nlOC4er=xz&XKl^'eK~*-hY\^dk~)-ḫ!qL1+Z[ԄF(QE-QEQEQEW3?xKyJ zW).ky溷J zW#/i2kyn纷J zW  (nYq Q8׵yG<=VZ pH+'%t'BWc!eUD?^Q VWAEq1WAQNWAEq1Wo H5;ٝF27]7S0H>dk6.!XdP>`qQAhd{&Yq հ"oxX$ ]ڮ'M[Oջ o_\O+|շ5 OނR?F֭[|sN 0j㠍GpO޷чHMU YtFuZGů ꬱYtFuZG ꬱYtFvpOB[y3`"K{.[uhx0?zI(3KEo>i6 n#|.;Dw:4Fӯ!V `oqȎ⹿CNu*Ḍ 3WƛunId7VmfFa 5f]x{[oY դYu?B |iW>tCui&dlrЃV,ظul [!e|ÀśD u$,xpw9ھS`ճ(nO<{Su_~5dGIP9Su_~5dGIP9T:?\2Ca C+d_͎Hb[AN}d_͎Hb[AN}d_͎Hb[AN} jib'(`qҧ&[Lf+iRr}* jib'(`qҾaV/?*Ds!Xx=>%Z0HRǜ`koh#G1KrA (((((x6'[h $q޸x6!ܶ$09^Hq:񽿄- COwm H$`sz+/^19层9VPD< *8AqC^ac>5נ|G<0G*臘X=1k,xƺYC]6= ujO;_4wª+~jO;_4wª+jO;_4wª+kkh((( Ҽ{2CmVa-bP Yr{r {UKivؔ.B}\ܨk>=C$6aF]% u'*?Z</P^$Bh+s<һInbzWx76>.`H. V);yǥr?Sqt? YߚG VNH}RD=0 ?/0:~!;50 ?*45Snsg#%01 Q|#E$ִ[Nu6r#c.&s1>tLpB# ? zæOp]X zxn"CAsa),`$*{ȼCiw\y@ '7ïa{-!*ʾ5[7WZBUQm}I;j?*w״ JZ(((((=+/].&@]wl|Pp o JDd][+c±CA JDhbdpV߀.|3wqq|Ciyldu5|6}sˋb[Kf`'?3v瞧^˟ \\k^[39s<]b^KX1G̨NHrh|Zѵ1cP*-GDa; 4LQ@ G$ _V[lF3䁓ڪymbb9 dx;񽞛5h'h̞I<&N?5ֺM/ qO g`pJk]&׆8y'O r8ӥ?7j5Gk5tP30,_]5$wk5tP30,_h| fGwk5tP30,_zW:uQEQEd ?((((Ph -s3rKwl+R𶋪41Kw87VmU彰g$[ X[@dJrNIK++[ q V$HrNI5eekan! r$ '$zVQEQEdD   %( 4@H(1:P[!I6^test.tifFile written by Adobe Photoshop 4.0a +Y HHImageMagick 5.5.6 04/01/03 Q16 http://www.imagemagick.orgC    $.' ",#(7),01444'9=82<.342 }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz8BIMxHHS[ (hh t2 HK'd L3008BIMHH8BIM8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM@@8BIM W JFIFHH'File written by Adobe Photoshop 4.0Adobed            W"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ? |J]~MjX?]z&=vz-沗K}FܪzLǫ5:Ŗ8۵e-`tol '6_e oo],Sb2 ~:o ҽ}+-*9ӭK|~_tU^31pEW~=Wp3M_c/ͧwE2}_QVKmw`j_b?pɣUGޱqmֲ_,?{}>f1%488as?Mߧ=/Qzq:I&I$JRI$I$$I)U}d},{n[0j¡ޓ᭏s\ܻmW/?/m!w5͎߿eMO!fPo\ѽNO)']Þv~GMlifu<'aec l!d5H;Sh#+t1:f31hjltk-~lNnmMƸmiwFy#v~yn1$9skvqb=ݬUgTr>u6A.= Gq2Ƶg?KZԪa3+u?ȗbmأO}g:Ӄ̌o.Gwf>ں!]]$rZ)a/a{'mmRCl!ߙ xdWI-;S)5RӜPw?6>uޞZz5fou`yuLM~sNˬ|8 q~o?W1MwCͺfNs=2izmOV12 \75#&b3 ׸85ho}ulw4[* }%kGPfC*lkqw8X`u\o{Lm.[I,>T!B` n>=۶zq"RTI%)$IMѰ:Mp{\enԟ^O՞_Lk3n˙R*ʛְeϳac[uSSe. iCi_sWoPe4;6ƭ5=Eu0,dvzٿu{=Qn5SL+@ @v^V:.` %k~$sjr3W kms[kշ!tk{.kY\_rzu͝- ?;!g*JOܺUnd=MFelgUoWy}+acj-Όk]ck?VH-1:Kk+0TͿڨ}L:FK+wKk%JxQK$4P܌ E7Y1+W/dj{K\ͮcGm߽ӫ$TI%)$IJ^G3FvUF+lu=hhikn63GoꭏLf9ۍ]p5闵~WzOzwbodQ_7+4P5cO+qo{_oNĪkAɩZgLznW)" U,muVXֵFo^gկ񁕔p{kz?#U3`3+5f9pa_c6v{9nTY fV=wue?Er7, ّ Dork )>#-`w={S,YK}1?][cޕ^оx֏OQ-A-%տvk}M:J$I)I$JTI%)$IOL;?-[`kmk,~#?ŷ\|*'S:`c1k˿Km]kų.ߏsvS}_q]Vg᰺ڕYeA᭏Mm}^*EW,5.ǧvkhcFY#v{w3֌7+e?ßsƻеu-o{ICb@q_*==؅:fJ¯1iW[dĝΗ>v?K@?wcc@$$A7{{A$$BffCoB99CuuD99DDzD/33D933EO33EEFEFFE]]FȴGKEEGK~~G HZ??HjH9I%H/IOII HHI I J!JV"BBJ\"J#??JR#Jȴ$Jn$J%99Kt%iiK&66K &L'L1''L1'(``L1'(xxLA)!!Lu)L/)M%*M%+WWM%+M%+M%+M%,MO,Mx-M-MO.NNM-.N J.~~NV/N\0xxNȴ0xxN~199N2OdZ2OdZ2OdZ3OdZ3O+4OP4O4P 5--P 5P 6OF6P 7''Pu7''P7P8xxQ7Pj8Q9R999R~:66RR;33R;33R<SdZ<S <``S=T ?T?ccTZ?T@<<Uh?U-@V$AVBVBNNWSBWAWƨBXCYhD00YDZMDZDZD[|D\9XD``\E--]XE^FBB^FBB^!FBB_\)Fff_\)E`9XE aE a7LDapDaCaCb=qCb!CbvBcoAcA!!c@dQ@d9@xxdA@d?ep?e>e>fM=e=EEfv<g <gK66>v>?3333?ccw@<<;A--A;A9XBNNuABĜC%CDxxhE]] JEEEEuuIEuuVEuu#EEE"FBBF9XF**FBBF** FZZFuFF#FFrrRFG?}GG5?G|GG`GH G33GwGH$$Hxx?}HH$HKHKHbNHH^I--ffIoJ66 IIQJJBBJrr{JJKJƨK33?}KWWź^K5?KHL |L<<bK1'L<</Lɉ7L{L+M99AM!!̃MxMnMNff϶FNЃOccOccҟOcc;dObNP<<VPպ^Q99Q99Q99Q--mQRMS''KS1'T00THHXT~U]]ߥUEEVhsVȴVWXX!XdZYuuDZ^Zrrn[ [7L\\]]^\_`z`hsa--Ma--Sa99;aQQja7LaT`ll+_`<<`1'a;c''ddZdefg''gWWgIgg-g/h$$g+gooXh<<goo f~frr-fene-eEEjdKd00c^cQcKK⟾c''ᙚbDb~~ =bNN-b**Xaiiڟa99٩aج`A``պ^``ԛ`K``<<Ѻ^_Ѓ_KKl_KK~_KK͙_˝_^^ȼj^m^ =^{^?}_33bN_33 _cc+_~__9_w`C`<<~`ll`/`a99 a\)bNNVbOb/cKKmcd00vd7eeQf"g??g''h00ĜiEE;h;iHjjkl|m99n66$o33hoOppwp33qiiqrBB-rVs{{rs{{ZtxxuuuCuPuvVuffw''{x``xxxy--yOy?}zp{WW{p|h|-|h~33pp<<pp-?}KKĜ9EEZuu/ J`` J|S(%9E{WW333300l]]I?}`B^<<{TT {ffQQoC33"HNN33''|P|C]]|**wP''|P``PuuSP**|WWl \)lliiliilS~~33~~CCCS<<33o QQo"Kff"''{{oC" o33KrrC33 S``!!PKZZ??((TT(r 9QQ VVV`KK/^^^TT--E!33KKCuu;BBwl\)KCPBB9XbNl\)ff\)\)C$$~~vcc{ĐōhƊOƊ?}ǟVȨ`ĜoobN̴I(ffcc(TT9X999XffIӓQIձĜ]]9?}````E????!ޮ{{$V**+$$$uu{**#緸?}`ꊋ(뇈섅QQ|ff {{+{{`BpĜcc9Xl33I66{{|SlooC$$o!!5?h--xxphuEEj00Pwoffffuuh9Z;EEtEEdZ33 EE--ff!!pOZZ7L--/?}O`B?}&KK166P''xxS =q`BHH&`llO-ffouuwZ339BB9ii7L-߷Ecco"KK;ߓu߷ONNNN5?ݙ "BBCtxx''P**z+R&WW''C**ȴ''ff$$ Jبrr<<7L`Bii`j99tWW33ڊREE--**33&۟`??oȴںVZZ-rr?}ZZۇܴ݁VllT-ZZ٥-ڊڢOںD۟Dڊ(uu !!ٽXZZ9Xۇy**??CrrեHHӫhҮffNNydZBBtљjTTI<<`00pϓ33+VKKϓϫ33Iκ`Ζ9p-ESZwκffffκͥo̜"$$ˇz33ʺIBBĜzuu7Lxx9 &ǟhHHT Jť5?EET-ĴvĴff00Eë-33E~~v+ff99EE00v$vȴNNȴv R HH]]"]]" HHH R WWS??33o**R SEEC"  o''" **HH<< 33=q~~+NN+V-ll 5?  J**uu5?ZZjz;C{{dZ=q~~`1ii33iiS--`9t-1ccS33M~~pI1166TGbQQff%9Xcccccc"00}xx|j|D|I|brr{;WW|b00|9Xxx|j|z33|D33|j |j}%}%}&}Gff}GKK}00~}hQQ~-~ȴcc~ȴ00CwZZhs7L??-oo"''jZZ%X<<- JVffvTT-Ĝffj+QQ J&ll9XllĜcc~~M~R--"cc``]]hs-^5 =$$y--BBWW&$$hQQnNNvKK+R99v~~=q''R-ԐՍ%wHHvcchsĜ~~(љ =ll~KK~-~ J}**}7Lʺ}7$$|j**{ťz+yǷxrEEwBBwdZ??vv vn!!v=q̨vnv=qccv Jccu00uuXu%iittt~~t''ttztZtAt9Xձs֢stWWsSrr=qq$$qןr``qhs--pٍpEEom onȴWWn~n-ՍnԐnӓmTmffmm-iimnTTn Jnn^566nRήnRo99ot̴o;do??o ??oFrrpɥpIpuup!!qXuuqT qƢqqHHr{{rMrMffrnr\rRrr~r~rnr^5r JBBr\s =!!rȴHHrRr''rȴ**r--r\r^5``rnr~rMr-TTr JqTqxQQq%pj$$pZZppIpDpq&q7LuuqGq&ccq&**q&EEqqrn~~rnsStAtu**v+v~``w??xy%BByGuuyyXy00z+z''z+z~--z+llyyXyhKKxDwus{{qNNnȴmhsiilkdZjȴj-ihsrrhAgg+fEEedjdQcmcFcd1'dzddjdDd~~eV~~eV{{eVlleVddd~~deVe&eV''eVeVeVdddDdeVeVcce&eGe^eGd/dccd00dA``dQcƨc;dHHb~--bnb^5ZZaa&`zBB`r`b_F_Kxx^ ^-]]]7\\Q\AWW[|Z!Y#$$YXX/XD99WVVnNNUXTATccRQ00QTQX99PPPQP P PbxxPOmOPOooP HHPQ00PQuuPPP P QX99Q?}QQ{{QR{TTR\RS+66SPSK~~S TbNTTjTUVuuU/''UGUG Ux--UɥU7**UʺV=qʊV^5??VHW\)WWWFXAXYYT Y$$Z YY7XήYGKKYY^00ZyМ\ TT\Aд\]X]Gс]x66]Җ]Ү^n_33_66_ƨ99_TT`b` {{`1'`D`jд`љax~~a7ccaxxaX--a7Laa%`/`ؐ` `uu_l^ٽ^]]]Gب\jEE\r\ **\bNZZ[ڊZyڊZڊZ5?ڊY66Y]]XؐXbN``XA׫WW =**V~UUhsrrUXU7׫U^ooUHHU#--U]]VUBBUںVVHooW۟VWlTTWX $$X܄Y?}ܜYxQQY#Z5?Z{~~Z^5Z![[[ccZȴޖ[;dݽ[ii[99[ \A<<\b \D]Vޖ]33]]߷]G--\▗\▗\㓔\r䐑[[m]][屲[+[Z\BBZZrrY7YVooX矠X1'Wƨ``W$$VVUxU?}TUVHHTr{{S ccS|R⮯R$R^5▗Q66PᱲPAQQP1'P PQO00OOƨccO޺OPffOlOK݁O+݁O\)Ol<<O|OKOKOK33OƨBBO|]]O+--O|xxO+NHWWNNM֢M#M^MVLbNԐLbLKKKKPffKKƨ--K--K--KllKЄKlМJHМJVϷIIxIffI?}H/ͥHHj<<H933HbNrrHrɽHuuHu HrȐHQ``HQHuWWHWWHƊHűHűHHxxHuHH9ccHj{{HuH66Hr®HrHiiHuHQ--HAH1'H1'TTHQHrHAccH1'H H~~H HAHQHb!!G 99GGƨ$$GllG Gƨ33GwKKG|G**G rrG ]]GHHG\) G+G =F--F!``FFF!''FH~~G =GoG FFFHG 33GGGG G|GG--H``I``I7JKFZZLbN]]M``M#N!OKOmPr<<PQhsPQQQR<<SKT33TjTjUZZW =W =X ]]Y?}ZZX/!!YhsY$$ZYhsXXA66W Wl!!WFV V=qooV5?V``U#UU00UV5?VMVnllU#{{U^~~~U|Ux{UhszUXyuuUGx$$UXvUhsvUtUrV{s''VMqQQVoU^occV-nU/nT m!!S l R!kR^5jRMiQhQxhQ#gQVfPAgPfOƨeNHdMdMhsc{{Lc''LQb**Ka--K`K|_J^J^5^66J!]JE]!!I#]!!Ix\$$IO[33I[''IhsZHbNYG\)ZGXFWF$X<<F5?VE7U--D/U]]EVSDuR~~DbQDQPllCOAOKKAN@N@bNNNN?L?\)K??>J? Jrr>ffJBB=JV>n>~~+>rrR>?WW;d?cc"?ooS?@$$m? >ƨ>ffP==QQ<<m<=!!(=uuI=r=I>ZZ>?''>O>>=X=V<NN~=QQ~<``~<5?;V;oov:ff:;33;K:dZ:**|:K:NNK9C:o9\)9]]9EE8``ƨ77WW 6rr 9X5 5]]!p5EE 5--;5P5+67576ff7KKt733t7WWy7{{V7KKM787L8?}9--9Z:9X:;;''33;''+;'';33:O::9]]z8r8Q7??96~~V554ll5?3R3ccS32b1^0dZ0``(/h..66 =-QQ 1',xx!`B,!+"-*rr"\+"***"^5)EE!)"E)EE!( `' `(ll )EE *('l'&;d&&BB'oon(=q) J(ll'x%]]?}&V(HH/***)!!((F'(HHdZ)ii33*NN33)(ff(``T()]])**NN-*66`B))uu`()9)--j)QQr)bN*Q*Q**F*l*BBC)()EE))+*v+''ff+v+WW+**66p)?}) `)`*BB`*V++33D+{{Q* )) F)**~~*l*33+WW =*~~)v($)--{)*NN J**T+^*NN/))((TT'WW1'(HHA)--Z(9X)--A)Q*ZZb*rr* *|*66S)+)EEy((llR'!(~(TTM(^5)!!)ii T) 7) X( &(HH V' '?? ' ' D( r) I( (HH (`` ' |'cc S& C'WW +' o(TT =' ' ' \& ~&~~ ff&rr ~& =q& & &NN -% h% % $HH # # h# #oo " p"ff X"66 ^" X!!j!iij j 9ZZ ll cc ` G   #WW ZZ ^5  y  ll A 1' V 8BIM Path 18BIMlibgdiplus-6.0.4+dfsg/tests/testgraphicsfill.c0000644000175000017500000034340513542674535022222 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void createImageGraphics (INT width, INT height, GpImage **image, GpGraphics **graphics) { GpStatus status; status = GdipCreateBitmapFromScan0 (width, height, 0, PixelFormat32bppARGB, NULL, (GpBitmap **) image); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext (*image, graphics); assertEqualInt (status, Ok); } static void test_fillClosedCurve () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 6); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve (graphics, brush, normal7, 1); assertEqualInt (status, Ok); // Negative tests. status = GdipFillClosedCurve (NULL, brush, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (NULL, brush, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (NULL, brush, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (NULL, brush, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (NULL, brush, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (NULL, brush, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, normal7, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillClosedCurve (graphics, brush, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve (graphics, brush, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve (graphics, brush, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve (graphics, brush, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve (graphics, brush, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve (graphics, brush, normal7, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillClosedCurveI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 6); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1). createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurveI (graphics, brush, normal7, 1); assertEqualInt (status, Ok); // Negative tests. status = GdipFillClosedCurveI (NULL, brush, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (NULL, brush, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (NULL, brush, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (NULL, brush, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (NULL, brush, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (NULL, brush, normal7, -1); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurveI (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, NULL, normal7, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillClosedCurveI (graphics, brush, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipFillClosedCurveI (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurveI (graphics, brush, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, normal7, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillClosedCurveI (graphics, brush, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, brush, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, brush, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, brush, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, NULL, normal7, -1); assertEqualInt (status, OutOfMemory); // FIXME: this causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillClosedCurveI (graphics, brush, NULL, 4); assertEqualInt (status, InvalidParameter); #endif status = GdipFillClosedCurveI (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurveI (graphics, brush, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, brush, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurveI (graphics, brush, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurveI (graphics, brush, normal7, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillClosedCurve2 () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 7, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 7, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 7, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 7, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 7, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 7, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 6, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 6, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 6, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 6, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 6, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 6, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 5, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 5, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 5, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 5, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 5, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 5, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, zero4, 4, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, zero4, 4, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, zero4, 4, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, zero4, 4, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, zero4, 4, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, -10, FillModeAlternate); assertEqualInt (status, Ok); // Negative tests. status = GdipFillClosedCurve2 (NULL, brush, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 3, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 3, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 2, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 2, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, -1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, -1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, 0, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (NULL, brush, normal7, -1, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, NULL, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, NULL, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, NULL, -1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2 (graphics, brush, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2 (graphics, brush, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillClosedCurve2I () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 7, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 7, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 7, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 7, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 7, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 7, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 6, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 6, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 6, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 6, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 6, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 6, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 5, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 5, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 5, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 5, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 5, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 5, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, zero4, 4, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, zero4, 4, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, zero4, 4, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, zero4, 4, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, zero4, 4, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, -10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 10, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0.5, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, -10, FillModeAlternate); assertEqualInt (status, Ok); // Negative tests. status = GdipFillClosedCurve2I (NULL, brush, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (NULL, brush, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (NULL, brush, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (NULL, brush, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, NULL, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, NULL, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillClosedCurve2I (graphics, brush, NULL, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 3, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 3, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 2, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 2, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 1, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 1, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); #endif status = GdipFillClosedCurve2I (graphics, brush, NULL, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, -1, 0.5, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, NULL, -1, 0, FillModeAlternate); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillClosedCurve2I (graphics, brush, NULL, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); #endif status = GdipFillClosedCurve2I (graphics, brush, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, normal7, -1, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 3, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 4, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, NULL, normal7, 4, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillClosedCurve2I (graphics, brush, NULL, 4, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 4, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); #endif status = GdipFillClosedCurve2I (graphics, brush, NULL, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, NULL, -1, 0.5, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, NULL, -1, 0, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 2, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0.5, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 1, 0, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillClosedCurve2I (graphics, brush, normal7, 0, 0.5, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, normal7, 0, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillClosedCurve2I (graphics, brush, normal7, -1, 0.5, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillClosedCurve2I (graphics, brush, normal7, -1, 0, FillModeAlternate); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillEllipse () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Positive, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, 100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, 100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, 100, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, 0, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, 0, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, -100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, -100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipse (graphics, brush, 5, 5, -100, -100); assertEqualInt (status, Ok); // Negative tests. status = GdipFillEllipse (NULL, brush, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillEllipse (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillEllipse (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillEllipse (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillEllipseI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Positive, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, 100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, 100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, 100, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, 0, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, 0, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, -100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, -100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillEllipseI (graphics, brush, 5, 5, -100, -100); assertEqualInt (status, Ok); // Negative tests. status = GdipFillEllipseI (NULL, brush, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillEllipseI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillEllipseI (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillEllipseI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillPath () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GpPath *emptyPath; GpPath *onePath; GpPath *twoPath; GpPath *threePath; GpPath *multiPath; GpPath *intersectPath; GpPath *alternatePath; GpPath *windingPath; GpPath *invalidPath; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (points, types, 1, FillModeAlternate, &onePath); GdipCreatePath2 (points, types, 2, FillModeAlternate, &twoPath); GdipCreatePath2 (points, types, 3, FillModeAlternate, &threePath); GdipCreatePath (FillModeWinding, &multiPath); GdipAddPathRectangle (multiPath, 10, 20, 30, 40); GdipAddPathRectangle (multiPath, 60, 70, 80, 90); GdipCreatePath (FillModeWinding, &intersectPath); GdipAddPathRectangle (intersectPath, 10, 20, 30, 40); GdipAddPathRectangle (intersectPath, 20, 30, 40, 50); GdipCreatePath (FillModeAlternate, &alternatePath); GdipAddPathRectangle (alternatePath, 10, 20, 30, 40); GdipCreatePath (FillModeWinding, &windingPath); GdipAddPathRectangle (windingPath, 10, 20, 30, 40); GdipCreatePath ((FillMode) (FillModeWinding + 1), &invalidPath); GdipAddPathRectangle (invalidPath, 10, 20, 30, 40); // FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, alternatePath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, windingPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Invalid FillMode. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, invalidPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Empty path. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, emptyPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One path. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, onePath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two path. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, twoPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three path. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, threePath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Multi path. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, multiPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Intersect path. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPath (graphics, brush, intersectPath); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPath (NULL, brush, windingPath); assertEqualInt (status, InvalidParameter); status = GdipFillPath (graphics, NULL, windingPath); assertEqualInt (status, InvalidParameter); status = GdipFillPath (graphics, brush, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPath (graphics, NULL, windingPath); assertEqualInt (status, ObjectBusy); status = GdipFillPath (graphics, brush, NULL); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePath (emptyPath); GdipDeletePath (onePath); GdipDeletePath (twoPath); GdipDeletePath (threePath); GdipDeletePath (multiPath); GdipDeletePath (intersectPath); GdipDeletePath (alternatePath); GdipDeletePath (windingPath); GdipDeletePath (invalidPath); GdipDeleteBrush (brush); } static void test_fillPie () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Positive -> large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 90, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, 0, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPie (graphics, brush, 5, 5, 100, 100, -90, -700); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPie (NULL, brush, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPie (NULL, brush, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, NULL, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, 0, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, 0, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, -1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, 1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, -1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPie (graphics, brush, 0, 0, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPie (graphics, brush, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, NULL, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 0, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 0, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, -1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, -1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 1, 0, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 1, -1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPie (graphics, brush, 0, 0, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillPieI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Positive -> large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 90, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, 0, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPieI (graphics, brush, 5, 5, 100, 100, -90, -700); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPieI (NULL, brush, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (NULL, brush, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, NULL, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, 0, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, 0, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, -1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, 1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, -1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipFillPieI (graphics, brush, 0, 0, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPieI (graphics, brush, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, NULL, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 0, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 0, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, -1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, -1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 1, 0, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 1, -1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipFillPieI (graphics, brush, 0, 0, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillPolygon () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; PointF points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Four - FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 4, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Four - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 4, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three - FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 3, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 3, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two - FillModeAlternate createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 2, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 2, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One - FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One - FillModeWinding createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, points, 1, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero - FillModeAlternate. PointF zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, zeroPoints, 4, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon (graphics, brush, zeroPoints, 4, FillModeWinding); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPolygon (NULL, brush, points, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (NULL, brush, points, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (NULL, brush, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (NULL, brush, points, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (NULL, brush, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, NULL, points, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, NULL, points, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, NULL, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, NULL, points, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, NULL, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, -1, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPolygon (graphics, brush, points, 3, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon (graphics, NULL, points, 3, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon (graphics, NULL, points, 1, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon (graphics, NULL, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, NULL, points, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, NULL, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, 1, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon (graphics, brush, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, -1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon (graphics, brush, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillPolygonI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; Point points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Four - FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 4, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Four - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 4, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three - FillModeAlternate createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 3, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 3, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two - FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 2, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 2, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One - FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 1, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, points, 1, FillModeWinding); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero - FillModeAlternate. Point zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, zeroPoints, 4, FillModeAlternate); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero - FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygonI (graphics, brush, zeroPoints, 4, FillModeWinding); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPolygonI (NULL, brush, points, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (NULL, brush, points, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (NULL, brush, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (NULL, brush, points, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillPolygonI (NULL, brush, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, NULL, points, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, NULL, points, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, NULL, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, NULL, points, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillPolygonI (graphics, NULL, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillPolygonI (graphics, brush, NULL, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, NULL, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); #endif status = GdipFillPolygonI (graphics, brush, NULL, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, NULL, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillPolygonI (graphics, brush, NULL, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); #endif status = GdipFillPolygonI (graphics, brush, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, points, 0, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, points, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillPolygonI (graphics, brush, points, -1, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, OutOfMemory); status = GdipFillPolygonI (graphics, brush, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPolygonI (graphics, brush, points, 3, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygonI (graphics, NULL, points, 3, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygonI (graphics, NULL, points, 1, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygonI (graphics, NULL, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, NULL, points, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillPolygonI (graphics, brush, NULL, 3, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, NULL, 1, FillModeAlternate); assertEqualInt (status, InvalidParameter); #endif status = GdipFillPolygonI (graphics, brush, NULL, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, NULL, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillPolygonI (graphics, brush, points, 1, FillModeAlternate); assertEqualInt (status, ObjectBusy); status = GdipFillPolygonI (graphics, brush, points, 0, FillModeAlternate); assertEqualInt (status, InvalidParameter); status = GdipFillPolygonI (graphics, brush, points, -1, FillModeAlternate); assertEqualInt (status, OutOfMemory); status = GdipFillPolygonI (graphics, brush, points, 4, (FillMode) (FillModeWinding + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillPolygon2 () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; PointF points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2 (graphics, brush, points, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2 (graphics, brush, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2 (graphics, brush, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2 (graphics, brush, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. PointF zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2 (graphics, brush, zeroPoints, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPolygon2 (NULL, brush, points, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (NULL, brush, points, 1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (NULL, brush, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (NULL, brush, points, -1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, NULL, points, 1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, points, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPolygon2 (graphics, brush, points, 3); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2 (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2 (graphics, NULL, points, 1); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2 (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, points, 1); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2 (graphics, brush, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2 (graphics, brush, points, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillPolygon2I () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; Point points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2I (graphics, brush, points, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2I (graphics, brush, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2I (graphics, brush, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One. createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2I (graphics, brush, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Point zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillPolygon2I (graphics, brush, zeroPoints, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipFillPolygon2I (NULL, brush, points, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (NULL, brush, points, 1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (NULL, brush, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (NULL, brush, points, -1); assertEqualInt (status, OutOfMemory); status = GdipFillPolygon2I (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, NULL, points, 1); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, NULL, points, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillPolygon2I (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipFillPolygon2I (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, brush, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipFillPolygon2I (graphics, brush, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, brush, points, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillPolygon2I (graphics, brush, points, 3); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2I (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2I (graphics, NULL, points, 1); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2I (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, NULL, points, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillPolygon2I (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipFillPolygon2I (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, brush, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipFillPolygon2I (graphics, brush, points, 1); assertEqualInt (status, ObjectBusy); status = GdipFillPolygon2I (graphics, brush, points, 0); assertEqualInt (status, InvalidParameter); status = GdipFillPolygon2I (graphics, brush, points, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillRectangle () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangle (graphics, brush, 10, 20, 30, 40); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangle (graphics, brush, 0, 0, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangle (graphics, brush, 10, 20, -10, -20); assertEqualInt (status, Ok); // Negative tests. status = GdipFillRectangle (NULL, brush, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangle (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangle (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangle (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangle (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangle (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, brush, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillRectangleI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangleI (graphics, brush, 10, 20, 30, 40); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangleI (graphics, brush, 0, 0, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangleI (graphics, brush, 10, 20, -10, -20); assertEqualInt (status, Ok); // Negative tests. status = GdipFillRectangleI (NULL, brush, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangleI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangleI (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangleI (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangleI (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangleI (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillRectangleI (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, brush, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, brush, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangle (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipFillRectangleI (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillRectangles () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; RectF rectangles[] = { {10, 20, 30, 40}, {30, 40, 0, 0}, {100, 150, -20, -30}, {200, 200, 40, 50} }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangles (graphics, brush, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangles (graphics, brush, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangles (graphics, brush, rectangles, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangles (graphics, brush, rectangles, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. RectF zeroRectangles[] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectangles (graphics, brush, zeroRectangles, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipFillRectangles (NULL, brush, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (NULL, brush, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (NULL, brush, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, NULL, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, NULL, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, rectangles, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillRectangles (graphics, brush, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipFillRectangles (graphics, NULL, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipFillRectangles (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, NULL, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectangles (graphics, brush, rectangles, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } static void test_fillRectanglesI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpBrush *brush; Rect rectangles[] = { {10, 20, 30, 40}, {30, 40, 0, 0}, {100, 150, -20, -30}, {200, 200, 40, 50} }; GdipCreateSolidFill (0xFF00FFFF, (GpSolidFill **) &brush); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectanglesI (graphics, brush, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectanglesI (graphics, brush, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectanglesI (graphics, brush, rectangles, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One. createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectanglesI (graphics, brush, rectangles, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Rect zeroRectangles[] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipFillRectanglesI (graphics, brush, zeroRectangles, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipFillRectanglesI (NULL, brush, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (NULL, brush, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (NULL, brush, rectangles, -1); assertEqualInt (status, OutOfMemory); status = GdipFillRectanglesI (graphics, NULL, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, NULL, rectangles, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillRectanglesI (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); #endif status = GdipFillRectanglesI (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, brush, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipFillRectanglesI (graphics, brush, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, brush, rectangles, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFillRectanglesI (graphics, brush, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipFillRectanglesI (graphics, NULL, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipFillRectanglesI (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, NULL, rectangles, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipFillRectanglesI (graphics, brush, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, brush, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipFillRectanglesI (graphics, brush, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, brush, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipFillRectanglesI (graphics, brush, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipFillRectanglesI (graphics, brush, rectangles, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteBrush (brush); } int main (int argc, char**argv) { STARTUP; test_fillClosedCurve (); test_fillClosedCurveI (); test_fillClosedCurve2 (); test_fillClosedCurve2I (); test_fillEllipse (); test_fillEllipseI (); test_fillPath (); test_fillPie (); test_fillPieI (); test_fillPolygon (); test_fillPolygonI (); test_fillPolygon2 (); test_fillPolygon2I (); test_fillRectangle (); test_fillRectangleI (); test_fillRectangles (); test_fillRectanglesI (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testpathgradientbrush.c0000644000175000017500000023317313542674535023271 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void verifyPathGradientBrush (GpPathGradient *brush, REAL x, REAL y, REAL width, REAL height, ARGB centerColor, REAL centerX, REAL centerY, GpWrapMode expectedWrapMode) { assert (brush && "Expected the brush to be initialized."); GpStatus status; GpBrushType brushType; GpRectF rect; GpWrapMode wrapMode; GpMatrix *brushTransform; ARGB color; GpPointF centerPoint; GdipCreateMatrix (&brushTransform); status = GdipGetBrushType (brush, &brushType); assertEqualInt (brushType, BrushTypePathGradient); status = GdipGetPathGradientRect (brush, &rect); assertEqualInt (status, Ok); assertEqualFloat (rect.X, x); assertEqualFloat (rect.Y, y); assertEqualFloat (rect.Width, width); assertEqualFloat (rect.Height, height); status = GdipGetPathGradientCenterColor (brush, &color); assertEqualInt (status, Ok); assertEqualInt (color, centerColor); status = GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualInt (status, Ok); assertEqualFloat (centerPoint.X, centerX); assertEqualFloat (centerPoint.Y, centerY); status = GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (status, Ok); assertEqualInt (wrapMode, expectedWrapMode); status = GdipGetPathGradientTransform (brush, brushTransform); assertEqualInt (status, Ok); verifyMatrix (brushTransform, 1, 0, 0, 1, 0, 0); GdipDeleteMatrix (brushTransform); } static GpPointF threePoints[3] = { {3, 13}, {1, 2}, {5, 6} }; static void test_createPathGradient () { GpStatus status; GpPathGradient *brush; GpPointF points[2] = { {1, 2}, {-10, 11} }; GpPointF points3[3] = { {3, 13}, {1, 2}, {5, 6} }; GpPointF zeroWidthPoints[3] = { {1, 2}, {1, 4}, {1, 6} }; GpPointF zeroHeightPoints[3] = { {2, 1}, {4, 1}, {6, 1} }; // WrapModeClamp. status = GdipCreatePathGradient (points, 2, WrapModeClamp, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xff000000, -4.5, 6.5, WrapModeClamp); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipXY. status = GdipCreatePathGradient (points, 2, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xff000000, -4.5, 6.5, WrapModeTileFlipX); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipY. status = GdipCreatePathGradient (points, 2, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xff000000, -4.5, 6.5, WrapModeTileFlipY); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipX. status = GdipCreatePathGradient (points, 2, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xff000000, -4.5, 6.5, WrapModeTileFlipX); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTile. status = GdipCreatePathGradient (points3, 3, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, 1, 2, 4, 11, 0xff000000, 3, 7, WrapModeTile); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (NULL, 2, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (NULL, 1, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (NULL, 0, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (NULL, -1, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (NULL, 2, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroWidthPoints, 3, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroWidthPoints, 0, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroWidthPoints, -1, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroWidthPoints, 3, (WrapMode)(WrapModeClamp + 1), NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroWidthPoints, 3, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroHeightPoints, 3, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroHeightPoints, 0, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroHeightPoints, -1, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroHeightPoints, 3, (WrapMode)(WrapModeClamp + 1), NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (zeroHeightPoints, 3, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (points, 1, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (points, 0, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (points, -1, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (points, 2, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradient (points, 2, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); status = GdipCreatePathGradient (points, 2, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradient (points, 1, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradient (points, 0, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradient (points, -1, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradient (points, 2, (WrapMode)(WrapModeClamp + 1), NULL); assertEqualInt (status, InvalidParameter); } static void test_createPathGradientI () { GpStatus status; GpPathGradient *brush; GpPoint points[2] = { {1, 2}, {-10, 11} }; GpPoint points3[3] = { {3, 13}, {1, 2}, {5, 6} }; GpPoint zeroWidthPoints[3] = { {1, 2}, {1, 4}, {1, 6} }; GpPoint zeroHeightPoints[3] = { {2, 1}, {4, 1}, {6, 1} }; // WrapModeClamp. status = GdipCreatePathGradientI (points, 2, WrapModeClamp, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xFF000000, -4.5, 6.5, WrapModeClamp); GdipDeleteBrush (brush); // WrapModeTileFlipXY. status = GdipCreatePathGradientI (points, 2, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xFF000000, -4.5, 6.5, WrapModeTileFlipX); GdipDeleteBrush (brush); // WrapModeTileFlipY. status = GdipCreatePathGradientI (points, 2, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xFF000000, -4.5, 6.5, WrapModeTileFlipY); GdipDeleteBrush (brush); // WrapModeTileFlipX. status = GdipCreatePathGradientI (points, 2, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, -10, 2, 11, 9, 0xFF000000, -4.5, 6.5, WrapModeTileFlipX); GdipDeleteBrush (brush); // WrapModeTile. status = GdipCreatePathGradientI (points3, 3, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, 1, 2, 4, 11, 0xFF000000, 3, 7, WrapModeTile); // Negative tests. brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (NULL, 2, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (NULL, 1, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (NULL, 0, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (NULL, -1, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (NULL, 2, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroWidthPoints, 3, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroWidthPoints, 0, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroWidthPoints, -1, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroWidthPoints, 3, (WrapMode)(WrapModeClamp + 1), NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroWidthPoints, 3, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroHeightPoints, 3, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroHeightPoints, 0, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroHeightPoints, -1, WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroHeightPoints, 3, (WrapMode)(WrapModeClamp + 1), NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (zeroHeightPoints, 3, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (points, 1, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (points, 0, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (points, -1, WrapModeClamp, &brush); assertEqualInt (status, OutOfMemory); assert (brush == (GpPathGradient *) 0xCC); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (points, 2, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientI (points, 2, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); status = GdipCreatePathGradientI (points, 2, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradientI (points, 1, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradientI (points, 0, WrapModeClamp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradientI (points, -1, WrapModeClamp, NULL); assertEqualInt (status, OutOfMemory); status = GdipCreatePathGradientI (points, 2, (WrapMode)(WrapModeClamp + 1), NULL); assertEqualInt (status, InvalidParameter); } static void test_createPathGradientFromPath () { GpStatus status; GpPathGradient *brush; GpPath *linePath; GpPath *emptyPath; GdipCreatePath (FillModeWinding, &linePath); GdipAddPathRectangle (linePath, 10, 20, 30, 40); GdipCreatePath (FillModeWinding, &emptyPath); status = GdipCreatePathGradientFromPath (linePath, &brush); assertEqualInt (status, Ok); verifyPathGradientBrush (brush, 10, 20, 30, 40, 0xFFFFFFFF, 25, 40, WrapModeClamp); // Negative tests. brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientFromPath (NULL, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpPathGradient *) 0xCC; status = GdipCreatePathGradientFromPath (emptyPath, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); status = GdipCreatePathGradientFromPath (NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradientFromPath (linePath, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePathGradientFromPath (emptyPath, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (linePath); GdipDeletePath (emptyPath); } static void test_getPathGradientCenterColor () { GpStatus status; GpPathGradient *brush; ARGB centerColor; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Negative tests. status = GdipGetPathGradientCenterColor (NULL, ¢erColor); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientCenterColor (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientCenterColor () { GpStatus status; GpPathGradient *brush; ARGB centerColor; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipSetPathGradientCenterColor (brush, 0x01020304); assertEqualInt (status, Ok); GdipGetPathGradientCenterColor (brush, ¢erColor); assertEqualInt (centerColor, 0x01020304); // Negative tests. status = GdipSetPathGradientCenterColor (NULL, 0x01020304); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientSurroundColorCount () { GpStatus status; GpPath *path; GpPathGradient *brush; INT count; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 1, 2, 3, 4); // From three points. GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (status, Ok); assertEqualInt (count, 3); GdipDeleteBrush ((GpBrush *) brush); // From two points. GdipCreatePathGradient (threePoints, 2, WrapModeTileFlipXY, &brush); status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (status, Ok); assertEqualInt (count, 2); GdipDeleteBrush ((GpBrush *) brush); // From path. GdipCreatePathGradientFromPath (path, &brush); status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (status, Ok); assertEqualInt (count, 4); // Negative tests status = GdipGetPathGradientSurroundColorCount (NULL, &count); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientSurroundColorCount (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (path); } static void test_getPathGradientSurroundColorsWithCount () { GpStatus status; GpPath *path; GpPathGradient *brush; ARGB colors[5] = {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}; INT count = 3; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 1, 2, 3, 4); // From points. GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); assertEqualInt (colors[0], 0xFFFFFFFF); assertEqualInt (colors[1], 0xFFFFFFFF); assertEqualInt (colors[2], 0xFFFFFFFF); assertEqualInt (colors[3], 0x00000000); assertEqualInt (colors[4], 0x00000000); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; colors[4] = 0x00000000; // From path. GdipCreatePathGradientFromPath (path, &brush); count = 100; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); assertEqualInt (colors[0], 0xFFFFFFFF); assertEqualInt (colors[1], 0xFFFFFFFF); assertEqualInt (colors[2], 0xFFFFFFFF); assertEqualInt (colors[3], 0xFFFFFFFF); assertEqualInt (colors[4], 0x00000000); // Negative tests status = GdipGetPathGradientSurroundColorsWithCount (NULL, colors, &count); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientSurroundColorsWithCount (brush, NULL, &count); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, NULL); assertEqualInt (status, InvalidParameter); #endif count = 2; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); count = 1; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); count = 0; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); count = -1; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (path); } static void test_setPathGradientSurroundColorsWithCount () { GpStatus status; GpPath *path; GpPathGradient *brush; ARGB threeSurroundColors[3] = {0x0000001, 0x0000002, 0x0000003}; ARGB threeEmptyColors[3] = {0x00000000, 0x00000000, 0x00000000}; ARGB twoSameColors[2] = {0x0000001, 0x0000001}; ARGB colors[4] = {0x00000000, 0x00000000, 0x00000000, 0x00000000}; INT count = 3; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 1, 2, 3, 4); GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Three surround colors. status = GdipSetPathGradientSurroundColorsWithCount (brush, threeSurroundColors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 3); count = 0xFF; status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (count, 3); status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 3); assertEqualInt (colors[0], 0x000000001); assertEqualInt (colors[1], 0x000000002); assertEqualInt (colors[2], 0x000000003); assertEqualInt (colors[3], 0x000000000); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; // Same. status = GdipSetPathGradientSurroundColorsWithCount (brush, threeSurroundColors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 3); count = 0xFF; status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (count, 3); status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 3); assertEqualInt (colors[0], 0x000000001); assertEqualInt (colors[1], 0x000000002); assertEqualInt (colors[2], 0x000000003); assertEqualInt (colors[3], 0x000000000); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; // Two empty colors. count = 2; status = GdipSetPathGradientSurroundColorsWithCount (brush, threeEmptyColors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 2); count = 0xFF; status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (count, 3); count = 3; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); assertEqualInt (colors[0], 0x000000000); assertEqualInt (colors[1], 0x000000000); assertEqualInt (colors[2], 0x000000000); assertEqualInt (colors[3], 0x000000000); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; // Two same colors. count = 2; status = GdipSetPathGradientSurroundColorsWithCount (brush, twoSameColors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 2); count = 0xFF; status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (count, 3); count = 3; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); assertEqualInt (colors[0], 0x00000001); assertEqualInt (colors[1], 0x00000001); assertEqualInt (colors[2], 0x00000001); assertEqualInt (colors[3], 0x00000000); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; // One surround color. GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); count = 1; status = GdipSetPathGradientSurroundColorsWithCount (brush, threeSurroundColors, &count); assertEqualInt (status, Ok); count = 0xFF; status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (count, 3); count = 3; status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); assertEqualInt (colors[0], 0x00000001); assertEqualInt (colors[1], 0x00000001); assertEqualInt (colors[2], 0x00000001); assertEqualInt (colors[3], 0x00000000); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; GdipDeleteBrush ((GpBrush *) brush); // From path. GdipCreatePathGradientFromPath (path, &brush); status = GdipSetPathGradientSurroundColorsWithCount (brush, threeSurroundColors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); count = 0xFF; status = GdipGetPathGradientSurroundColorCount (brush, &count); assertEqualInt (count, 4); status = GdipGetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); assertEqualInt (colors[0], 0x00000001); assertEqualInt (colors[1], 0x00000001); assertEqualInt (colors[2], 0x00000001); assertEqualInt (colors[3], 0x00000001); colors[0] = 0x00000000; colors[1] = 0x00000000; colors[2] = 0x00000000; colors[3] = 0x00000000; GdipDeleteBrush ((GpBrush *) brush); // Negative tests. GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipSetPathGradientSurroundColorsWithCount (NULL, colors, &count); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientSurroundColorsWithCount (brush, NULL, &count); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipSetPathGradientSurroundColorsWithCount (brush, colors, NULL); assertEqualInt (status, InvalidParameter); #endif count = 4; status = GdipSetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); count = 0; status = GdipSetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); count = -1; status = GdipSetPathGradientSurroundColorsWithCount (brush, colors, &count); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (path); } static void test_getPathGradientPath () { GpStatus status; GpPathGradient *brush; GpPath *path; GdipCreatePath (FillModeAlternate, &path); GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientPath (brush, path); assertEqualInt (status, NotImplemented); status = GdipGetPathGradientPath (NULL, path); assertEqualInt (status, NotImplemented); status = GdipGetPathGradientPath (brush, NULL); assertEqualInt (status, NotImplemented); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (path); } static void test_setPathGradientPath () { GpStatus status; GpPathGradient *brush; GpPath *path; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreatePath (FillModeWinding, &path); status = GdipSetPathGradientPath (brush, path); assertEqualInt (status, NotImplemented); status = GdipSetPathGradientPath (NULL, path); assertEqualInt (status, NotImplemented); status = GdipSetPathGradientPath (brush, NULL); assertEqualInt (status, NotImplemented); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (path); } static void test_getPathGradientCenterPoint () { GpStatus status; GpPathGradient *brush; GpPointF centerPoint; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualInt (status, Ok); assertEqualFloat (centerPoint.X, 3); assertEqualFloat (centerPoint.Y, 7); status = GdipGetPathGradientCenterPoint (NULL, ¢erPoint); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientCenterPoint (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientCenterPointI () { GpStatus status; GpPathGradient *brush; GpPoint centerPoint; GpPointF roundUpPoints[3] = { {1, 2}, {8, 8}, {17, 10} }; // <= 0.5 is rounded down. GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientCenterPointI (brush, ¢erPoint); assertEqualInt (status, Ok); assertEqualInt (centerPoint.X, 3); assertEqualInt (centerPoint.Y, 7); GdipDeleteBrush ((GpBrush *) brush); // > 0.5 is rounded up. GdipCreatePathGradient (roundUpPoints, 3, WrapModeTileFlipXY, &brush); status = GdipGetPathGradientCenterPointI (brush, ¢erPoint); assertEqualInt (status, Ok); assertEqualInt (centerPoint.X, 9); assertEqualInt (centerPoint.Y, 7); // Negative tests. status = GdipGetPathGradientCenterPointI (NULL, ¢erPoint); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientCenterPointI (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientCenterPoint () { GpStatus status; GpPathGradient *brush; GpPointF point = {1, 2}; GpPointF outOfBoundsPoint = {100, 200}; GpPointF centerPoint; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Set within the bounds of the brush. status = GdipSetPathGradientCenterPoint (brush, &point); assertEqualInt (status, Ok); GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualFloat (centerPoint.X, 1); assertEqualFloat (centerPoint.Y, 2); // Set same. status = GdipSetPathGradientCenterPoint (brush, &point); assertEqualInt (status, Ok); GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualFloat (centerPoint.X, 1); assertEqualFloat (centerPoint.Y, 2); // Set outside the bounds of the brush. status = GdipSetPathGradientCenterPoint (brush, &outOfBoundsPoint); assertEqualInt (status, Ok); GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualFloat (centerPoint.X, 100); assertEqualFloat (centerPoint.Y, 200); // Negative tests. status = GdipSetPathGradientCenterPoint (NULL, &point); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientCenterPoint (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientCenterPointI () { GpStatus status; GpPathGradient *brush; GpPoint point = {1, 2}; GpPoint outOfBoundsPoint = {100, 200}; GpPointF centerPoint; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Set within the bounds of the brush. status = GdipSetPathGradientCenterPointI (brush, &point); assertEqualInt (status, Ok); GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualFloat (centerPoint.X, 1); assertEqualFloat (centerPoint.Y, 2); // Set same. status = GdipSetPathGradientCenterPointI (brush, &point); assertEqualInt (status, Ok); GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualFloat (centerPoint.X, 1); assertEqualFloat (centerPoint.Y, 2); // Set outside the bounds of the brush. status = GdipSetPathGradientCenterPointI (brush, &outOfBoundsPoint); assertEqualInt (status, Ok); GdipGetPathGradientCenterPoint (brush, ¢erPoint); assertEqualFloat (centerPoint.X, 100); assertEqualFloat (centerPoint.Y, 200); // Negative tests. status = GdipSetPathGradientCenterPointI (NULL, &point); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientCenterPointI (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientRect () { GpStatus status; GpPathGradient *brush; GpRectF rect; GpPointF points[2] = { {1.5, 2.5}, {5, 7} }; GdipCreatePathGradient (points, 2, WrapModeTileFlipX, &brush); status = GdipGetPathGradientRect (brush, &rect); assertEqualInt (status, Ok); assertEqualFloat (rect.X, 1.5); assertEqualFloat (rect.Y, 2.5); assertEqualFloat (rect.Width, 3.5); assertEqualFloat (rect.Height, 4.5); // Negative tests. status = GdipGetPathGradientRect (NULL, &rect); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientRect (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientRectI () { GpStatus status; GpPathGradient *brush; GpRect rect; GpPointF points1[2] = { {1.6f, 2.6f}, {5.2f, 7.2f} }; GpPointF points2[2] = { {1.5f, 2.5f}, {5, 7} }; GpPointF points3[2] = { {1.4f, 2.4f}, {4.8f, 6.8f} }; // > 0.5 is rounded up. GdipCreatePathGradient (points1, 2, WrapModeTileFlipX, &brush); status = GdipGetPathGradientRectI (brush, &rect); assertEqualInt (status, Ok); assertEqualInt (rect.X, 2); assertEqualInt (rect.Y, 3); assertEqualInt (rect.Width, 4); assertEqualInt (rect.Height, 5); GdipDeleteBrush ((GpBrush *) brush); // 0.5 is rounded up. GdipCreatePathGradient (points2, 2, WrapModeTileFlipX, &brush); status = GdipGetPathGradientRectI (brush, &rect); assertEqualInt (status, Ok); assertEqualInt (rect.X, 2); assertEqualInt (rect.Y, 3); assertEqualInt (rect.Width, 4); assertEqualInt (rect.Height, 5); GdipDeleteBrush ((GpBrush *) brush); // < 0.5 is rounded down. GdipCreatePathGradient (points3, 2, WrapModeTileFlipX, &brush); status = GdipGetPathGradientRectI (brush, &rect); assertEqualInt (status, Ok); assertEqualInt (rect.X, 1); assertEqualInt (rect.Y, 2); assertEqualInt (rect.Width, 3); assertEqualInt (rect.Height, 4); // Negative tests. status = GdipGetPathGradientRectI (NULL, &rect); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientRectI (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientPointCount () { GpStatus status; GpPathGradient *brush; INT pointCount; GpPath *path; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 1, 2, 3, 4); // From points. GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientPointCount (brush, &pointCount); assertEqualInt (status, Ok); assertEqualInt (pointCount, 3); GdipDeleteBrush ((GpBrush *) brush); // From path. GdipCreatePathGradientFromPath (path, &brush); status = GdipGetPathGradientPointCount (brush, &pointCount); assertEqualInt (status, Ok); assertEqualInt (pointCount, 4); // Negative tests. status = GdipGetPathGradientPointCount (NULL, &pointCount); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPointCount (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeletePath (path); } static void test_setPathGradientGammaCorrection () { GpStatus status; GpPathGradient *brush; BOOL useGammaCorrection; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Set true. status = GdipSetPathGradientGammaCorrection (brush, TRUE); assertEqualInt (status, Ok); GdipGetPathGradientGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == TRUE); // Set same. status = GdipSetPathGradientGammaCorrection (brush, TRUE); assertEqualInt (status, Ok); GdipGetPathGradientGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == TRUE); // Set false. status = GdipSetPathGradientGammaCorrection (brush, FALSE); assertEqualInt (status, Ok); GdipGetPathGradientGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == FALSE); // Negative tests. status = GdipSetPathGradientGammaCorrection (NULL, TRUE); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientGammaCorrection () { GpStatus status; GpPathGradient *brush; BOOL useGammaCorrection; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == FALSE); // Negative tests. status = GdipGetPathGradientGammaCorrection (NULL, &useGammaCorrection); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientGammaCorrection (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientBlendCount () { GpStatus status; GpPathGradient *brush; INT blendCount; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientBlendCount (brush, &blendCount); assertEqualInt (blendCount, 1); // Negative tests. status = GdipGetPathGradientBlendCount (NULL, &blendCount); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientBlendCount (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void fill_array (REAL *array, INT count, REAL value) { for (int i = 0; i < count; i++) array[i] = value; } static void test_getPathGradientBlend () { GpStatus status; GpPathGradient *brush; REAL blend[3]; REAL positions[3]; REAL threeBlends[3] = {1, 2, 3}; REAL threePositions[3] = {0, 0.5, 1}; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Default blend - equal count. fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetPathGradientBlend (brush, blend, positions, 1); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 123); assertEqualFloat (blend[2], 123); // Positions are meaningless for blends with a count of 1 so this parameter is ignored. assertEqualFloat (positions[0], 123); assertEqualFloat (positions[1], 123); assertEqualFloat (positions[2], 123); // Default blend - larger count. fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetPathGradientBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 123); assertEqualFloat (blend[2], 123); // Positions are meaningless for blends with a count of 1 so this parameter is ignored. assertEqualFloat (positions[0], 123); assertEqualFloat (positions[1], 123); assertEqualFloat (positions[2], 123); // Negative tests. GdipSetPathGradientBlend (brush, threeBlends, threePositions, 3); status = GdipGetPathGradientBlend (brush, blend, positions, 1); assertEqualInt (status, InsufficientBuffer); status = GdipGetPathGradientBlend (NULL, blend, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientBlend (brush, NULL, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientBlend (brush, blend, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientBlend (brush, blend, positions, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientBlend (brush, blend, positions, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientBlend () { GpStatus status; GpPathGradient *brush; REAL blend[3]= {1, 2, 3}; REAL positions[3] = {0, 0.5f, 1.0f}; REAL twoBlends[2] = {1, 2}; REAL twoPositions[2] = {0, 1}; REAL threeBlends[3] = {1, 2, 3}; REAL threePositions[3] = {0, 0.5, 1}; REAL oneBlend[1] = {10}; REAL onePosition[1] = {-12}; ARGB pathPresetBlend[3] = {1, 2, 3}; REAL pathPresetPositions[3] = {0, 0.5f, 1.0f}; INT presetBlendCount; REAL invalidPositions1[2] = {0.5, 1}; REAL invalidPositions2[2] = {0, 0.5}; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Two blends - equal count. status = GdipSetPathGradientBlend (brush, twoBlends, twoPositions, 2); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetPathGradientBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 2); assertEqualFloat (blend[2], 123); assertEqualFloat (positions[0], 0); assertEqualFloat (positions[1], 1); assertEqualFloat (positions[2], 123); // Set same. status = GdipSetPathGradientBlend (brush, twoBlends, twoPositions, 2); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetPathGradientBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 2); assertEqualFloat (blend[2], 123); assertEqualFloat (positions[0], 0); assertEqualFloat (positions[1], 1); assertEqualFloat (positions[2], 123); // Three blends - equal count. status = GdipSetPathGradientBlend (brush, threeBlends, threePositions, 3); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetPathGradientBlend (brush, blend, positions, 3); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 2); assertEqualFloat (blend[2], 3); assertEqualFloat (positions[0], 0); assertEqualFloat (positions[1], 0.5); assertEqualFloat (positions[2], 1); // One blend - equal count. status = GdipSetPathGradientBlend (brush, oneBlend, onePosition, 1); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetPathGradientBlend (brush, blend, positions, 1); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 10); assertEqualFloat (blend[1], 123); assertEqualFloat (blend[2], 123); assertEqualFloat (positions[0], 123); assertEqualFloat (positions[1], 123); assertEqualFloat (positions[2], 123); // Should clear the existing blend. status = GdipSetPathGradientPresetBlend (brush, pathPresetBlend, pathPresetPositions, 3); assertEqualInt (status, Ok); status = GdipSetPathGradientBlend (brush, threeBlends, threePositions, 3); assertEqualInt (status, Ok); status = GdipGetPathGradientPresetBlendCount (brush, &presetBlendCount); assertEqualInt (status, Ok); assertEqualInt (presetBlendCount, 0); // Negative tests. status = GdipSetPathGradientBlend (NULL, threeBlends, threePositions, 3); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientBlend (brush, NULL, threePositions, 3); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientBlend (brush, threeBlends, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientBlend (brush, twoBlends, invalidPositions1, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientBlend (brush, twoBlends, invalidPositions2, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientBlend (brush, threeBlends, threePositions, 0); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientBlend (brush, threeBlends, threePositions, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientPresetBlendCount () { GpStatus status; GpPathGradient *brush; INT blendCount; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientPresetBlendCount (brush, &blendCount); assertEqualInt (status, Ok); assertEqualInt (blendCount, 0); // Negative tests. status = GdipGetPathGradientPresetBlendCount (NULL, &blendCount); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlendCount (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientPresetBlend () { GpStatus status; GpPathGradient *brush; ARGB blend[2]; REAL positions[2]; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Negative tests. status = GdipGetPathGradientPresetBlend (brush, blend, positions, 2); assertEqualInt (status, GenericError); status = GdipGetPathGradientPresetBlend (NULL, blend, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, NULL, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, blend, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, blend, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, blend, positions, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, blend, positions, -1); assertEqualInt (status, OutOfMemory); status = GdipGetPathGradientPresetBlend (NULL, blend, positions, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, NULL, positions, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientPresetBlend (brush, blend, NULL, -1); assertEqualInt (status, OutOfMemory); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientPresetBlend () { GpStatus status; GpPathGradient *brush; ARGB blend2[2] = {1, 0}; REAL positions2[2] = {0, 1.0f}; ARGB destBlend2[2]; REAL destPositions2[2]; ARGB blend3[3] = {1, 2, 3}; REAL positions3[3] = {0, 0.5f, 1.0f}; ARGB destBlend3[3]; REAL destPositions3[3]; #if !defined(USE_WINDOWS_GDIPLUS) REAL destBlendReal[2]; REAL destPositionsReal[2]; #endif REAL invalidPositions1[2] = {0.5, 1}; REAL invalidPositions2[2] = {0, 0.5}; REAL pathBlend[3] = {1, 2, 3}; REAL pathPositions[3] = {0, 2, 1}; INT blendCount; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Count of 2. status = GdipSetPathGradientPresetBlend (brush, blend2, positions2, 2); assertEqualInt (status, Ok); status = GdipGetPathGradientPresetBlend (brush, destBlend2, destPositions2, 2); assertEqualInt (status, Ok); assertEqualInt (destBlend2[0], 1); assertEqualInt (destBlend2[1], 0); assertEqualFloat (destPositions2[0], 0); assertEqualFloat (destPositions2[1], 1); // Same. status = GdipSetPathGradientPresetBlend (brush, blend2, positions2, 2); assertEqualInt (status, Ok); status = GdipGetPathGradientPresetBlend (brush, destBlend2, destPositions2, 2); assertEqualInt (status, Ok); assertEqualInt (destBlend2[0], 1); assertEqualInt (destBlend2[1], 0); assertEqualFloat (destPositions2[0], 0); assertEqualFloat (destPositions2[1], 1); // Count of 3. status = GdipSetPathGradientPresetBlend (brush, blend3, positions3, 3); assertEqualInt (status, Ok); status = GdipGetPathGradientPresetBlend (brush, destBlend3, destPositions3, 3); assertEqualInt (status, Ok); assertEqualInt (destBlend3[0], 1); assertEqualInt (destBlend3[1], 2); assertEqualInt (destBlend3[2], 3); assertEqualFloat (destPositions3[0], 0); assertEqualFloat (destPositions3[1], 0.5); assertEqualFloat (destPositions3[2], 1); // Should clear the existing blend. status = GdipSetPathGradientBlend (brush, pathBlend, pathPositions, 3); assertEqualInt (status, Ok); status = GdipSetPathGradientPresetBlend (brush, destBlend2, destPositions2, 2); assertEqualInt (status, Ok); status = GdipGetPathGradientBlendCount (brush, &blendCount); assertEqualInt (status, Ok); // GDI+ has a bug where it sets the blend and positions to NULL but incorrectly // decrements blendCount, instead of setting it to zero. // This causes GDI+ to crash. This is a bug we don't want to replicate. #if !defined(USE_WINDOWS_GDIPLUS) assertEqualInt (blendCount, 0); status = GdipGetPathGradientBlend(brush, destBlendReal, destPositionsReal, blendCount); assertEqualInt(status, InvalidParameter); #endif // Negative tests. status = GdipSetPathGradientPresetBlend (NULL, blend3, positions3, 3); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientPresetBlend (brush, NULL, positions3, 3); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipSetPathGradientPresetBlend (brush, blend3, NULL, 3); assertEqualInt (status, InvalidParameter); #endif status = GdipSetPathGradientPresetBlend (brush, blend2, invalidPositions1, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientPresetBlend (brush, blend2, invalidPositions2, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientPresetBlend (brush, blend3, positions3, 1); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientPresetBlend (brush, blend3, positions3, 0); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientPresetBlend (brush, blend3, positions3, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientSigmaBlend () { GpStatus status; GpPathGradient *brush; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipSetPathGradientSigmaBlend (brush, 0, 0.5f); assertEqualInt (status, Ok); status = GdipSetPathGradientSigmaBlend (brush, 0.5f, 1); assertEqualInt (status, Ok); status = GdipSetPathGradientSigmaBlend (brush, 1, 0); assertEqualInt (status, Ok); // Negative tests. status = GdipSetPathGradientSigmaBlend (NULL, 0.5f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientSigmaBlend (brush, -0.01f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientSigmaBlend (brush, 1.01f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientSigmaBlend (brush, 0.5f, -0.01f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientSigmaBlend (brush, 0.5f, 1.01f); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientLinearBlend () { GpStatus status; GpPathGradient *brush; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipSetPathGradientLinearBlend (brush, 0, 0.5f); assertEqualInt (status, Ok); status = GdipSetPathGradientLinearBlend (brush, 0.5f, 1); assertEqualInt (status, Ok); status = GdipSetPathGradientLinearBlend (brush, 1, 0); assertEqualInt (status, Ok); // Negative tests. status = GdipSetPathGradientLinearBlend (NULL, 0.5f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientLinearBlend (brush, -0.01f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientLinearBlend (brush, 1.01f, 0.5); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientLinearBlend (brush, 0.5f, -0.01f); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientLinearBlend (brush, 0.5f, 1.01f); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientWrapMode () { GpStatus status; GpPathGradient *brush; GpWrapMode wrapMode; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Negative tests. status = GdipGetPathGradientWrapMode (NULL, &wrapMode); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientWrapMode (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientWrapMode () { GpStatus status; GpPathGradient *brush; GpWrapMode wrapMode; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // WrapModeTile. status = GdipSetPathGradientWrapMode (brush, WrapModeTile); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTile); // Same. status = GdipSetPathGradientWrapMode (brush, WrapModeTile); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTile); // WrapModeTileFlipX. status = GdipSetPathGradientWrapMode (brush, WrapModeTileFlipX); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipX); // WrapModeTileFlipX. status = GdipSetPathGradientWrapMode (brush, WrapModeTileFlipY); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipY); // WrapModeTileFlipXY. status = GdipSetPathGradientWrapMode (brush, WrapModeTileFlipXY); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipXY); // WrapModeClamp. status = GdipSetPathGradientWrapMode (brush, WrapModeClamp); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeClamp); // Invalid WrapMode - nop. status = GdipSetPathGradientWrapMode (brush, (WrapMode)(WrapModeClamp + 1)); assertEqualInt (status, Ok); GdipGetPathGradientWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeClamp); // Negative tests. status = GdipSetPathGradientWrapMode (NULL, WrapModeTile); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getPathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *transform; ARGB blend[2] = {1, 0}; REAL positions[2] = {0, 1.0f}; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix (&transform); // With no preset blend. status = GdipGetPathGradientTransform (brush, transform); assertEqualInt (status, Ok); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // With preset blend. GdipSetPathGradientPresetBlend (brush, blend, positions, 2); status = GdipGetPathGradientTransform (brush, transform); assertEqualInt (status, Ok); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // Negative tests. status = GdipGetPathGradientTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientTransform (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (transform); } static void test_setPathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; ARGB blend[2] = {1, 0}; REAL positions[2] = {0, 1.0f}; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); // With no preset blend. status = GdipSetPathGradientTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Same. status = GdipSetPathGradientTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Changing the original transform should not modify the brush's transform. GdipSetMatrixElements (matrix, 2, 3, 4, 5, 6, 7); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // With preset blend. GdipSetPathGradientPresetBlend (brush, blend, positions, 2); status = GdipSetPathGradientTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 2, 3, 4, 5, 6, 7); // Negative tests. status = GdipSetPathGradientTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientTransform (brush, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPathGradientTransform (brush, nonInvertibleMatrix); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (matrix); GdipDeleteMatrix (transform); } static void test_resetPathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *matrix; GpMatrix *transform; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix (&transform); GdipSetPathGradientTransform (brush, matrix); status = GdipResetPathGradientTransform (brush); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // Negative tests. status = GdipResetPathGradientTransform (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (matrix); } static void test_multiplyPathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *originalTransform; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix2 (2, 3, 4, 5, 6, 7, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipMultiplyPathGradientTransform (brush, matrix, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // MatrixOrderPrepend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipMultiplyPathGradientTransform (brush, matrix, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Null matrix - nop. status = GdipMultiplyPathGradientTransform (brush, NULL, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Invalid MatrixOrder - negative. GdipSetPathGradientTransform (brush, originalTransform); status = GdipMultiplyPathGradientTransform (brush, matrix, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Invalid MatrixOrder - positive. GdipSetPathGradientTransform (brush, originalTransform); status = GdipMultiplyPathGradientTransform (brush, matrix, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Negative tests. status = GdipMultiplyPathGradientTransform (NULL, matrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipMultiplyPathGradientTransform (brush, nonInvertibleMatrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDeleteMatrix (transform); } static void test_translatePathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *originalTransform; GpMatrix *transform; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipTranslatePathGradientTransform (brush, 5, 6, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 10, 12); // MatrixOrderPrepend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipTranslatePathGradientTransform (brush, 5, 6, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 28, 40); // Negative tests. status = GdipTranslatePathGradientTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipTranslatePathGradientTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipTranslatePathGradientTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_scalePathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *originalTransform; GpMatrix *transform; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipScalePathGradientTransform (brush, 0.5, 0.75, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 0.5, 1.5, 1.5, 3, 2.5, 4.5); // MatrixOrderPrepend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipScalePathGradientTransform (brush, 0.5, 0.75, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 0.5, 1, 2.25, 3, 5, 6); // Negative tests. status = GdipScalePathGradientTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipScalePathGradientTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipScalePathGradientTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_rotatePathGradientTransform () { GpStatus status; GpPathGradient *brush; GpMatrix *originalTransform; GpMatrix *transform; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipRotatePathGradientTransform (brush, 90, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, -2, 1, -4, 3, -6, 5); // MatrixOrderPrepend. GdipSetPathGradientTransform (brush, originalTransform); status = GdipRotatePathGradientTransform (brush, 90, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPathGradientTransform (brush, transform); verifyMatrix (transform, 3, 4, -1, -2, 5, 6); // Negative tests. status = GdipRotatePathGradientTransform (NULL, 90, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipRotatePathGradientTransform (brush, 90, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipRotatePathGradientTransform (brush, 90, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_getPathGradientFocusScales () { GpStatus status; GpPathGradient *brush; REAL xScale; REAL yScale; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipGetPathGradientFocusScales (brush, &xScale, &yScale); assertEqualInt (status, Ok); assertEqualFloat (xScale, 0); assertEqualFloat (yScale, 0); // Negative tests. status = GdipGetPathGradientFocusScales (NULL, &xScale, &yScale); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientFocusScales (NULL, &xScale, &yScale); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientFocusScales (brush, NULL, &yScale); assertEqualInt (status, InvalidParameter); status = GdipGetPathGradientFocusScales (brush, &xScale, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setPathGradientFocusScales () { GpStatus status; GpPathGradient *brush; REAL xScale; REAL yScale; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); // Positive. status = GdipSetPathGradientFocusScales (brush, 1, 2); assertEqualInt (status, Ok); GdipGetPathGradientFocusScales (brush, &xScale, &yScale); assertEqualFloat (xScale, 1); assertEqualFloat (yScale, 2); // Same. status = GdipSetPathGradientFocusScales (brush, 1, 2); assertEqualInt (status, Ok); GdipGetPathGradientFocusScales (brush, &xScale, &yScale); assertEqualFloat (xScale, 1); assertEqualFloat (yScale, 2); // Zero. status = GdipSetPathGradientFocusScales (brush, 0, 0); assertEqualInt (status, Ok); GdipGetPathGradientFocusScales (brush, &xScale, &yScale); assertEqualFloat (xScale, 0); assertEqualFloat (yScale, 0); // Negative, status = GdipSetPathGradientFocusScales (brush, -1, -2); assertEqualInt (status, Ok); GdipGetPathGradientFocusScales (brush, &xScale, &yScale); assertEqualFloat (xScale, -1); assertEqualFloat (yScale, -2); // Negative tests. status = GdipSetPathGradientFocusScales (NULL, 0, 0); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_cloneWithPoints () { GpStatus status; GpPathGradient *brush; GpBrush *clonedBrush; GpBrushType brushType; GpWrapMode wrapMode; REAL xScale; REAL yScale; ARGB centerColor; GpPointF centerPoint; GpRectF rect; INT pointCount; REAL blend[2] = {1, 2}; REAL positions[2] = {0, 1}; INT blendCount; REAL blendResult[2]; REAL positionsResult[2]; BOOL useGammaCorrection; GpMatrix *transform; GpMatrix *matrix; INT surroundColorsCount = 3; ARGB surroundColors[3] = {1, 2, 3}; ARGB surroundColorsResult[3]; GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); GdipCreateMatrix (&matrix); GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipSetPathGradientFocusScales (brush, 1, 2); assertEqualInt (status, Ok); status = GdipSetPathGradientCenterColor (brush, 3); assertEqualInt (status, Ok); status = GdipSetPathGradientBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); status = GdipSetPathGradientGammaCorrection (brush, TRUE); assertEqualInt (status, Ok); status = GdipSetPathGradientTransform (brush, transform); assertEqualInt (status, Ok); status = GdipSetPathGradientSurroundColorsWithCount (brush, surroundColors, &surroundColorsCount); assertEqualInt (status, Ok); status = GdipCloneBrush ((GpBrush *) brush, &clonedBrush); assertEqualInt (status, Ok); assert (clonedBrush && clonedBrush != brush); status = GdipGetBrushType (clonedBrush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypePathGradient); status = GdipGetPathGradientWrapMode ((GpPathGradient *) clonedBrush, &wrapMode); assertEqualInt (status, Ok); assertEqualInt (wrapMode, WrapModeTileFlipX); status = GdipGetPathGradientFocusScales ((GpPathGradient *) clonedBrush, &xScale, &yScale); assertEqualInt (status, Ok); assertEqualFloat (xScale, 1); assertEqualFloat (yScale, 2); status = GdipGetPathGradientCenterColor ((GpPathGradient *) clonedBrush, ¢erColor); assertEqualInt (status, Ok); assertEqualInt (centerColor, 3); status = GdipGetPathGradientCenterPoint ((GpPathGradient *) clonedBrush, ¢erPoint); assertEqualInt (status, Ok); assertEqualFloat (centerPoint.X, 3); assertEqualFloat (centerPoint.Y, 7); status = GdipGetPathGradientRect ((GpPathGradient *) clonedBrush, &rect); assertEqualInt (status, Ok); assertEqualFloat (rect.X, 1); assertEqualFloat (rect.Y, 2); assertEqualFloat (rect.Width, 4); assertEqualFloat (rect.Height, 11); status = GdipGetPathGradientPointCount ((GpPathGradient *) clonedBrush, &pointCount); assertEqualInt (pointCount, 3); status = GdipGetPathGradientBlendCount ((GpPathGradient *) clonedBrush, &blendCount); assertEqualInt (status, Ok); assertEqualInt (blendCount, 2); status = GdipGetPathGradientBlend ((GpPathGradient *) clonedBrush, blendResult, positionsResult, 2); assertEqualInt (status, Ok); assertEqualFloat (blendResult[0], 1); assertEqualFloat (blendResult[1], 2); assertEqualFloat (positionsResult[0], 0); assertEqualFloat (positionsResult[1], 1); status = GdipGetPathGradientGammaCorrection ((GpPathGradient *) clonedBrush, &useGammaCorrection); assertEqualInt (status, Ok); assert (useGammaCorrection == TRUE); status = GdipGetPathGradientTransform ((GpPathGradient *) clonedBrush, matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); status = GdipGetPathGradientSurroundColorCount (brush, &surroundColorsCount); assertEqualInt (status, Ok); assertEqualInt (surroundColorsCount, 3); status = GdipGetPathGradientSurroundColorsWithCount (brush, surroundColorsResult, &surroundColorsCount); assertEqualInt (status, Ok); assertEqualInt (surroundColorsResult[0], 1); assertEqualInt (surroundColorsResult[1], 2); assertEqualInt (surroundColorsResult[2], 3); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteBrush ((GpBrush *) clonedBrush); GdipDeleteMatrix (transform); GdipDeleteMatrix (matrix); } static void test_cloneWithPath () { GpStatus status; GpPathGradient *brush; GpBrush *clonedBrush; GpBrushType brushType; GpWrapMode wrapMode; REAL xScale; REAL yScale; ARGB centerColor; GpPointF centerPoint; GpRectF rect; INT pointCount; REAL blend[2] = {1, 2}; REAL positions[2] = {0, 1}; INT blendCount; REAL blendResult[2]; REAL positionsResult[2]; BOOL useGammaCorrection; GpMatrix *transform; GpMatrix *matrix; INT surroundColorsCount = 4; ARGB surroundColors[4] = {1, 2, 3, 4}; ARGB surroundColorsResult[4]; GpPath *path; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 1, 2, 4, 11); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); GdipCreateMatrix (&matrix); GdipCreatePathGradientFromPath (path, &brush); status = GdipSetPathGradientFocusScales (brush, 1, 2); assertEqualInt (status, Ok); status = GdipSetPathGradientCenterColor (brush, 3); assertEqualInt (status, Ok); status = GdipSetPathGradientBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); status = GdipSetPathGradientGammaCorrection (brush, TRUE); assertEqualInt (status, Ok); status = GdipSetPathGradientTransform (brush, transform); assertEqualInt (status, Ok); status = GdipSetPathGradientSurroundColorsWithCount (brush, surroundColors, &surroundColorsCount); assertEqualInt (status, Ok); status = GdipCloneBrush ((GpBrush *) brush, &clonedBrush); assertEqualInt (status, Ok); assert (clonedBrush && clonedBrush != brush); status = GdipGetBrushType (clonedBrush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypePathGradient); status = GdipGetPathGradientWrapMode ((GpPathGradient *) clonedBrush, &wrapMode); assertEqualInt (status, Ok); assertEqualInt (wrapMode, WrapModeClamp); status = GdipGetPathGradientFocusScales ((GpPathGradient *) clonedBrush, &xScale, &yScale); assertEqualInt (status, Ok); assertEqualFloat (xScale, 1); assertEqualFloat (yScale, 2); status = GdipGetPathGradientCenterColor ((GpPathGradient *) clonedBrush, ¢erColor); assertEqualInt (status, Ok); assertEqualInt (centerColor, 3); status = GdipGetPathGradientCenterPoint ((GpPathGradient *) clonedBrush, ¢erPoint); assertEqualInt (status, Ok); assertEqualFloat (centerPoint.X, 3); assertEqualFloat (centerPoint.Y, 7.5); status = GdipGetPathGradientRect ((GpPathGradient *) clonedBrush, &rect); assertEqualInt (status, Ok); assertEqualFloat (rect.X, 1); assertEqualFloat (rect.Y, 2); assertEqualFloat (rect.Width, 4); assertEqualFloat (rect.Height, 11); status = GdipGetPathGradientPointCount ((GpPathGradient *) clonedBrush, &pointCount); assertEqualInt (status, Ok); assertEqualInt (pointCount, 4); status = GdipGetPathGradientBlendCount ((GpPathGradient *) clonedBrush, &blendCount); assertEqualInt (status, Ok); assertEqualInt (blendCount, 2); status = GdipGetPathGradientBlend ((GpPathGradient *) clonedBrush, blendResult, positionsResult, 2); assertEqualInt (status, Ok); assertEqualFloat (blendResult[0], 1); assertEqualFloat (blendResult[1], 2); assertEqualFloat (positionsResult[0], 0); assertEqualFloat (positionsResult[1], 1); status = GdipGetPathGradientGammaCorrection ((GpPathGradient *) clonedBrush, &useGammaCorrection); assertEqualInt (status, Ok); assert (useGammaCorrection == TRUE); status = GdipGetPathGradientTransform ((GpPathGradient *) clonedBrush, matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); status = GdipGetPathGradientSurroundColorCount (brush, &surroundColorsCount); assertEqualInt (status, Ok); assertEqualInt (surroundColorsCount, 4); status = GdipGetPathGradientSurroundColorsWithCount (brush, surroundColorsResult, &surroundColorsCount); assertEqualInt (status, Ok); assertEqualInt (surroundColorsResult[0], 1); assertEqualInt (surroundColorsResult[1], 2); assertEqualInt (surroundColorsResult[2], 3); assertEqualInt (surroundColorsResult[3], 4); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteBrush ((GpBrush *) clonedBrush); GdipDeleteMatrix (transform); GdipDeleteMatrix (matrix); } static void test_delete () { GpStatus status; GpPathGradient *brush; GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &brush); status = GdipDeleteBrush ((GpBrush *) brush); assertEqualInt (status, Ok); } int main (int argc, char**argv) { STARTUP; test_createPathGradient (); test_createPathGradientI (); test_createPathGradientFromPath (); test_getPathGradientCenterColor (); test_setPathGradientCenterColor (); test_getPathGradientSurroundColorCount (); test_getPathGradientSurroundColorsWithCount (); test_setPathGradientSurroundColorsWithCount (); test_getPathGradientTransform (); test_getPathGradientPath (); test_setPathGradientPath (); test_getPathGradientCenterPoint (); test_getPathGradientCenterPointI (); test_setPathGradientCenterPoint (); test_setPathGradientCenterPointI (); test_getPathGradientRect (); test_getPathGradientRectI (); test_getPathGradientPointCount (); test_setPathGradientGammaCorrection (); test_getPathGradientGammaCorrection (); test_getPathGradientBlendCount (); test_getPathGradientBlend (); test_setPathGradientBlend (); test_getPathGradientPresetBlendCount (); test_getPathGradientPresetBlend (); test_setPathGradientPresetBlend (); test_setPathGradientSigmaBlend (); test_setPathGradientLinearBlend (); test_getPathGradientWrapMode (); test_setPathGradientWrapMode (); test_setPathGradientTransform (); test_resetPathGradientTransform (); test_multiplyPathGradientTransform (); test_translatePathGradientTransform (); test_scalePathGradientTransform (); test_rotatePathGradientTransform (); test_getPathGradientFocusScales (); test_setPathGradientFocusScales (); test_cloneWithPoints (); test_cloneWithPath (); test_delete (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testtext.c0000644000175000017500000003211613542674535020531 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" #if !defined(USE_WINDOWS_GDIPLUS) #include "../config.h" #endif #define ok(expected, ...) if (!(expected)) { printf(__VA_ARGS__); assert(expected); } #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (INT)(expected), (INT)(got)) #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001) #define set_rect_empty(r) (r)->X = (r)->Y = (r)->Width = (r)->Height = 0 #if defined USE_PANGO_RENDERING || defined(USE_WINDOWS_GDIPLUS) static void test_measure_string(void) { GpStringFormat *format; GpImage *image; GpGraphics *graphics; GpFontFamily *family; GpFont *font; GpStatus status; GpRectF rect, bounds, saved_bounds; const WCHAR teststring1[] = { 'M', '\n', '\n', 'M', 0 }; const WCHAR teststring2[] = { ' ', L'\u2003', ' ', 0 }; // Space, em space, space const WCHAR teststring3[] = { L'\u2003', L'\u2003', L'\u2003', 0 }; // em spaces const WCHAR teststringdots[] = { 't','h','i','s',' ','i','s',' ','r','e','a','l','l','y',' ','l','o','n','g',' ','t','e','x','t','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','w','i','t','h',' ','a',' ','l','o','t',' ','o',' ','p','e','r','i','o','d','s','.' }; int glyphs; int lines; const SHORT fontSize = 10; status = GdipCreateStringFormat (0, 0, &format); expect (Ok, status); status = GdipGetGenericFontFamilySansSerif (&family); expect (Ok, status); status = GdipCreateFont (family, fontSize, FontStyleRegular, UnitPixel, &font); expect (Ok, status); status = GdipCreateBitmapFromScan0 (400, 400, 0, PixelFormat32bppRGB, NULL, (GpBitmap **) &image); expect (Ok, status); status = GdipGetImageGraphicsContext (image, &graphics); expect (Ok, status); ok (graphics != NULL, "Expected graphics to be initialized\n"); rect.X = 5.0; rect.Y = 5.0; rect.Width = 200.0; rect.Height = 200.0; set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 1, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expectf (5.0, bounds.X); expectf (5.0, bounds.Y); expect (1, glyphs); expect (1, lines); // New lines count as fitted code points set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 2, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (2, glyphs); expect (1, lines); saved_bounds = bounds; // Multiple new lines are counted as code points and lines set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 3, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (3, glyphs); expect (2, lines); // ...and lastly check the correct results for adding another character past the last new line set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 4, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (4, glyphs); expect (3, lines); // Attempt to fit 2 glyphs / 1 line into a bounding box from 2 glyphs / 1 line rect = saved_bounds; set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 2, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (2, glyphs); expect (1, lines); // Try again with StringFormatFlagsLineLimit set. Should still fit. status = GdipSetStringFormatFlags(format, StringFormatFlagsLineLimit); expect (Ok, status); set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 2, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (2, glyphs); expect (1, lines); // Try again, but use clipping to only "show" the top half of a line. Should fit even with LineLimit. status = GdipSetClipRect (graphics, rect.X, rect.Y, rect.Width, rect.Height / 2, CombineModeReplace); expect (Ok, status); set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 2, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (2, glyphs); expect (1, lines); // Reset the clip region status = GdipResetClip (graphics); expect (Ok, status); // Now shorten the box slightly. Should not fit anything due to LineLimit. rect.Height *= 0.9; set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 2, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (0, glyphs); expect (0, lines); // Clear LineLimit flag status = GdipSetStringFormatFlags(format, 0); expect (Ok, status); // Without LineLimit, it should fit the line successfully. set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 2, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (2, glyphs); expect (1, lines); // Attempt to fit 3 glyphs / 2 lines into a bounding box from 2 glyphs / 1 line rect = saved_bounds; set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 3, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (2, glyphs); expect (1, lines); // Set rect large again. rect.Width = 200.0; rect.Height = 200.0; // Use the Generic Typographic string format for below, to prevent Windows adding extra space. GdipDeleteStringFormat (format); status = GdipStringFormatGetGenericTypographic (&format); expect (Ok, status); // Check measuring a string with only whitespace set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring2, 3, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (3, glyphs); // Should be reported despite being trimmed expect (1, lines); expectf_(fontSize * 0.4, bounds.Width, fontSize * 0.3); // neither the expected value nor the precision is particularly accurate, but should be OK. // Check measuring a string with only whitespace, that starts with non-space whitespace set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring3, 3, font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); expect (3, glyphs); // Should be reported despite being trimmed expect (1, lines); expectf ((double)fontSize, bounds.Width); // An em-space should be the same width as the font size. // MonoTests.System.Drawing.GraphicsTest.MeasureString_Wrapping_Dots GdipDeleteStringFormat (format); status = GdipCreateStringFormat (0, 0, &format); expect (Ok, status); GdipSetStringFormatAlign (format, StringAlignmentCenter); set_rect_empty (&rect); rect.Width = 80; rect.Height = 10000; status = GdipMeasureString (graphics, teststringdots, sizeof(teststringdots) / sizeof(teststringdots[0]), font, &rect, format, &bounds, &glyphs, &lines); expect (Ok, status); ok (bounds.Width <= 80, "GdipMeasureString is overstepping boundaries (%f <= 80)\n", bounds.Width); GdipDeleteGraphics (graphics); GdipDeleteFont (font); GdipDeleteFontFamily (family); GdipDeleteStringFormat (format); GdipDisposeImage (image); } #endif static void test_measure_string_alignment(void) { GpStringFormat *format; GpImage *image; GpGraphics *graphics; GpFontFamily *family; GpFont *font; GpStatus status; GpRectF rect, bounds; GpRegion *region; const WCHAR teststring1[] = { 'M', 0 }; INT i; static const CharacterRange character_range = { 0, 1 }; static const struct test_data { INT flags; StringAlignment alignment, line_alignment; REAL x_xx, x_x0; REAL y_yy, y_y0; REAL right_xx, right_x0; REAL bottom_yy, bottom_y0; } td[] = { { 0, StringAlignmentNear, StringAlignmentNear, 0, 0, 0, 0, 1.0, 0, 1.0, 0 }, { 0, StringAlignmentCenter, StringAlignmentNear, -0.5, 100, 0, 0, 0.5, 100, 1.0, 0 }, { 0, StringAlignmentFar, StringAlignmentNear, -1.0, 200, 0, 0, 0, 200, 1.0, 0 }, { 0, StringAlignmentNear, StringAlignmentCenter, 0, 0, -0.5, 50, 1.0, 0, 0.5, 50 }, { 0, StringAlignmentCenter, StringAlignmentCenter, -0.5, 100, -0.5, 50, 0.5, 100, 0.5, 50 }, { 0, StringAlignmentFar, StringAlignmentCenter, -1.0, 200, -0.5, 50, 0, 200, 0.5, 50 }, { 0, StringAlignmentNear, StringAlignmentFar, 0, 0, -1.0, 100, 1.0, 0, 0, 100 }, { 0, StringAlignmentCenter, StringAlignmentFar, -0.5, 100, -1.0, 100, 0.5, 100, 0, 100 }, { 0, StringAlignmentFar, StringAlignmentFar, -1.0, 200, -1.0, 100, 0, 200, 0, 100 }, { StringFormatFlagsDirectionVertical, StringAlignmentNear, StringAlignmentNear, 0, 0, 0, 0, 1.0, 0, 1.0, 0 }, { StringFormatFlagsDirectionVertical, StringAlignmentNear, StringAlignmentCenter, -0.5, 100, 0, 0, 0.5, 100, 1.0, 0 }, { StringFormatFlagsDirectionVertical, StringAlignmentNear, StringAlignmentFar, -1.0, 200, 0, 0, 0, 200, 1.0, 0 }, { StringFormatFlagsDirectionVertical, StringAlignmentCenter, StringAlignmentNear, 0, 0, -0.5, 50, 1.0, 0, 0.5, 50 }, { StringFormatFlagsDirectionVertical, StringAlignmentCenter, StringAlignmentCenter, -0.5, 100, -0.5, 50, 0.5, 100, 0.5, 50 }, { StringFormatFlagsDirectionVertical, StringAlignmentCenter, StringAlignmentFar, -1.0, 200, -0.5, 50, 0, 200, 0.5, 50 }, { StringFormatFlagsDirectionVertical, StringAlignmentFar, StringAlignmentNear, 0, 0, -1.0, 100, 1.0, 0, 0, 100 }, { StringFormatFlagsDirectionVertical, StringAlignmentFar, StringAlignmentCenter, -0.5, 100, -1.0, 100, 0.5, 100, 0, 100 }, { StringFormatFlagsDirectionVertical, StringAlignmentFar, StringAlignmentFar, -1.0, 200, -1.0, 100, 0, 200, 0, 100 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentFar, StringAlignmentNear, 0, 0, 0, 0, 1.0, 0, 1.0, 0 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentCenter, StringAlignmentNear, -0.5, 100, 0, 0, 0.5, 100, 1.0, 0 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentNear, StringAlignmentNear, -1.0, 200, 0, 0, 0, 200, 1.0, 0 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentFar, StringAlignmentCenter, 0, 0, -0.5, 50, 1.0, 0, 0.5, 50 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentCenter, StringAlignmentCenter, -0.5, 100, -0.5, 50, 0.5, 100, 0.5, 50 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentNear, StringAlignmentCenter, -1.0, 200, -0.5, 50, 0, 200, 0.5, 50 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentFar, StringAlignmentFar, 0, 0, -1.0, 100, 1.0, 0, 0, 100 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentCenter, StringAlignmentFar, -0.5, 100, -1.0, 100, 0.5, 100, 0, 100 }, { StringFormatFlagsDirectionRightToLeft, StringAlignmentNear, StringAlignmentFar, -1.0, 200, -1.0, 100, 0, 200, 0, 100 } }; status = GdipCreateStringFormat (0, 0, &format); expect (Ok, status); status = GdipGetGenericFontFamilySansSerif (&family); expect (Ok, status); status = GdipCreateFont (family, 10, FontStyleRegular, UnitPixel, &font); expect (Ok, status); status = GdipCreateRegion (®ion); expect (Ok, status); status = GdipCreateBitmapFromScan0 (400, 400, 0, PixelFormat32bppRGB, NULL, (GpBitmap **) &image); expect (Ok, status); status = GdipGetImageGraphicsContext (image, &graphics); expect (Ok, status); ok (graphics != NULL, "Expected graphics to be initialized\n"); GdipSetStringFormatMeasurableCharacterRanges (format, 1, &character_range); for (i = 0; i < sizeof(td) / sizeof(td[0]); i++) { GdipSetStringFormatFlags (format, td[i].flags); GdipSetStringFormatAlign (format, td[i].alignment); GdipSetStringFormatLineAlign (format, td[i].line_alignment); rect.X = 5.0; rect.Y = 10.0; rect.Width = 200.0; rect.Height = 100.0; set_rect_empty (&bounds); status = GdipMeasureString (graphics, teststring1, 1, font, &rect, format, &bounds, NULL, NULL); expect (Ok, status); expectf_ (td[i].x_x0 + td[i].x_xx * bounds.Width + 5.0, bounds.X, 0.6); expectf_ (td[i].y_y0 + td[i].y_yy * bounds.Height + 10.0, bounds.Y, 0.6); expectf_ (td[i].right_x0 + td[i].right_xx * bounds.Width + 5.0, bounds.X + bounds.Width, 0.6); expectf_ (td[i].bottom_y0 + td[i].bottom_yy * bounds.Height + 10.0, bounds.Y + bounds.Height, 0.6); status = GdipMeasureCharacterRanges (graphics, teststring1, 1, font, &rect, format, 1, ®ion); expect (Ok, status); status = GdipGetRegionBounds (region, graphics, &bounds); expect (Ok, status); expectf_ (td[i].x_x0 + td[i].x_xx * bounds.Width + 5.0, bounds.X, 3.0); expectf_ (td[i].y_y0 + td[i].y_yy * bounds.Height + 10.0, bounds.Y, 3.0); expectf_ (td[i].right_x0 + td[i].right_xx * bounds.Width + 5.0, bounds.X + bounds.Width, 3.0); expectf_ (td[i].bottom_y0 + td[i].bottom_yy * bounds.Height + 10.0, bounds.Y + bounds.Height, 3.0); } GdipDeleteGraphics (graphics); GdipDeleteFont (font); GdipDeleteFontFamily (family); GdipDeleteStringFormat (format); GdipDisposeImage (image); GdipDeleteRegion (region); } int main (int argc, char**argv) { STARTUP; #if defined(USE_PANGO_RENDERING) || defined(USE_WINDOWS_GDIPLUS) test_measure_string (); #endif test_measure_string_alignment (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testreversepath.c0000644000175000017500000002127713542672033022072 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" #define C(func) assert (func == Ok) static void check_reverse_points(const GpPointF *p1, const GpPointF *p2, int count) { p2 += count; while (count--) { p2--; assertEqualFloat (p1->X, p2->X); assertEqualFloat (p1->Y, p2->Y); p1++; } } static void test_gdip_reversepath() { GpPath *path; int count; int reverse_count; BYTE types[100]; GpPointF points[100]; BYTE reverse_types[100]; GpPointF reverse_points[100]; // Create a path C (GdipCreatePath (FillModeAlternate, &path)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 0); // Reverse an empty path C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, 0); // Path with one line C (GdipAddPathLine (path, 0, 10, 1, 11)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 2); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[0], PathPointTypeStart); assertEqualInt (types[1], PathPointTypeLine); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], PathPointTypeStart); assertEqualInt (reverse_types[1], PathPointTypeLine); GdipResetPath (path); // Closed path with one line C (GdipAddPathLine (path, 0, 10, 1, 11)); C (GdipClosePathFigure (path)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 2); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[0], PathPointTypeStart); assertEqualInt (types[1], (PathPointTypeLine | PathPointTypeCloseSubpath)); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], PathPointTypeStart); assertEqualInt (reverse_types[1], (PathPointTypeLine | PathPointTypeCloseSubpath)); GdipResetPath (path); // Rectangle C (GdipAddPathRectangle (path, 200, 201, 60, 61)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 4); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[0], PathPointTypeStart); assertEqualInt (types[1], PathPointTypeLine); assertEqualInt (types[2], PathPointTypeLine); assertEqualInt (types[3], (PathPointTypeLine | PathPointTypeCloseSubpath)); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], PathPointTypeStart); assertEqualInt (reverse_types[1], PathPointTypeLine); assertEqualInt (reverse_types[2], PathPointTypeLine); assertEqualInt (reverse_types[3], (PathPointTypeLine | PathPointTypeCloseSubpath)); GdipResetPath (path); // Rectangle, marker C (GdipAddPathRectangle (path, 200, 201, 60, 61)); C (GdipSetPathMarker (path)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 4); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[0], PathPointTypeStart); assertEqualInt (types[1], PathPointTypeLine); assertEqualInt (types[2], PathPointTypeLine); assertEqualInt (types[3], (PathPointTypeLine | PathPointTypeCloseSubpath | PathPointTypePathMarker)); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], PathPointTypeStart); assertEqualInt (reverse_types[1], PathPointTypeLine); assertEqualInt (reverse_types[2], PathPointTypeLine); assertEqualInt (reverse_types[3], (PathPointTypeLine | PathPointTypeCloseSubpath)); GdipResetPath (path); // Elipse and rectangle C (GdipAddPathEllipse (path, 50, 51, 50, 100)); C (GdipAddPathRectangle (path, 200, 201, 60, 61)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 17); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[13], PathPointTypeStart); assertEqualInt (types[14], PathPointTypeLine); assertEqualInt (types[15], PathPointTypeLine); assertEqualInt (types[16], (PathPointTypeLine | PathPointTypeCloseSubpath)); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], types[13]); assertEqualInt (reverse_types[1], (types[16] & ~PathPointTypeCloseSubpath)); assertEqualInt (reverse_types[2], types[15]); assertEqualInt (reverse_types[3], (types[14] | PathPointTypeCloseSubpath)); GdipResetPath (path); // Line, marker, bezier C (GdipAddPathLine (path, 0, 1, 2, 3)); C (GdipSetPathMarker (path)); C (GdipClosePathFigure (path)); C (GdipAddPathBezier (path, 5, 6, 7, 8, 9, 10, 11, 12)); C (GdipClosePathFigure (path)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 6); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[0], PathPointTypeStart); assertEqualInt (types[1], (PathPointTypeLine | PathPointTypePathMarker | PathPointTypeCloseSubpath)); assertEqualInt (types[2], PathPointTypeStart); assertEqualInt (types[3], PathPointTypeBezier); assertEqualInt (types[4], PathPointTypeBezier); assertEqualInt (types[5], (PathPointTypeBezier | PathPointTypeCloseSubpath)); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], types[2]); assertEqualInt (reverse_types[1], types[4]); assertEqualInt (reverse_types[2], types[3]); assertEqualInt (reverse_types[3], (types[5] | PathPointTypePathMarker)); assertEqualInt (reverse_types[4], types[0]); assertEqualInt (reverse_types[5], (types[1] & ~PathPointTypePathMarker)); GdipResetPath (path); // Line, marker, line, bezier C (GdipAddPathLine (path, 0, 1, 2, 3)); C (GdipSetPathMarker (path)); C (GdipStartPathFigure (path)); C (GdipAddPathLine (path, 20, 21, 22, 23)); C (GdipAddPathBezier (path, 5, 6, 7, 8, 9, 10, 11, 12)); C (GdipGetPointCount (path, &count)); assertEqualInt (count, 8); C (GdipGetPathTypes (path, types, count)); C (GdipGetPathPoints (path, points, count)); assertEqualInt (types[0], PathPointTypeStart); assertEqualInt (types[1], (PathPointTypeLine | PathPointTypePathMarker)); assertEqualInt (types[2], PathPointTypeStart); assertEqualInt (types[3], PathPointTypeLine); assertEqualInt (types[4], PathPointTypeLine); assertEqualInt (types[5], PathPointTypeBezier); assertEqualInt (types[6], PathPointTypeBezier); assertEqualInt (types[7], PathPointTypeBezier); C (GdipReversePath (path)); C (GdipGetPointCount (path, &reverse_count)); assertEqualInt (reverse_count, count); C (GdipGetPathTypes (path, reverse_types, count)); C (GdipGetPathPoints (path, reverse_points, count)); check_reverse_points (points, reverse_points, count); assertEqualInt (reverse_types[0], PathPointTypeStart); assertEqualInt (reverse_types[1], PathPointTypeBezier); assertEqualInt (reverse_types[2], PathPointTypeBezier); assertEqualInt (reverse_types[3], PathPointTypeBezier); assertEqualInt (reverse_types[4], PathPointTypeLine); assertEqualInt (reverse_types[5], (PathPointTypeLine | PathPointTypePathMarker)); assertEqualInt (reverse_types[6], PathPointTypeStart); assertEqualInt (reverse_types[7], PathPointTypeLine); C (GdipDeletePath (path)); } int main(int argc, char**argv) { STARTUP; test_gdip_reversepath(); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testimageattributes.c0000644000175000017500000007557113545154623022744 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include #include "testhelpers.h" static void test_createImageAttributes () { GpStatus status; GpImageAttributes *attributes; status = GdipCreateImageAttributes (&attributes); assertEqualInt (status, Ok); assert (attributes && "Expected attributes to be initialized."); // Negative tests. status = GdipCreateImageAttributes (NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_cloneImageAttributes () { GpStatus status; GpImageAttributes *attributes; GpImageAttributes *clonedAttributes; GdipCreateImageAttributes (&attributes); status = GdipCloneImageAttributes (attributes, &clonedAttributes); assertEqualInt (status, Ok); assert (attributes && attributes != clonedAttributes); // Negative tests. status = GdipCloneImageAttributes (NULL, &clonedAttributes); assertEqualInt (status, InvalidParameter); status = GdipCloneImageAttributes (attributes, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_disposeImageAttributes () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); status = GdipDisposeImageAttributes (attributes); assertEqualInt (status, Ok); // Negative tests. status = GdipDisposeImageAttributes (NULL); assertEqualInt (status, InvalidParameter); } static void test_setImageAttributesToIdentity () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypeDefault); assertEqualInt (status, Ok); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypeBitmap); assertEqualInt (status, Ok); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypeBrush); assertEqualInt (status, Ok); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypePen); assertEqualInt (status, Ok); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypeText); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesToIdentity (NULL, ColorAdjustTypeBitmap); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypeCount); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesToIdentity (attributes, ColorAdjustTypeAny); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesToIdentity (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1)); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_resetImageAttributes () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); status = GdipResetImageAttributes (attributes, ColorAdjustTypeDefault); assertEqualInt (status, Ok); status = GdipResetImageAttributes (attributes, ColorAdjustTypeBitmap); assertEqualInt (status, Ok); status = GdipResetImageAttributes (attributes, ColorAdjustTypeBrush); assertEqualInt (status, Ok); status = GdipResetImageAttributes (attributes, ColorAdjustTypePen); assertEqualInt (status, Ok); status = GdipResetImageAttributes (attributes, ColorAdjustTypeText); assertEqualInt (status, Ok); // Negative tests. status = GdipResetImageAttributes (NULL, ColorAdjustTypeBitmap); assertEqualInt (status, InvalidParameter); status = GdipResetImageAttributes (attributes, ColorAdjustTypeCount); assertEqualInt (status, InvalidParameter); status = GdipResetImageAttributes (attributes, ColorAdjustTypeAny); assertEqualInt (status, InvalidParameter); status = GdipResetImageAttributes (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1)); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesColorMatrix () { GpStatus status; GpImageAttributes *attributes; ColorMatrix colorMatrix; ColorMatrix grayMatrix; memset ((void *) &colorMatrix, 0, sizeof (ColorMatrix)); memset ((void *) &grayMatrix, 0, sizeof (ColorMatrix)); GdipCreateImageAttributes (&attributes); // Enable - ColorMatrixFlagsDefault, null gray matrix. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, NULL, ColorMatrixFlagsDefault); assertEqualInt (status, Ok); // Enable - ColorMatrixFlagsDefault, non-null gray matrix. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsDefault); assertEqualInt (status, Ok); // Enable - ColorMatrixFlagsSkipGrays, null gray matrix. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, NULL, ColorMatrixFlagsSkipGrays); assertEqualInt (status, Ok); // Enable - ColorMatrixFlagsSkipGrays, non-null gray matrix. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, Ok); // Enable - ColorMatrixFlagsAltGray. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsAltGray); assertEqualInt (status, Ok); // Disable. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, FALSE, &colorMatrix, &grayMatrix, ColorMatrixFlagsAltGray); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, NULL, ColorMatrixFlagsDefault); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesColorMatrix (NULL, ColorAdjustTypeBitmap, TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (NULL, ColorAdjustTypeBitmap, FALSE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeCount, TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeCount, FALSE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeAny, TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeAny, FALSE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE, &colorMatrix, &grayMatrix, ColorMatrixFlagsSkipGrays); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, &grayMatrix, (ColorMatrixFlags)(ColorMatrixFlagsAltGray + 1)); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, FALSE, &colorMatrix, &grayMatrix, (ColorMatrixFlags)(ColorMatrixFlagsAltGray + 1)); assertEqualInt (status, Ok); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, NULL, &grayMatrix, ColorMatrixFlagsDefault); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, FALSE, NULL, &grayMatrix, ColorMatrixFlagsDefault); assertEqualInt (status, Ok); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, NULL, ColorMatrixFlagsAltGray); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, NULL, ColorMatrixFlagsDefault); assertEqualInt (status, Ok); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, TRUE, &colorMatrix, NULL, ColorMatrixFlagsSkipGrays); assertEqualInt (status, Ok); status = GdipSetImageAttributesColorMatrix (attributes, ColorAdjustTypeDefault, FALSE, &colorMatrix, NULL, ColorMatrixFlagsDefault); assertEqualInt (status, Ok); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesThreshold () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // Positive value. status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeDefault, TRUE, 100); assertEqualInt (status, Ok); // Zero value. status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeDefault, TRUE, 0); assertEqualInt (status, Ok); // Negative value. status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeDefault, TRUE, -100); assertEqualInt (status, Ok); // Disabled. status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeDefault, FALSE, 0); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeDefault, TRUE, 100); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesThreshold (NULL, ColorAdjustTypeDefault, TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (NULL, ColorAdjustTypeDefault, FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeCount, TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeCount, FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeAny, TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (attributes, ColorAdjustTypeAny, FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesThreshold (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE, 1); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesGamma () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // Positive value. status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, TRUE, 100); assertEqualInt (status, Ok); // Disabled. status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, FALSE, 10); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, TRUE, 100); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesGamma (NULL, ColorAdjustTypeDefault, TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (NULL, ColorAdjustTypeDefault, FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeCount, TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeCount, FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeAny, TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeAny, FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE, 1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, TRUE, 0); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, TRUE, -1); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, FALSE, 0); assertEqualInt (status, Ok); status = GdipSetImageAttributesGamma (attributes, ColorAdjustTypeDefault, FALSE, -1); assertEqualInt (status, Ok); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesNop () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // Enabled. status = GdipSetImageAttributesNoOp (attributes, ColorAdjustTypeDefault, TRUE); assertEqualInt (status, Ok); // Disabled. status = GdipSetImageAttributesNoOp (attributes, ColorAdjustTypeDefault, FALSE); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesNoOp (NULL, ColorAdjustTypeDefault, TRUE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (NULL, ColorAdjustTypeDefault, FALSE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (attributes, ColorAdjustTypeCount, TRUE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (attributes, ColorAdjustTypeCount, FALSE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (attributes, ColorAdjustTypeAny, TRUE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (attributes, ColorAdjustTypeAny, FALSE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesNoOp (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesColorKeys () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // Enabled - greater. status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x02030405); assertEqualInt (status, Ok); // Enabled - equal. status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x01020304); assertEqualInt (status, Ok); // Enabled - lower alpha. status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x00020304); assertEqualInt (status, Ok); // Disabled. status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, FALSE, 0x01020304, 0x02030405); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x02030405); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesColorKeys (NULL, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x02030405); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, (ColorAdjustType)(ColorAdjustTypeDefault - 1), TRUE, 0x01020304, 0x02030405); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeCount, TRUE, 0x01020304, 0x02030405); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeAny, TRUE, 0x01020304, 0x02030405); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, 0x01020304, 0x02030405); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x01010405); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, FALSE, 0x01020304, 0x01010405); assertEqualInt (status, Ok); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x01020205); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, FALSE, 0x01020304, 0x01020205); assertEqualInt (status, Ok); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, TRUE, 0x01020304, 0x01020303); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesColorKeys (attributes, ColorAdjustTypeDefault, FALSE, 0x01020304, 0x01020303); assertEqualInt (status, Ok); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesOutputChannel () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // Enable - ColorChannelFlagsC. status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsC); assertEqualInt (status, Ok); // Enable - ColorChannelFlagsM. status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsM); assertEqualInt (status, Ok); // Enable - ColorChannelFlagsY. status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsY); assertEqualInt (status, Ok); // Enable - ColorChannelFlagsK. status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsK); assertEqualInt (status, Ok); // Disabled. status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, FALSE, ColorChannelFlagsY); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsC); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesOutputChannel (NULL, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsK); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, (ColorAdjustType)(ColorAdjustTypeDefault - 1), TRUE, ColorChannelFlagsK); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeCount, TRUE, ColorChannelFlagsK); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeAny, TRUE, ColorChannelFlagsK); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, ColorChannelFlagsK); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE, ColorChannelFlagsK); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, ColorChannelFlagsLast); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, (ColorChannelFlags)(ColorChannelFlagsC - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, TRUE, (ColorChannelFlags)(ColorChannelFlagsLast + 1)); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannel (attributes, ColorAdjustTypeDefault, FALSE, (ColorChannelFlags)(ColorChannelFlagsC - 1)); assertEqualInt (status, Ok); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesOutputChannelColorProfile () { GpStatus status; GpImageAttributes *attributes; WCHAR *colorProfileName = createWchar ("AdobeRGB1998.icc"); WCHAR *noSuchFileName = createWchar ("Name"); WCHAR *invalidFileName = createWchar ("test.bmp"); GdipCreateImageAttributes (&attributes); // Enabled. status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, TRUE, colorProfileName); //assertEqualInt (status, Ok); // Disabled. status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, FALSE, colorProfileName); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, TRUE, colorProfileName); //assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesOutputChannelColorProfile (NULL, ColorAdjustTypeDefault, TRUE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (NULL, ColorAdjustTypeDefault, FALSE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeCount, TRUE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeCount, FALSE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeAny, TRUE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeAny, FALSE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE, colorProfileName); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, TRUE, NULL); assertEqualInt (status, Win32Error); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, FALSE, NULL); assertEqualInt (status, Ok); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, TRUE, noSuchFileName); assertEqualInt (status, OutOfMemory); status = GdipSetImageAttributesOutputChannelColorProfile (attributes, ColorAdjustTypeDefault, FALSE, noSuchFileName); assertEqualInt (status, Ok); GdipDisposeImageAttributes (attributes); freeWchar (colorProfileName); freeWchar (noSuchFileName); freeWchar (invalidFileName); } static void test_setImageAttributesRemapTable () { GpStatus status; GpImageAttributes *attributes; ColorMap remapTable[2] = { { {123}, {234} }, { {345}, {678} } }; GdipCreateImageAttributes (&attributes); // Enable. status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 1, remapTable); assertEqualInt (status, Ok); // Enable - larger. status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 2, remapTable); assertEqualInt (status, Ok); // Enable - Same. status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 2, remapTable); assertEqualInt (status, Ok); // Enable - Smaller. status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 1, remapTable); assertEqualInt (status, Ok); // Disable. status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, FALSE, 1, remapTable); assertEqualInt (status, Ok); // Re-enable. status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 2, remapTable); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesRemapTable (NULL, ColorAdjustTypeDefault, TRUE, 1, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (NULL, ColorAdjustTypeDefault, FALSE, 1, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeCount, TRUE, 2, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeCount, FALSE, 2, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeAny, TRUE, 2, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeAny, FALSE, 2, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), TRUE, 2, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, (ColorAdjustType)(ColorAdjustTypeAny + 1), FALSE, 2, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 0, remapTable); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, FALSE, 0, remapTable); assertEqualInt (status, Ok); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, TRUE, 1, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetImageAttributesRemapTable (attributes, ColorAdjustTypeDefault, FALSE, 1, NULL); assertEqualInt (status, Ok); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesWrapMode () { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // WrapModeTile, enable clamp. status = GdipSetImageAttributesWrapMode (attributes, WrapModeTile, 10, TRUE); assertEqualInt (status, Ok); // WrapModeClamp, enable clamp. status = GdipSetImageAttributesWrapMode (attributes, WrapModeClamp, 10, TRUE); assertEqualInt (status, Ok); // WrapModeTile, disable clamp. status = GdipSetImageAttributesWrapMode (attributes, WrapModeClamp, 10, FALSE); assertEqualInt (status, Ok); // WrapModeClamp, disable clamp. status = GdipSetImageAttributesWrapMode (attributes, WrapModeClamp, 10, FALSE); assertEqualInt (status, Ok); // Invalid WrapMode - negative value. status = GdipSetImageAttributesWrapMode (attributes, (WrapMode)(WrapModeTile - 1), 10, TRUE); assertEqualInt (status, Ok); // Invalid WrapMode - positive value. status = GdipSetImageAttributesWrapMode (attributes, (WrapMode)(WrapModeClamp + 1), 10, TRUE); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesWrapMode (NULL, WrapModeClamp, 10, FALSE); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesICMMode () { // This causes a linker error. Could be a bug in the GDI+ headers, or that // GdipSetImageAttributesICMMode has been obsoleted. #if !defined(USE_WINDOWS_GDIPLUS) GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); status = GdipSetImageAttributesICMMode (attributes, TRUE); assertEqualInt (status, Ok); status = GdipSetImageAttributesICMMode (attributes, FALSE); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesICMMode (NULL, FALSE); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); #endif } static void test_getImageAttributesAdjustedPalette () { GpStatus status; GpImageAttributes *attributes; BYTE buffer[1040]; ColorPalette *colorPalette = (ColorPalette *) buffer; GdipCreateImageAttributes (&attributes); colorPalette->Count = 1; colorPalette->Flags = 0; colorPalette->Entries[0] = 1; // FIXME: GdipGetImageAttributesAdjustedPalette is not implemented in libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeBitmap); assertEqualInt (status, Ok); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeBrush); assertEqualInt (status, Ok); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypePen); assertEqualInt (status, Ok); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeText); assertEqualInt (status, Ok); #endif // Negative tests. status = GdipGetImageAttributesAdjustedPalette (NULL, colorPalette, ColorAdjustTypeBitmap); assertEqualInt (status, InvalidParameter); status = GdipGetImageAttributesAdjustedPalette (attributes, NULL, ColorAdjustTypeBitmap); assertEqualInt (status, InvalidParameter); colorPalette->Count = 0; status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeBitmap); assertEqualInt (status, InvalidParameter); colorPalette->Count = 1; status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, (ColorAdjustType)(ColorAdjustTypeDefault - 1)); assertEqualInt (status, InvalidParameter); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeDefault); assertEqualInt (status, InvalidParameter); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeCount); assertEqualInt (status, InvalidParameter); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, ColorAdjustTypeAny); assertEqualInt (status, InvalidParameter); status = GdipGetImageAttributesAdjustedPalette (attributes, colorPalette, (ColorAdjustType)(ColorAdjustTypeAny - 1)); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } static void test_setImageAttributesCachedBackground() { GpStatus status; GpImageAttributes *attributes; GdipCreateImageAttributes (&attributes); // True. status = GdipSetImageAttributesCachedBackground (attributes, TRUE); assertEqualInt (status, Ok); // Same. status = GdipSetImageAttributesCachedBackground (attributes, TRUE); assertEqualInt (status, Ok); // False. status = GdipSetImageAttributesCachedBackground (attributes, FALSE); assertEqualInt (status, Ok); // Negative tests. status = GdipSetImageAttributesCachedBackground (NULL, TRUE); assertEqualInt (status, InvalidParameter); GdipDisposeImageAttributes (attributes); } int main (int argc, char**argv) { STARTUP; test_createImageAttributes (); test_cloneImageAttributes (); test_disposeImageAttributes (); test_setImageAttributesToIdentity (); test_resetImageAttributes (); test_setImageAttributesColorMatrix (); test_setImageAttributesThreshold (); test_setImageAttributesGamma (); test_setImageAttributesNop (); test_setImageAttributesColorKeys (); test_setImageAttributesOutputChannel (); test_setImageAttributesOutputChannelColorProfile (); test_setImageAttributesRemapTable (); test_setImageAttributesWrapMode (); test_setImageAttributesICMMode (); test_getImageAttributesAdjustedPalette (); test_setImageAttributesCachedBackground (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testhelpers.h0000644000175000017500000006520313545154623021211 0ustar directhexdirecthex#include #include #include #include #include #include #if !defined(_WIN32) #include #endif #define STARTUP \ ULONG_PTR gdiplusToken; \ GdiplusStartupInput gdiplusStartupInput; \ gdiplusStartupInput.GdiplusVersion = 1; \ gdiplusStartupInput.DebugEventCallback = NULL; \ gdiplusStartupInput.SuppressBackgroundThread = FALSE; \ gdiplusStartupInput.SuppressExternalCodecs = FALSE; \ GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL); \ #define SHUTDOWN GdiplusShutdown (gdiplusToken); #if !defined(__has_attribute) #define __has_attribute(x) 0 #endif #if __has_attribute(used) || defined(__GNUC__) #define ATTRIBUTE_USED __attribute__((used)) #else #define ATTRIBUTE_USED #endif #define ARRAY_SIZE(x) sizeof (x) / sizeof (*x) ATTRIBUTE_USED static BOOL floatsEqual(float v1, float v2) { if (isnan (v1)) return isnan (v2); if (isinf (v1)) return isinf (v2); return fabs (v1 - v2) < 0.0001; } #if !defined(USE_WINDOWS_GDIPLUS) #define createWchar(c) g_utf8_to_utf16 (c, -1, NULL, NULL, NULL) #define freeWchar(c) g_free(c) #define wcharFromChar(c) createWchar(c) #define charFromWchar(c) g_utf16_to_utf8 (c, -1, NULL, NULL, NULL) #define freeChar(c) g_free(c) #else ATTRIBUTE_USED static WCHAR* wcharFromChar(const char *c) { size_t length = strlen (c); WCHAR *wc = (WCHAR *)malloc ((length + 1) * sizeof(WCHAR)); for (size_t i = 0; i < length; i++) { wc[i] = (WCHAR) c[i]; } wc[length] = 0; return wc; } ATTRIBUTE_USED static char* charFromWchar(const wchar_t *wc) { size_t length = lstrlenW (wc); char *c = (char *)malloc ((length + 1) * sizeof(char)); for (size_t i = 0; i < length; i++) { c[i] = (char) wc[i]; } c[length] = 0; return c; } #define createWchar(c) (WCHAR *) L ##c #define freeWchar(c) #define freeChar(c) free(c); #endif ATTRIBUTE_USED static void printFailure(const char *file, const char *function, int line) { fprintf (stderr, "Assertion failure: file %s in %s, line %d\n", file, function, line); } ATTRIBUTE_USED static void assertEqualIntImpl (INT actual, INT expected, const char *message, const char *file, const char *function, int line) { if (actual != expected) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected: %d\n", expected); fprintf (stderr, "Actual: %d\n", actual); abort(); } } #define assertEqualInt(actual, expected) assertEqualIntImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualFloatImpl (REAL actual, REAL expected, const char *message, const char *file, const char *function, int line) { if (!floatsEqual (actual, expected)) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected: %f\n", expected); fprintf (stderr, "Actual: %f\n", actual); abort (); } } #define assertEqualFloat(actual, expected) assertEqualFloatImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertSimilarFloatImpl (REAL actual, REAL expected, REAL tolerance, const char *message, const char *file, const char *function, int line) { if (fabs(actual - expected) > fabs(tolerance)) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected %f +/- %f\n", expected, tolerance); fprintf (stderr, "Actual: %f\n", actual); abort (); } } #define assertSimilarFloat(actual, expected, tolerance) assertSimilarFloatImpl (actual, expected, tolerance, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static BOOL stringsEqual (const WCHAR *actual, const char *expected) { int i = 0; while (TRUE) { if (expected[i] == '\0') { return actual[i] == '\0'; } if (expected[i] != (char)actual[i]) return FALSE; i++; } return TRUE; } ATTRIBUTE_USED static void assertEqualStringImpl(const WCHAR *actual, const char * expected, const char *message, const char *file, const char *function, int line) { if (!stringsEqual (actual, expected)) { char *actualA = charFromWchar (actual); if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected: %s\n", expected); fprintf (stderr, "Actual: %s\n", actualA); freeChar (actualA); abort(); } } #define assertEqualString(actual, expected) assertEqualStringImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualRectImpl (GpRectF actual, GpRectF expected, const char *message, const char *file, const char *function, int line) { if (!floatsEqual (actual.X, expected.X) || !floatsEqual (actual.Y, expected.Y) || !floatsEqual (actual.Width, expected.Width) || !floatsEqual (actual.Height, expected.Height)) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected: {%g, %g, %g, %g}\n", expected.X, expected.Y, expected.Width, expected.Height); fprintf (stderr, "Actual: {%g, %g, %g, %g}\n", actual.X, actual.Y, actual.Width, actual.Height); abort (); } } #define assertEqualRect(actual, expected) assertEqualRectImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualPointImpl (Point actual, Point expected, const char *message, const char *file, const char *function, int line) { if (actual.X != expected.X || actual.X != expected.X) { if (message) fprintf(stderr, "%s\n", message); printFailure(file, function, line); fprintf(stderr, "Expected: {%d, %d}\n", expected.X, expected.Y); fprintf(stderr, "Actual: {%d, %d}\n", actual.X, actual.Y); abort(); } } #define assertEqualPoint(actual, expected) assertEqualPointImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualPointsImpl (const Point *actual, const Point *expected, INT count, const char *file, const char *function, int line) { for (int i = 0; i < count; i++) { char iChar = i + '0'; assertEqualPointImpl (actual[i], expected[i], &iChar, file, function, line); } } #define assertEqualPoints(actual, expected, count) assertEqualPointsImpl (actual, expected, count, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualPointFImpl (PointF actual, PointF expected, const char *message, const char *file, const char *function, int line) { if (!floatsEqual(actual.X, expected.X) || !floatsEqual(actual.Y, expected.Y)) { if (message) fprintf(stderr, "%s\n", message); printFailure(file, function, line); fprintf(stderr, "Expected: {%g, %g}\n", expected.X, expected.Y); fprintf(stderr, "Actual: {%g, %g}\n", actual.X, actual.Y); abort(); } } #define assertEqualPointF(actual, expected) assertEqualPointFImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualPointsFImpl (const PointF *actual, const PointF *expected, INT count, const char *file, const char *function, int line) { for (int i = 0; i < count; i++) { char iChar = i + '0'; assertEqualPointFImpl (actual[i], expected[i], &iChar, file, function, line); } } #define assertEqualPointsF(actual, expected, count) assertEqualPointsFImpl (actual, expected, count, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void dumpBytes (const BYTE *bytes, int length) { printf ("%u\n", length); for (int i = 0; i < length; i++) { printf ("0x%02X", bytes[i]); if (i != length - 1) { printf (", "); } } printf("\n\n"); } ATTRIBUTE_USED static void assertEqualBytesImpl (const BYTE *actual, const BYTE *expected, int length, const char *message, const char *file, const char *function, int line) { for (int i = 0; i < length; i++) { if (actual[i] != expected[i]) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected[%d]: 0x%02X\n", i, (BYTE) expected[i]); fprintf (stderr, "Actual[%d]: 0x%02X\n", i, (BYTE) actual[i]); fprintf (stderr, "-- Actual --\n"); dumpBytes (actual, length); abort(); } } } #define assertEqualBytes(actual, expected, length) assertEqualBytesImpl (actual, expected, length, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void assertEqualGuidImpl (GUID actual, GUID expected, const char *message, const char *file, const char *function, int line) { if (memcmp ((void *) &actual, (void *) &expected, sizeof (GUID)) != 0) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected: {%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}\n", (unsigned long) expected.Data1, expected.Data2, expected.Data3, expected.Data4[0], expected.Data4[1], expected.Data4[2], expected.Data4[3], expected.Data4[4], expected.Data4[5], expected.Data4[6], expected.Data4[7]); fprintf (stderr, "Actual: {%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}\n", (unsigned long) actual.Data1, actual.Data2, actual.Data3, actual.Data4[0], actual.Data4[1], actual.Data4[2], actual.Data4[3], actual.Data4[4], actual.Data4[5], actual.Data4[6], actual.Data4[7]); abort(); } } #define assertEqualGuid(actual, expected) assertEqualGuidImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void verifyMatrixImpl(GpMatrix *matrix, REAL e1, REAL e2, REAL e3, REAL e4, REAL e5, REAL e6, const char *file, const char *function, int line) { GpStatus status; REAL elements[6]; status = GdipGetMatrixElements(matrix, elements); assertEqualInt (status, Ok); if (!floatsEqual (elements[0], e1) || !floatsEqual (elements[1], e2) || !floatsEqual (elements[2], e3) || !floatsEqual (elements[3], e4) || !floatsEqual (elements[4], e5) || !floatsEqual (elements[5], e6)) { printFailure (file, function, line); fprintf (stderr, "Expected: %f, %f, %f, %f, %f, %f\n", e1, e2, e3, e4, e5, e6); fprintf (stderr, "Actual: %f, %f, %f, %f, %f, %f\n\n", elements[0], elements[1], elements[2], elements[3], elements[4], elements[5]); abort (); } } #define verifyMatrix(matrix, e1, e2, e3, e4, e5, e6) verifyMatrixImpl (matrix, e1, e2, e3, e4, e5, e6, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void verifyRegionImpl(GpRegion *region, float expectedX, float expectedY, float expectedWidth, float expectedHeight, BOOL expectedIsEmpty, BOOL expectedIsInfinite, const char *file, const char *function, int line) { GpImage *image; GpGraphics *graphics; GpStatus status; GpRectF bounds; BOOL isEmpty; BOOL isInfinite; RectF expectedBounds = {expectedX, expectedY, expectedWidth, expectedHeight}; GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat32bppRGB, NULL, (GpBitmap **) &image); GdipGetImageGraphicsContext (image, &graphics); status = GdipGetRegionBounds (region, graphics, &bounds); assertEqualIntImpl (status, Ok, NULL, file, function, line); assertEqualRectImpl (bounds, expectedBounds, "Bounds", file, function, line); status = GdipIsEmptyRegion (region, graphics, &isEmpty); assertEqualIntImpl (status, Ok, NULL, file, function, line); assertEqualIntImpl (isEmpty, expectedIsEmpty, "IsEmpty", file, function, line); status = GdipIsInfiniteRegion (region, graphics, &isInfinite); assertEqualIntImpl (status, Ok, NULL, file, function, line); assertEqualIntImpl (isInfinite, expectedIsInfinite, "IsInfinite", file, function, line); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } #define verifyRegion(region, expectedX, expectedY, expectedWidth, expectedHeight, expectedIsEmpty, expectedIsInfinite) \ verifyRegionImpl (region, expectedX, expectedY, expectedWidth, expectedHeight, expectedIsEmpty, expectedIsInfinite, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static GpRectF infiniteScans[] = {{-4194304, -4194304, 8388608, 8388608}}; ATTRIBUTE_USED static GpRectF *emptyScans = NULL; ATTRIBUTE_USED static void verifyRegionScansImpl (GpRegion *region, RectF *expectedScans, INT expectedCount, const char *file, const char *function, int line) { GpStatus status; GpMatrix *matrix; INT count; GpRectF *scans; GdipCreateMatrix (&matrix); status = GdipGetRegionScans (region, NULL, &count, matrix); assertEqualIntImpl (status, Ok, NULL, file, function, line); assertEqualIntImpl (count, expectedCount / sizeof (GpRectF), "ScansCount", file, function, line); scans = (GpRectF *) malloc (count * sizeof (GpRectF)); status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualIntImpl (status, Ok, NULL, file, function, line); #if 0 for (int i = 0; i < count; i++) { printf("{%.0f, %.0f, %.0f, %.0f}", scans[i].X, scans[i].Y, scans[i].Width, scans[i].Height); if (i != count - 1) printf (","); printf("\n"); } printf("\n"); #endif for (int i = 0; i < count; i++) { char iChar[] = {'S', 'c', 'a', 'n', ' ', (char) (i + '0'), 0}; assertEqualRectImpl (scans[i], expectedScans[i], iChar, file, function, line); } GdipDeleteMatrix (matrix); } #define verifyRegionScans(region, expectedScans, expectedCount) \ verifyRegionScansImpl (region, expectedScans, expectedCount, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static BYTE infiniteRegionData[] = { /* --RegionHeader-- */ /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0x9B, 0x34, 0x22, 0xA3, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x03, 0x00, 0x00, 0x10 }; ATTRIBUTE_USED static BYTE emptyRegionData[] = { /* --RegionHeader-- */ /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0xFE, 0x53, 0x9E, 0x1B, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x02, 0x00, 0x00, 0x10 }; ATTRIBUTE_USED static void verifyRegionDataImpl (GpRegion *region, BYTE *expected, INT expectedCount, const char *file, const char *function, int line) { BYTE buffer[1024]; GpStatus status; UINT dataSize; UINT sizeFilled; status = GdipGetRegionDataSize (region, &dataSize); assertEqualIntImpl (status, Ok, NULL, file, function, line); assertEqualIntImpl (dataSize, expectedCount, "Region Data Count", file, function, line); status = GdipGetRegionData (region, buffer, dataSize, &sizeFilled); assertEqualIntImpl (status, Ok, NULL, file, function, line); assertEqualBytesImpl (buffer, expected, expectedCount, "Region Data", file, function, line); assertEqualIntImpl (sizeFilled, expectedCount, "Region Data Size Filled", file, function, line); } #define verifyRegionData(region, expectedData) \ verifyRegionDataImpl (region, expectedData, sizeof (expectedData), __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void verifyEmptyRegionImpl (GpRegion *region, const char *file, const char *function, int line) { verifyRegionImpl (region, 0, 0, 0, 0, TRUE, FALSE, file, function, line); verifyRegionScansImpl (region, emptyScans, sizeof (emptyScans), file, function, line); verifyRegionDataImpl (region, emptyRegionData, sizeof (emptyRegionData), file, function, line); } #define verifyEmptyRegion(region) \ verifyEmptyRegionImpl (region, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static void verifyInfiniteRegionImpl (GpRegion *region, const char *file, const char *function, int line) { verifyRegionImpl (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE, file, function, line); verifyRegionScansImpl (region, infiniteScans, sizeof (infiniteScans), file, function, line); verifyRegionDataImpl (region, infiniteRegionData, sizeof (infiniteRegionData), file, function, line); } #define verifyInfiniteRegion(region) \ verifyInfiniteRegionImpl (region, __FILE__, __func__, __LINE__) ATTRIBUTE_USED static CLSID bmpEncoderClsid = { 0x557cf400, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID tifEncoderClsid = { 0x557cf405, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID gifEncoderClsid = { 0x557cf402, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID pngEncoderClsid = { 0x557cf406, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID jpegEncoderClsid = { 0x557cf401, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID icoEncoderClsid = { 0x557cf407, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID wmfEncoderClsid = { 0x557cf404, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static CLSID emfEncoderClsid = { 0x557cf403, 0x1a04, 0x11d3,{ 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID memoryBmpRawFormat = { 0xb96b3caaU, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID bmpRawFormat = { 0xb96b3cabU, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID tifRawFormat = { 0xb96b3cb1U, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID gifRawFormat = { 0xb96b3cb0U, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID pngRawFormat = { 0xb96b3cafU, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID jpegRawFormat = { 0xb96b3caeU, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID icoRawFormat = { 0xb96b3cb5U, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID wmfRawFormat = { 0xb96b3cadU, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static GUID emfRawFormat = { 0xb96b3cacU, 0x0728U, 0x11d3U,{ 0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e } }; ATTRIBUTE_USED static BOOL is_32bit() { return sizeof(int *) == 4; } #if defined(USE_WINDOWS_GDIPLUS) #define WINDOWS_GDIPLUS 1 #else #define WINDOWS_GDIPLUS 0 #endif #define verifyBitmap(image, expectedRawFormat, expectedPixelFormat, expectedWidth, expectedHeight, expectedFlags, expectedPropertyCount, checkFlags) \ verifyImage((GpBitmap *) image, ImageTypeBitmap, expectedRawFormat, expectedPixelFormat, 0, 0, expectedWidth, expectedHeight, (REAL)expectedWidth, (REAL)expectedHeight, (REAL)expectedWidth, (REAL)expectedHeight, expectedFlags, expectedPropertyCount, checkFlags) #define verifyMetafile(image, expectedRawFormat, expectedX, expectedY, expectedWidth, expectedHeight, expectedDimensionWidth, expectedDimensionHeight) \ verifyImage(image, ImageTypeMetafile, expectedRawFormat, PixelFormat32bppRGB, expectedX, expectedY, expectedWidth, expectedHeight, (REAL)expectedWidth, (REAL)expectedHeight, expectedDimensionWidth, expectedDimensionHeight, 327683, 0, TRUE) #define verifyImage(image, expectedType, expectedRawFormat, expectedPixelFormat, expectedX, expectedY, expectedWidth, expectedHeight, expectedBoundsWidth, expectedBoundsHeight, expectedDimensionWidth, expectedDimensionHeight, expectedFlags, expectedPropertyCount, checkFlags) \ { \ GpStatus status; \ ImageType type; \ GUID rawFormat; \ PixelFormat pixelFormat; \ UINT width; \ UINT height; \ GpRectF bounds; \ GpUnit unit; \ REAL dimensionWidth; \ REAL dimensionHeight; \ UINT flags; \ UINT propertyCount; \ \ status = GdipGetImageType (image, &type); \ assertEqualInt (status, Ok); \ assertEqualInt (type, expectedType); \ \ status = GdipGetImageRawFormat (image, &rawFormat); \ assertEqualInt (status, Ok); \ assertEqualGuid (rawFormat, expectedRawFormat); \ \ status = GdipGetImagePixelFormat (image, &pixelFormat); \ assertEqualInt (status, Ok); \ assertEqualInt (pixelFormat, expectedPixelFormat); \ \ status = GdipGetImageWidth (image, &width); \ assertEqualInt (status, Ok); \ assertEqualInt (width, expectedWidth); \ \ status = GdipGetImageHeight (image, &height); \ assertEqualInt (status, Ok); \ assertEqualInt (height, expectedHeight); \ \ status = GdipGetImageBounds (image, &bounds, &unit); \ assertEqualInt (status, Ok); \ assertEqualFloat (bounds.X, expectedX); \ assertEqualFloat (bounds.Y, expectedY); \ assertEqualFloat (bounds.Width, expectedBoundsWidth); \ assertEqualFloat (bounds.Height, expectedBoundsHeight); \ assertEqualInt (unit, UnitPixel); \ \ /* Libgdiplus and GDI+ have different exact degrees of accuracy. */ \ /* Typically they differ by +-0.02. */ \ /* This is an acceptable difference. */ \ status = GdipGetImageDimension (image, &dimensionWidth, &dimensionHeight); \ assertEqualInt (status, Ok); \ if (fabsf (dimensionWidth - expectedDimensionWidth) > 0.05) \ assertEqualFloat (dimensionWidth, expectedDimensionWidth); \ if (fabsf (dimensionHeight - expectedDimensionHeight) > 0.05) \ assertEqualFloat (dimensionHeight, expectedDimensionHeight); \ \ /* FIXME: libgdiplus and GDI+ have different results for bitmap images. */ \ if (checkFlags || WINDOWS_GDIPLUS) \ { \ status = GdipGetImageFlags (image, &flags); \ assertEqualInt (status, Ok); \ assertEqualInt (flags, (expectedFlags)); \ } \ \ status = GdipGetPropertyCount (image, &propertyCount); \ assertEqualInt (status, Ok); \ /* FIXME: libgdiplus returns 0 for each image. */ \ if (WINDOWS_GDIPLUS) \ { \ assertEqualInt (propertyCount, expectedPropertyCount); \ } \ } ATTRIBUTE_USED static void assertEqualARGBImpl (ARGB actual, ARGB expected, const char *message, const char *file, const char *function, int line) { if (actual != expected) { if (message) fprintf (stderr, "%s\n", message); printFailure (file, function, line); fprintf (stderr, "Expected: 0x%08X\n", expected); fprintf (stderr, "Actual: 0x%08X\n", actual); abort(); } } #define assertEqualARGB(actual, expected) assertEqualARGBImpl (actual, expected, NULL, __FILE__, __func__, __LINE__) #define verifyPixels(image, expectedPixels) \ { \ GpStatus status; \ UINT width; \ UINT height; \ GdipGetImageWidth ((GpBitmap *) image, &width); \ GdipGetImageHeight ((GpBitmap *) image, &height); \ \ for (UINT y = 0; y < height; y++) \ { \ for (UINT x = 0; x < width; x++) \ { \ ARGB expected = expectedPixels[x + y * width]; \ ARGB actual; \ status = GdipBitmapGetPixel ((GpBitmap *) image, x, y, &actual); \ assertEqualInt (status, Ok); \ if (actual != expected) \ { \ fprintf (stderr, "Pixel [%u, %u]\n", x, y); \ fprintf (stderr, "Expected: 0x%08X\n", expected); \ fprintf (stderr, "Actual: 0x%08X\n", actual); \ dumpPixels (image); \ assert (expected == actual); \ } \ } \ } \ } #define verifyPalette(image, flags, entries) \ { \ GpStatus status; \ INT size; \ ColorPalette *palette; \ \ status = GdipGetImagePaletteSize (image, &size); \ assertEqualInt (status, Ok); \ \ palette = (ColorPalette *) GdipAlloc (size); \ status = GdipGetImagePalette (image, palette, size); \ assertEqualInt (status, Ok); \ \ assertEqualInt (palette->Flags, flags); \ assertEqualInt (palette->Count, (int) (sizeof (entries) / sizeof (ARGB))); \ \ for (UINT i = 0; i < palette->Count; i++) \ { \ if (palette->Entries[i] != entries[i]) \ { \ fprintf (stderr, "Index [%u]\n", i); \ fprintf (stderr, "Expected: 0x%08X\n", entries[i]); \ fprintf (stderr, "Actual: 0x%08X\n", palette->Entries[i]); \ dumpPalette (palette); \ assert (entries[i] == palette->Entries[i]); \ } \ } \ \ GdipFree (palette); \ } #define verifyNoPalette(image, flags) \ { \ GpStatus status; \ INT size; \ ColorPalette *palette; \ \ status = GdipGetImagePaletteSize (image, &size); \ assertEqualInt (status, Ok); \ \ palette = (ColorPalette *) GdipAlloc (size); \ memset (palette, 0, sizeof (ColorPalette)); \ palette->Entries[0] = 0x123; \ status = GdipGetImagePalette (image, palette, size); \ assertEqualInt (status, Ok); \ assertEqualInt (size, sizeof (ColorPalette)); \ \ assertEqualInt (palette->Flags, flags); \ assertEqualInt (palette->Count, 0); \ assertEqualInt (palette->Entries[0], 0x123); \ \ GdipFree (palette); \ } #define HEX__(n) 0x##n##LU #define B8__(x) ((x&0x0000000FLU)?1:0) \ + ((x&0x000000F0LU)?2:0) \ + ((x&0x00000F00LU)?4:0) \ + ((x&0x0000F000LU)?8:0) \ + ((x&0x000F0000LU)?16:0) \ + ((x&0x00F00000LU)?32:0) \ + ((x&0x0F000000LU)?64:0) \ + ((x&0xF0000000LU)?128:0) #define B8(d) ((BYTE)B8__(HEX__(d))) // A utility for dumping pixel arrays to the console for debugging purposes. ATTRIBUTE_USED static void dumpPixels (GpImage *image) { UINT width; UINT height; GdipGetImageWidth (image, &width); GdipGetImageHeight (image, &height); for (UINT y = 0; y < height; y++) { for (UINT x = 0; x < width; x++) { ARGB pixel; GdipBitmapGetPixel ((GpBitmap *) image, x, y, &pixel); printf ("0x%08X", pixel); if (x != width - 1) { printf(", "); } else if (y != height - 1) { printf(","); } } printf("\n"); } } ATTRIBUTE_USED static void deleteFile(const char *file) { #if !defined(_WIN32) unlink (file); #else remove (file); #endif } ATTRIBUTE_USED static void dumpPalette (ColorPalette *palette) { for (UINT i = 0; i < palette->Count; i++) { printf ("0x%08X", palette->Entries[i]); if (i != palette->Count - 1) { printf(", "); } } printf("\n"); } // A utility for dumping an image and displaying it for debugging purposes. ATTRIBUTE_USED static void dumpImage (GpImage *image) { const WCHAR *wImage = createWchar("test-image.png"); GpStatus status = GdipSaveImageToFile (image, wImage, &pngEncoderClsid, NULL); assertEqualInt (status, Ok); int systemResult = system ("test-image.png"); (void) systemResult; } libgdiplus-6.0.4+dfsg/tests/test.wmf0000644000175000017500000020510413542672033020161 0ustar directhexdirecthexƚX2 T      4> --U8  444j4424449444$4ov4j4]4NN4>4,46443:333i|3Z3S73 3] 2 2 22 _2 ,2 2 1 1p 1W 1A 1, p1 R1 31 1 0 0 0 0 r0 Q0 00 0 / / / / q/ S/ 5/ / . . . .3 .H . ,x +k +_ +T +J +@ +8 +1 o++ Z+& D+" .+ + + *# *' *- * >* * ) w)p %)h (_ (V (M (D l(: P(6 D(1 9(, /(( '( ( ' ' ' ' ' ' ' ' ' ' ' ' z' p' e' Z' O' C' 7' *' ' & x& (& %u %Y =%; $ $W$ $#u#n+#F""J"G"D"@":"7"x3"m."b)"W""L"A"6 "$!!!!!!!!w!m!b!W!M!B!,!!!   28:96{/]%@$ ykfMV.G;1*%#c%?)0;J\riG&  (7GVfv ->N_p<zX7_O{}&q6dGVXEj4{#nXA+xbM8#udR?x,k`VLD=72.o+Y)C(,(),/39?G~OiYTc@o-| (7GyWsgmwhd`][YXWW XY.[?]O``dphmsy5zm|t_I3zcL5x}gmU^BP/D8.$ r\F/  )l2W=CI0Vd s}/uDnYhoc_\ZYY[ ]!`7eLkbqwydQb:a#` ``bcelUt}KiENW^ekqvz~rdE$xtmU_7P>*tuhW^8VP L K L Ps VR _2 k y    y ] D */ J l      : \ ~    * < 6P Qe i}      - O s     3 Uf tD %     & H lz a H , &        y i Z K ; +   q _ L 9 %        | f O 9 #        x d P = +   "4FYm~-{CyYxoxy|1EYl~  $ 2 @ N ] l {     " % ( + -  . , / = / N . ^ - o + ) % "    ^  L P ; -  + \  V  Y   y f S ? +    i S < &        { g T A .  , ? R e y        % ; R h ~      *>Qdw#5G[n  " %. 'D (Z (q & $       2 F Z m    % b   , C9 xG U e u D w    F | , % t d T D 3 #          ~ n ] M &> ,. 3 ; C K U ^ i t    | m ` S H = #4 8+ N$ c y        , B X! m( / 8 B M Y e s   3 G Y i w ) E a ~      + G c ~  x k ^ N > ,% 8 J Z i v     [   7 eQ j  ;    V        yq n] eI ]4 V O J F C B A A Bo EY HC M- R Y a i s ~   w e S B 2 #   2 F [ o         5 K a w         1) C8 UI i^ |t       ( D ` |      $ > X r   } k W C ,'4?BD=DdCA>:5,/S){" A Az Vq ki b \ W T Q P P Q .T DX Z^ pe o z <4  l S : !  z t o j g el cR c8 c e g k o t { h N 5        x b w  j-5=M[ha;o~b8)o?HW"oK&{pqcbVTGG8;(/% xcN8#,:KU`kv~{xvtss)s7tDvQx^{k~x#(IJpl 5]6Mbu~-BXRiJ=@4'c8 `q5W <}(#''(),/26;AGMT{\oddmXwNE<3,%  #1>LYfs !'/7?H R \ g s% - 3 9 ? C G K M O Q Q Q (P 6O EL SI aE o@ |: 4 - $    T!9! !5!`     8 cx i \ P G =? i9 N c y ~ u b M !63![!!!!! "lG"Jm"(""""""""""###,#:#H#}V#zd#ws#u#t#s#t#u#w#y#}##$$ $-$9$E$P$Z$d$m$u$}$$$ $$"$/$<$I$V$d$q$~$$$$$$$$$$$ $z$%r$0i$;`$FV$PL$ZB$c7$k,$s $z$$##########y#l#_#R#E#8#+###~#w"p"h"_"V"""o"oH"W""?!)!!!X!.!!   ~U o) a5 C S c 5u j   $! !r ! ! ! ! ! ! != !^ " " " " " "+ "N "q " " " " ! !7 !V !t ! ! ! ! ! u! `! I!/ !z "o "e 0"^ F"X \"T q"Q "P "P "Q "T "W "\ #b #i 4#q J#z E# ## $$1$+X$0$6$:$>$A%CE%Dl%C%B%?%3%%m%U%?% +% % % $ $ $n $U $; $ $ $ $ $ $ $z $^ $C $' $ $ $ $ $ $ %t %^ +%I =%8 O%) b% v% % % % % % % & & 5& K& b& x& & & & & & & ' &' :' N' b' u' '# '2 'B 'S 'e 'w ' ' ( ( ( "( *( 0( 6(- :(C >(Y @(o A( A( A( ?( ;( 7( 2( ,( $(4 (I (] (q ' ' ' ' ' ' l''' .( r( ( ( F) ) )i *P ^*6 * * + \+ + h+ =+ (+ + + * *{ *r *h *^ *Q |*D j*5 Y*$ I* :* ,* * * * ) ) )t )^ )H )2 ) ) ) ) ) ) ) ) )j )T )? )* * * * '* 5* C* S* c* u* *s *e *Y *M *B *8 +/ +( ++! A+ W+ m+ + + + + + + , , 4,$ I,+ ^,4 r,= ,H ,S ,` ,m ,| , , - - - "- ,- 5- >- F- M- T-. Z-> `-M e-] j-n n-~ q- t- v- w- x- x- x- w- v- t-# q-3 n-D j-T f-d a-t [- U- - =- s- - - . >. o.t .d .U /F 8/9 n/, / / 0 \0 / / / /m /Z /F /2 / y/ r/ k/ f/ a/ ^/ \/ [/q Z/Z [/D ]/. `/ d/ i/p/w/////n/[/G/5/#// 00/0C0W0k000000011/1E1[1q111111122.2B2T2f2 w22.2A2T2g2{2222222 2& 2< 2S 2i 2 2 2 2 2 2 2 2 2+ 2? 2S 2f 2y 2 }2 m2 '2 p2 2 2 *3 _3 3 3 3 %4 V4 4 4" 4. 15< r5L 5^ t5 m5 h5 c5 _5 [5 X5 U5 S5o R5^ R5N R5= R5, S5 U5 X5 [5 _5 c5 h5 m5 s5 z5 5{ 5l 5] 5N 5@ 52 5$ 5 5 5626]6666x 7t87tb7y7778&8H8g8 8# 8E 8i 8 8 8 8 85 8` 8 8 8 8 8> 8i e8 V8 F8 78 (8 8 8 7 7 7 7 7 7 7 Z7 7, 7H 7b 8z 58 X8 x8 8 8 8 8, 9K 19m T9 y9 9 9 9 9z 9V 94 9 9 9 9 9 : #:l =:V Y:B w:0 : : : : ; >; b; ; ; ; ; < 4< U<0 u;Wl;~;;;;;;; -> A>?R>^`>~l>u>{>>>">C|>dv>n>d>X>J>:>(>8>R=k====z=[=;==<<<<<h<R<<<&<<;;;;;;;w;~g;m;:F:F:W:i:|::::::w:o ;i ;c6;_L;\b;Zx;X;X;Y;[;^;b;g<}R<g<{<<<<<<<==<-=[;={G=O=V=Y=Z=Y=@U=aO=G===0="==<54"(24U("4(4(36)3)3)3)3*3**3>*3D*3K*4S*4]*4g*%4r*/4~*74*?4*E4*K4*O4*R4*U4*V4*W4+W4+V4"+T42+R4B+N4S+J4b+F4r+@4+;4+44+-4+&4+4+4+ 4+4+3,-3.F3.]3.q3.3 /3,/3N/3o/3/3/3/3/303903[03{030303030v31f361U3S1B3o1.31313121212222232g2G22{212D1203K0-3/S3-/w3.3-3H-3,3+44+4|*/4)A4)R4I(a4'n4&y4&4a%4$4#4S#4"4"4y!4 44 4u8[8D8/888r8^7J757 7 7777l57wu8Frq  5I]tqeT@*\c'Edzj\ O0 BU 6| + !   G s    ) Y    ! U    - f   3}tWZ<# 6\7]9`?2 4Uw#}FojbUI>4 *F"k )Pv:a QaEw934:weQF:" UgvV.[O#m  u x {   B ;|n!/>~/xppuk \c7co77778k 88p777/x7<7~6/6Z65n5;954 ^4 3 s3 2 ~2 2 1 1 0 0 / / .# .O-,M,+Vc+v+*v*&*) )"5):(Q(e@(w''G'&&H&%%B%$$6$w#a:# *# e##### $D$i$$ $ $$%=%&`%.%6%?%I%T &`*&lK&xl&&&&& '+'K'j' ''2'<((()e)))B***+h+++D,,,-i---E.. .#!/<k/W/t/H0001M1111&2Z2222"3R3333444^4444!4+%56K5Bo5O5\5j5z5666T67c----8[K}M$ #o;j1'KM  Z  C r  x y 8 [  k  _4 d  c   J:\5}#s*eBXlZOE<2{KKQ/ +/5<@6@>8B0&R f{.hK.E\m$+   n ~Q : p )  b   Y $ 3 Z I f i   &[nCc9n[g4c4 [0{k\N@[31']2Y-xJN=m'U :g%5FFXsj}#NoR447T&m{?tnhda`_5_ `bfkl]SLHTFGJ OLW_jvE1h[-FZg4k?[ 88u8L8>828'8%8:8G8W8j8]8#888O88889l 9F999#9(9,9\0952949595949r29L/9&+9&9 999l99999.9X999 9 988f8888"8Q88888d8G8)87 877N78+8Y>8+O8_8n8|8}8S8)88888Z8088888V8)8888f8288888^88888E8o88888;8by8p8g8\8P8%D8M68u(88877H77j7784G8g8y8g~8v8[b8B8n877C]7 76[U65 5 5 4f !4I 33 !3$ 2 2 1 1) 0: /Q x/n . s. - W-+,m,+6+*.*KN*h*)d))(y(*( ''&;'0&8&>G&@%@%<O%5$+$Q$ #:#@#P#{#I$$$?%%%5&&&,'~''!(s(l(X)Bg)*)*X***F+}+\+:1,, , - d- -d .4 . / / 0 0 C1 1y q2x 3 3 84 4 \5 5 l6Z 6 a7 7M188'891B9b9or9#o9Z91988}58 8----t 8 # #V #) # # # #y #N ## # # # #{ z#R i#* W# C# /# # #m "I "& " " " j" M" /"l "Q !7 ! ! ! !2 !H !^ ! }! {! {! |!7 !c ! ! ! ! !h ! !X ? $ 1 V {   p M 2( V {W '3 ' )+f/39R<.?CGBt?  "{9OR$njJE,q 9 q   ' si h _ X< S P O& Py S X c  y b J 3  . E ] u    u b P /? K. h       8 W u         u N ( 6 P k  o K (   @ a  a B $  5 Z    k T?:+_!b%kfYI:)-j"- n2s 5v*86xCRb9tyV4>eyvlb Y Q6IMBd;|5/+&# .5OkZ@& )v=^RGg0|7yQgjWG8) ,Ig?^~{wsp@n`mlmnps!wA|a0*KAK}aAGp/'VRmb2S C c{ 7  !C!ro!<!!!"R%"A"Z"p"S""""E"""u"0""z"_d"J" ".~ 4y :s @l Fe K] OU TL WD Z: ]1 _' a b c cba`][WSNHB;4,#wpic=f 2&D9VMhdx&:M`r"0?N^m}   # , 4 < .C BI UN jS ~V Z \ ] ^ ^  q!^8Q lrC`L6mZJ^=74.+-3U<"J\s}Cf$55COYv`Hehhfbm[CRG:+\9dC~cI0m[8nV'[I7'F}m[G1>N_oaF -0U{@h8b  5_8Sq0YjvX5I?85O6:BM[rlO/    + O v     K z    < m    & M t   %=!-!5!K!`!u!!!!!!!!v!i!&\!4M!B>!P/!]!i!v       x c N ! fN x9 #  mV?  z v+ s7 qC oN oZ of pq q} s v z ~               !C!!h!<?"""""""##&#m5#UC#<P#$]# j#u#####t#Z#@#&# ######l#Q#6## # #0#0#Z0#?0#%0# 0#/#/#/#/#/#j/#P/#6/#/#/#.#.#.#.#.u#j.j#R.]#9.P#!.C# .5#-&#-#-#-"-"-"-"-"|-"l-"Z-"1-<"-!,!,G!,!, , , , , , , , , , , , , , , , , ,} -q -f -Z -N -C ,7 ,+ , , , ,,,,,---?-V-m------- -# -9 .N ..! .N .c .x . . . . . . . /!/! //!-/>!;/M!I/\!X/i!h/v!x/!/!/!/!/!/!/!/! 0! 0!60!@0!I0=!R0 \0 b0t i0M q0& y0 0000m0<0 000z0K00000v0O0+0 0z0_0B0!0/l/[/M/BT/:"/6.5.8z.?<.I-X-jo--Y-0--.8.Q._g.5{. ....b.8.....h.@....o.{Z.UC.0*. .----o-_-Nr->W-?-)---,,F,,,,,Z,I,9,(,,+'+V+n+v+X+8+++****0w*IR*c.*~ *)))))9k)\W)E)6)))))C)m ))) ))H)v!)-);)L)5_)fu)))j).)((s(\N(J(<'3'-'+b'.9'4'=&J&Z&m&m&R&:&$&&%C%l%%%% %Q%%%%%8%^%%%%%!%q%% %^ %^ %] %\ %Z %V &S &N ,&I ?&C S&< e&4 x&, &# & & & &&&'' '/'>'L'['ri'`w'M'&' (x#(h7(VJ(D[(2k(y( (((((((f(=m)cb)iX)pN)wE)<)5).)()")))))))) ) ) ) ) )' )1 ): )D )L !)U %)] *)e 0)l 6)s <)y C)~ '"\'J"'d"&z"&"F&"&"%"u%"0%"$"$"e$"#$"#p"#Z"b#A"##%""""!r"!:"!"o!!C!!!m! ?! !{ C } _ SC  } hT {   !K!y!!!".2"Fa"`"|""*#*#Aj"j"*"0*#|I#xi#t#q#o#o#o$o4$qW$tz$w${$$%+%N%q%%%%%&:&Y&x&&&&,&<'L'\7'mM'}c'y'''''''(((=.(RR(~u((((8(h)))A)X).P)J)G)D)@)<)z7)f0)R()<)%) )((((Y(F(4("{(m(^(O(?(/(( ('7(yv(f(U(E7)7x)*) );*|**+A+++,I, ,,-"Q-.-;-J.ZW.l../[///030#K0/b0<z0J0f0 181f11181`2B2j222+2T2o33+3>3O3_3o3)~3D3_3{3333333j3E3 33x3h3X3}H3_63B$3&3 222222rz2Za2AH2)211b1c1X2SU2P2O2P?3S3X3_4hT4s44 5B5x555 666,`6J6j666 7)7$B7OY7{n777 7?7t755B/63666:6#=6HB6G6J6bM6N6 O63 6 555u5{O5V+525 4444{o4VS4184 42!3!e3!3!3!3!4!>4!j4|!4{!4{!4}!5!.5!C5!Y5!n5!W5!>5!%5! 5"4/"4M"4j"4"q4"O4",4" 4"3#3#3/#s3C#K3W##3i#2z#2#2#}2#S2#(2#1#1#1#x1#L1# 1#0#0#----83(,8~ l Y F 3   {uplhec`p_]^I]5^!^ _acfimqvq{]J8%&6EUet~ GG 9Nbu7TrH@9)49/H+W(e&r%%&(*.27=.oE:[sGJ""!!u9!P!> -   d W L B 9 B I L N O P O qN cL TI FE 7@ ): 3 \     !/!O!n!z!f!P!:" J"J"z}ky\vMt>s.stvy~rdT2 z[j.YH8'ui ^VO O V _ ix vh X G 6 % / \ 9^o---->8xaaa G7     ' / l8 QB 6L V a x   Q  !(!L!Xr!%!%)XMnN~'1.:ICcL~T\dkqx,bGC>%4)oQ4}hQ00       4 O k   .Ie  % ? Z t ! !0!0!A!Y!q!!j!L!.!!    t (S 31 = GHku h# Y= HU 5l        l O 1      x Y ;    n ^ M ; ) v k aWOHA<8w5c2N191$236:?DKS[oe]pJ{9( 'Ed ?]z $,;@TRobp|&HHj  8 P g } n V > $      u V 7      ~ ` C (n ^ M ; )   wcN9$o]J9(1Kg8Wu#=Um.Gb#HHbj`\VMB 5 %8 P g }     q U 8       a B #     n u^ fM X; K) ? 4 *! wcN9$ (o1]<JH9T(bq 'Ec8Tp.Gb%4BMV\#`Hb----L8 #,!(0&%0&%c0%%70#% 0 %/%/%/%`/%7/% /$.$.$.$k.$D.$.$-$-~$-i$-S$`-=$;-$$- $,#,#,#,#k,x#I,V#),4# ,#+","=,"N,#],#l,#{,#, #, #, #,#,# -"/-#l-Q#-~#-#-.#q.#.$.$B/2$/B$/N$0W$e0\$0]$0[$A1V$1M$1A$22$b2 $2 $2#03#r3#3#3z#.4U#i4.#4#4" 5";5{"i5J"5!5!5"5 "5"6"6"5"5"5#5#5/#}58#u5B#l5K#a5V#S5b#-5#4#4#4#4#4$c4$D4'$$49$4K$3\$3l$3|$3$b3$A3$3$2$2$2$2$r2$O2$,2$2%1 %1%1%v1%R1%,1 %1#%0%%0&% % %m %G %! % % % % $g $C $ $ $ $ $ $n $L $) $ $ |$ m$ ]$ L$b :$A ($! $ $ # # # #h #4 m# Q# F#=#5#-#&### #""b*"y""!!!!!! J": {"k " " # .#G U# z# # #E # # $ $[ 2$ A$ M$4 V$~ [$ ]$\$ZW$N$B$32$z$$#H##~# Q#F#f"## # #####'#7"]""|"]##>F#g#####s#O$+*$A$W$k$$n$G$ $$$$$W$.$%% %%`%7% % % %##r#A####|#K###p#\#WF#'/##"("U"y"""""x"n" c"3T"Id"""B""#>###9###."}"""c"t"L":!"}!!!8R!q!  R 4 \y,'9K\l|,y A m R !!=!R!y!!!!!!<"!""L""t"#"]#"#"#"H$"$#$#=%#%#%#7&#&#&"3'"'"'"-(d"B(T"j(d"(q"(v"(z"(~"("("("("("")"M)"("Y()#(R#'v#['#'#&#[&#&#%#[%#%#$#`$#$###n###o#"O#"+#>"#!"!"m!z"+!F" " !w !@ X! !  C =C w   q !L"&d""""b"/ #&#@#Y#Xo# ###u#;####N### 4! "!r !U !; !" ! ! ! ! ! !S !!!       n 3   / H _ v   y ` F 3  4!c34!C4x4 4E4`4z45555O5k5 5" 5< 5W 5s 5 5 5 5 5 5 5 5 5 5 5!5$!5!u5!f5!U5!45!5 !4 !4 !4 !}4 !W4!24! 4!3!3(!c34!Fi X&y7z3 @ uH lM bS V\ Fi 57^ 7R 7H 6B 6= 6: 68 66 63 66z67666y6&68X57^ "U""!!!!wf!jG!\%!O!B %> > x   x!e/!RT!>w!*!!!!"d"t",", mQt*$@KUtir{2-&nDJR)_ lyn{bWLC9&yIxhWpDP0/ ` ` \ E /1 P p Iy----& 8(  ]baI aa #" E2 .2.2,2,2 . .y , , , - +- U- ~- - - - .m2-2-"2d,2,2,2,|2-x21-u2Z-s2-p2-m2- - , , , , , z,& u,D l,^ d,~ - -1o-114-Q1,1I,1o- j- D,/ ,O /-. ;- I- P- Y- ]- a- e- j-0-0-Q0,q0+1+0- -z ++/, - 0,;/,E/C,O/+\/+i/+w/*/^*/)/)/=)/(/~(/( 0'#0_':0'Q0&1&0( 0'/+&0+ 0,u,Z++j' (j &/&F']_'s'(|((;)))[**+$|+0+;>,E,u, /,.,.,.~,y.w,T.q,/.k, .e,-_,.+.+:.+U.+n.+.+.+.+.}+.m+.\+.J+.6+/"+ / +/*/*/*/*/*/* /s*/_*.K*.8*.&*.*.*.).)|.)b.)E.){.(.(.(.(.(.(.(.(/(/( /z(,/k(6/\(@/K(H/;(P/)(U/(Z/(]/'_/'_/'^/'[/'W/'P/'H/o'?/^'3/L'%/<'/,'/'.'.'/\& 0&/&/L'/'/ (/j(/(t/*)d/)V/)H/M*(4N(=^(Hm(T{(b(p(((((((((;)'))))))))***$*4*yD*pT*ie*cv*^*[*Y*Y*Y*[*^*b+g+n(+u9+}I+X+f+s+++++++++#+6++_,u,-Y,-Y,,-C,,-,,,b+,*+*+o)+(+(+['+&+%+.%+p$+#y+"t+Y"p+!m+.!j+ h+ f+pe+e+He+f+"h+j+m+kp+u+Hz++%+++t++T++5++++ ,k,0,OD,Y,+~+u+l+ a+V+J+&=+,/+2"+6+:+=*?*?*@*?*=*;*8*3{*/l*)]*#O*B*5* (****)))){)P((({(n(_(P(@(/(( ('''''''v'd'T'C'4'&'' ''n&[&F&0&&&&Q&!&z&&-'$'9'M:(`(r(I)))Z**+m++)))***+,*:8*ID*YP*i[*yf*p*z*******$*9*O*d*z********0*H****&*[****$*Rx*b*J*1**)=)\)x)|)[)8))((((_(:((''''ny'Xd'AO'(<'*'' '&&z&Y&8&&&&&&^&8&&&&&v&O&(&&&&&g&Q'; '%''*'6'B'O'\'i'w'q'_'N'>'.''''(( (1(A(R(c(t((((((&%%%_%A%(}%k%[%M%A%7%/%)%%%#%#% %%!)%".%#5%$?%x%J%`&V%C'e% (u%(%)%*%X+%,%,%o-&Z-k&D-&0-'-j' -',(,A(,l(,(,(,(,~(,L(,(y,'V,'/,',|'+Z'+<'u+ 'A+' +&*&*&]*&!*&)&)&l)&1)&(&(&(&K(&(&'&'''!'X'>'0'^' ''&'&'&'&(&7(&\(&(&(&(&(&)&4)&W)&x)')!')@')a')'*'.*'H*'`*)(v*X(*(*(*(*!)*W)*)*)*)*8**U**q************ +*%+*<+*S+*j+*+*+*+*+*+*+{*+o* ,c*,W*-,I*>,<*N,-*^,*m,*|,),),),),),),+,m+,+,*,Z*,),),I)-(!-(4-:(G-'\-'r--'-&-z&-!&.L&.&{.&].&A.&'.&.&-'- '-'-&'-6'-F'-X'-j'-~'|-'w-'t-'s-'t-'w-'|-(-$(-8(-K(-^(-p(-(-(-(-(.(0.(.)-)-)-)-)-*-*r- *e-.*Y-=*O-M*F-\*?-l*:-}*6-*3-*1-*0-*1-*2-*5-*8-*=-+B-+G-++N-9+T-F+\-R+c-]+k-g+t-p+|-x+-~+-+-Y,j*|********** y*n*"a*+T*3G*;9*A**F*K *N)Q)R)R)R)P)M)H)C})<l)4])+M) =)3)*)!))) ))(((((((((s(h(\(P(D(9(-(!(( (((() ))!)0)@)P)a)~s)w)r)n)l)k)k)m)q*u*{+*<*L*\*l*z********,*@*U*j*%*%*0%*D%*W%*j%*{%*%*%*%*%*%{*%l*%]*%M*%<*%+*%*%*&)&)&)&)&)%)%)%s)%b)%P)%@)%0)%!)%)%)u%(]%(E%(,%(%($($($($($($)$)o$ )_$0)P$B)C$U)8$i).$~)&$) $)$)$)$)$*$$*,$2*7$H*E$^*V$r*i$*$*$*$*$*$*$*$*$*%* 8) ' ' ' ' ( ( C( n( ( ( ( ) 8)38)c3)k3(t3(|3(3n(3C(3(3(3'3'3'3'38)"3(2( 3w'm3'"3(^ ( 's w' (^ (w2(1g(=2''E2''M2('V2*'_2-'q23'2;'2M'2\'w2( ( W'D '' g( (1R( 1'(\1&1'1R( M( ' ' ' ' ' & & & & &$ &t '( M(P'b's''''''''''|'p'c'U' G'&9',*'0'4 '6&7&8&7&5&2&.&(&!{&k&[&L&B&9&0&(& &&& &&&%%%|%p%d%Y%M%A%5%*%%%%%%&& &&&!&/&>&N&v_&lp&c&]&W&S&Q&P&Q&S'V'Z''`9'gJ'p['yk'z''''''''''%':'P'!%'6%'K%'_%'r%'%'%'%'%'%'%'%'%z'%k'&[' &J'&9'&''&'&' && &&&&&&&&&& &&&p&%_&%N&%>&%/&%!&%&%&% &%&%&%%u%%j%%^%%R%%G%%;%%/%%#%%%% %%%%$%$%$%$%$&$&$ &$&$&$ &$(&$0&{$9&s$B&k$L&`$[&W$k&O${&H$&C$&>$&;$&9$&9$&9$&:$&=$ '@$'E$*'J$9'P$G'X$U'`$c'i$p's$|'~$'$'$'$'$'$'$'$'$'$'%'!%'M &0 S& % % b% % $ u$] $ K$ V$ k$ $ $ % a%8 %V &n h&} &M &(4&4&4g&+4&I4%j4a%4%4$4$4l$4W$4K$5$4v$4$4%4d%{4%`4%E4T&(4& l& $$ $+ $2 $: $K $] $ $ $ <& l&3l&h3<&p3&}3%3%3%3G%3%3$3$3$3$h4$3l&"3&2%2;%3%"3&^ & % ;% %^ &. % P% q% %. %R2%1%1{%}2P%R2%r1%r1%w1%r1% % %$ % %!$?$]$z~$k$W$C$-$$ $:#T#m##~#b#E#E#Y#m##### #.#<#K$Z$j!$z1$?$M$[$!$?-$*[$*M$*?$*/$+ $+$$+#2+#@+#N+#[+#g+#s+#+g#+?#+s#,#4,#f, $,"$,9$,N$,c$,w$-$!-$?-$RK$`6$m!$y $######s#\#E#-##"""+#O0#rG#\#p###!#E#j####$/$RK$*E$W' $}'#'#'#'#(#5(#X(#|(#(#(n#(Z#)E#()0#J)#l)#)")#)G#)_#)v#)#)#)#)#)#)#)$)"$*4$*E$|#######)#C#]s#xd#T#D#"#"I"z""b"N":"&")"<!M!^!m!8 ! !$ !4 !E "l ." U" ~" ",!"a!"!#!D#!U#"e#"u#9"#R"#k"#"#"#"#"#"#"#q"#!#}!#!# # ##9##S##i##x##|#----8KII!!!!!!!!!!!z!r!j!c!]!W!Rz!No!Jd!GY!EN!DB!C7!D+!E !G!J !N R X _ f s             ) 6 B N X b j q w!|!!!0!?!O!}^!xn!q~!h!\!W!R!L!F!9!+!!!!!6!6!6!6!6!t6!j6!`6!V6!L6!C6!:6!26!*6!"6!6!6!6! 6v!6k!6`!6U!5I!5>!52!5&!6!6!6! 6 6 6 $6 06 =6 K6 X6 g6 u6 6 6 6 6 6 6 6 6 6 6 7 7 7 &7 -7 37!77!;7"!<71!<7@!:7P!77_!17o!*7! 7!7! 7!6!6!6!6!6!6!6!H:,~zupib[RJ@7-" th^VOK H/G>GLI[LiPwV]enx.=MXcltszeVH----z$H 'E 'C 'D v'F l'J b'O W'V M'_ B'i 7't ,' ' ' ' & & & & &G &s & {& h& V&$ F&R 6& %& & & %W % % % %I%%%|%Yn%`%R%7E%8%+%$%w%%"$y$.$$$s$p$qs$tb$yT$I$@$9$4$2$2$ 4$!8$"?$#H$$R$%_$&n$'$($y)$\*$9+$,$,%-,%f.L%/n%/%p0% 1%1&"21&R2B&2T&2g&2{&3&C3&o3&3&3&3&3&3'3 '3' 4&'42'4>''4J'.4V'34b'64n'74z'64'34'4'4q'3b'3T'3F'39'3,'d3 'H3',3'3&2&2&g2&1&I1k&0C&0&O/%.%-%-%3,x%Y+\%x*C%),%(%'%&$%$$$#$"$!$ $$$$$~$t$l$f$b$a %c %-%`:%G%fU%c%vr%%% %%J%%~%%&a"&6& J&_ _& u& &w &0 & & &o &6 ' -' F' _'q x'H '----8` C4B4A4y?4<4G9444/4T)4!44@4433h333O33}3Se3K3/332u2 2 2 ^2 32o 2) 1 1 1 ~1 _1 ?1y 1e 0T 0E 09 00 w0) T0% 10$ 0% /) /0 /9 /F b/T @/f /z . . . . . a., D.S (.} . - - - . %. <. T.u n.h .Y . l. 1. .' -F -e - - - - -u-6c-aR-?-7-.-%- -Y -, ,i,,4,,,j,,,s,g,],"T,`,k,w,,,,,,,,t,]--,,,=,f,,v,i,],&R,KI,oA,:,3,.,),&%,K",q,,,g,,%,+s,Z",D4,0G,Z, n,,,,x,s[,N,B,7,-,$,,,H,c ,~,,+++:+s+++4++++++,',z<,cS,Lj,7,b,E,8, ,,,!,K,h ,,++++ +'+A+\+w++++C+++ ++ ,,&,5,H,hd,C,m,S,=,+ *,[ , , , + !+5!+b!+!+!+!+4"+t"+X"+=",$", "',!:,!N,!Y,!e,!q,!,!i,"T,K"B,}"1,"",",# ,=#,m#+#+#+$+3$+h$+$+$+$+$+$+$+$,$ ,$,$",l$1,Z$@,5$`,$,$,#,#,#,$,,$,R$,y$t,$e,$X,$K,%?,>%4,g%*,%!,%,%,&,>& ,l& ,w',d'!,R'),@'2,/';,'E,'N,&Y,&d,&o,&{,&,&,&,|&,&,&,',G',r't,'g,'\,'R,(J,9(D,b(@,(=,(;,(;,')<,c)?,A)N, )_,)p,(,(,(,(,m(,(,(, ),S),),),){,*t,.*n,X*k,*i,*i,*j,+n,P+s,+y,k+,K+,-+,+,+,*,*,*,*,*,*-*-*- +,>+,p+,+,+,,,4,,L,,d,,},,,,,,,,,,,,-,,-,G-,a-,|-,-,-,-,-,-,o-,_-,P--B- -4--&---$- -.-,G-,e-,X-"-L-N-A-z-6-----%---%.-P.-{.-.-.-/-//-_/!-/*-g/4-A/>-//C-/I- /O-.U-.\-.d-.m-.w-.-.-.-p.-.-/-E/-m/-/-/~-/}- 0}-60-`0-0-0-0-1-,1-1-0-0-0-0-0-0-y0-c0-N0-:0-&0././0.0&.L0.0.0.0 .1.31.K1.c1.z1.1 .1.1.1.1.2%.2-.*27.>2B.S2N.g2\.{2k.2{.2.2.2.2.2.2.2.2.2.x2.m2.X2.B2.+2.2.32.T2.u2.2.2.2 /2/2/2*/26/2C/3P/3b/3r/)3/23/:3/A3/E3/I3/K3/L3/L3/K30F380=3v0*3U03<03003#020202*02U02l0202020202020212'12912I12W12_12g12q12z12121j21S21>21-21D21X21j21y2l12]12N12>12,1212020|21a221D2R1&2s12111111112\1.291H21a20x202020202s02902/2/2/2G/2 / 3.3_.,3-@3-T3 -f3,w3,3+3'+3*3+*3)3))3(3"(3'3'4& 4&4%4% 4$&4#+4x#04"44!;4 ?4B4 C444R 4 4!40"3"3m#3 $3$3B%3%3t&3 '3'32(3(3Q)3){3_*k3*[3Y+K3+93>,(3,3-3o-2-2.2o.2.2.2>/t2x/^2/H2/1202(02F01]01o01{01010s1{0Z1o0B1]0)1E01&00 00/0/0/0/0/0/0|/0b/0D/r0"/W0.50. 0./[./.V/".{//./<./K./[./n.0.10.Q0.P0.N0{.K0n.F0P.:0/.*0 .0-0-/-/F-/,o/,G/,+/,:/,I/,X/,f/,/,/,/-/'-/?-0-/,/,/w,/K,/!,/+/+/+/+o/[+X/2+?/+$/*/*.y*.*.*.* /*A/*Q/*`/*o/+|/+/!+/0+/>+/+/*/*/j*/>*y/*m/)`/)R/)B/y)1/R)/)) /(.(.(.m(.(.(.(.( /(/(1/)H/()f/(a/(\/\(W/"(Q/'J/'B/'9/O'./'!/&/&/&.J&.&.%.%z.%.%.%.%.%. &.$&/F&+/&'/%$/% /I%/%/$/$/~$.f$.N$.5$.$.#.#.|#.@#.#m."J."h.".#.#..#.H#.e#.#/"/".b".5". ".!.!.!.b!.9!.!. . . .O l. J. g.4 .K .b .{ . . . ....~.R.'.....[.3. ..a.L@._U.yp............".....|.Q.&.....\.5..g.vE.`.{......!.1.A.Q.a/o%/X%/B$/+#/!////k/B......3.u....".1.A.Q.b.s.///$/./7/@/p/u/y/cz/6z/ y/u/q/j/cb/9Y/N/B/5/&/]/,/</K#/Y0/h;/P/c/t/////r//}/ 00C50M0f0I0000c0<1171 R1 n1 1 111<1d2-2H2 b2U|222a222p33!$3}33B3>P3^3 k3sx33L33.3333333y33v33x33}344 444----f$=33733133.33.3}32w3q3;j3c3I[3R3]J3@3y63 ,3!303 3_2229222*2226w2l2`2S2F292h+2M2521 11111111u1f1W1I1;1-1 1110#0:0S0n000 0O00v02d0S0A0300 00R0/"////~/D/ //y/sq/Dk/f/b/a/`/] a/.!d/!h/"n/#u/b$}/(%/%/&/h'/ (/(/)/**/*0i+0+40,L0-f0-0-0-0.0?.0s.0.0.0/0E/0t/1/1/%1//1/81/B1/K1/T1/^10g1 0p10y101/1/1/1/1g/19/1/2.!2.22_.C2".T2-c2-s2_-2-2,2,2I,2,2+2/+2*2"*3)33)"3(-3?(:3'G3'R3&]3%g3Y%p3$w3%$~3#3"3Q"3!3!3y 33=3----j 8icci$######z#hj#XR#H:#9"#, # "" ""!! ""%"1"="H"R"["c"xk"lq"`x"T}"H"<"$" """""""]"%"!!}!0G!:-!C!K Q      )&!NR!u~!!!!" """i"O"4"'"" "" """!!!!!|!n!`!R!"""~"y"s"l #c'#ZD#Ob#D#9#,# ## ###$y*$q*#j*#c*#\*#N*#A*#4*#(*}#*a#*D#*&#) #)")")")")")"*!*!*!)!)!)!)!)!)!)")") "s)"e)"W)"J)"<)"!)")"("("( "("(!(!) , %, -,!6,-!@,G!K,b!V,}!c,!p,!,!,'",_",",",",","{,"d,"L,"4,"(,",}",x",q"+k"+c"+["+R"+H"+="+1"+%"+"+ "+!~+!i+"c+"[+"P+"E+ #7+"#)+:#+R#+j#*#*#*#*#*#*#*#y*$>!  } s? n haZRI?e5H&  ~ W 1    i#M32EZr6a'` :W0sDYp "8 N'cDwbo=g\QD6'eBtlRL1( wQ,n\M@5r,M&)!!%u+R3/= IWgxhH)  $;PcqvZC-T8}_r'9I9ZUjry1Kc7zTq4W{=f=jhQ<)Eo Ak>hH'+<cNBb!xyW?2t6a=[w(Db *27<9>b>=:76 6@6_8:=@H Q`[eM6 ~lX}Bj,XG5$gH *  0@Paq|tle^YOE;1(w`G -pL'Ba~cH-Hq4Us'&#pQ0 nG{Y9q`P@JR5XV]wacddca+^EZ^VuQLF0tX=$   6Mcy~ytn h$ a9 YM Q` Hs ? 4 *       !!&!3!>!/>!/>!/;!/7!/1!/)!/ !/!/ !/ x/ l/ a/ U/ I/ >/ 3/ (/k /T /= /% / ......k.O.3..... .$.=m.XW.tA.+.%...u.^.E.+ . . . ...w.V.5&.0... --&-4-B-Q-_j-~I-)- -,,U,rr,[,D,)s)e)S)>)'))~)c)RK)&8)$))(((z(^(C('(L(q}(y(t(n(h(a(-Y(GP(`H(w>(5(+(!((( (('''q'a'P'@'0' '''{'l'j'h' f'*b'H^'gZ'T'L'G'B';'4'$'' &8&O&f&|&&r&Z&N&C&8&-&#&&&&&&^'& /&3&5&7&9&f:&F9&%8&6&3&2&2&b5&99&?&F&P&[&i&bx&D&(&&&&&'3'S'u''''(;(h((((1)2h)W)y)))) *! *B2*cC*R*`*m*y**'*H*h*>*****k*A**t*g*X*oG*E4***))j)=)))))f~)=y)w)v)x){){)W)4))))))q)T *7#*=*Y*w*****y+j7+ZQ+Ji+9+(++++++,8,}_,Tx,,,,,,,.,E,\ -t -4-I-_-}-- -)-H-h-..&.2. <./D.RJ.uN.P.P.N.I.)B.M:.r/.!...-,-Q-w--f-D- -1-R,t,,,,k,X,BG,e7,),,,,,=+b,D",'7, M,d,{,,,,p,Y,D-05-S- s---.I..../:/a//////0+0=02M0M[0if0n0u0y0{0 z01x0Ws0~l0c0X0K0<0H10e'0000 00 /? / / / />!+R+J,B ,9,0,%, 8,J,W,g,x,~,g,6,-A-Y-xo-Z-<------s-N-)....-_-3-----nx-Pc-2W-$K-?- 2-%-- -,----(+-S@-T-h-r-{---0-H-`-x-------6-Ux-tj-Y-F-/--),g,,,n,R,-8,W,,l!,, ,,++++++(+7+B+RbLgEk>o6s.y~ lO8mGPU4cp|eG( gE"seVF5#jS<'t[A',3;E[ v,Ou-&I.e5:=>=:)4N+u #Ku}u/mFe^_uYTPNLLM PT-Z=bL----Z8  e V Q K D 9    ! ' ~. G6 > G P @X a i p Kw |   , }) }) })~)))))),9 , ----R8          / B W w"/" C" W" `" j" s" }" " " " " " " " " "o"j""----8/8 #         n [} Iu 7m %e [ Q G < 1 $     y l ^ Q E 9 -| "i i v      y c 7            $ 2 @ N l       7 N } c i i n c X K = -        # {& k( L, -- - + ) % !  c G *   -& ?0 R: gC }K R X ] a d f .f Jf fd a ] W P H  > , 3 G & b  }  ! !i _!i E! +! ! ! !  & 2 = H y S h \ W f F n 4 v ! }        ~ g P 8   v j ] P B 5 '   % / E ] w | b H = 1 &  $ 5 FXX  3 3 U  u 3 G [ p ! (! ;! M! ^! m!' {!G !i ! T! P!} K!l E![ >!I 6!8 -!& #! ! ! !  < !c ! H 3 ----8(    { ` C #   =Rg|  & 7 H W f t w c  s c S @ ,  .! 2! 5! 6!! 6!1 5!A 3!R 0!d -!w %! ! ! ! T! Z! `! e! h! l! n! p! r! t!` t!A t!! t! o! ! ! !> !Y !r ! ! ! ! ! ! T! ----X8IIIM!10/,)%!~{xutstuuwiz^~RG;0%  ,;IXes*7DSap|n_ P&A+1.!1C150(/,)%!ui^RG;0%  ,;KZiw%2?M[jz r&c+S.C1#1#0#/s#,f#)Z#%O#!D#:#0#'######"""""""""u"i"^"R"G#; #0#%#)# 8#H#W#g#w##########$$$*!$7)$D0$S5$a9$p;$<$;$8$4$.$&$$$$### #&#+#.#1C7,  vlbWL@5)z uq(n8nGnVpetty/@QbsrcSC----86W6J|6Ae6:T65M62H6.B6+>6&46)68 9_999999_9{9:988~(87 :7W 6 +6 5 5f h4C 3( *3 2 1 K1 0# 09 /V .x o. - z- /-) ,M ,p K, + + d+ +*8{*V-*s))B)((V(('"j'0';&D~&K/&O%Q%OD%K$E$;[$. $# @#E#p%$|$$&%{%%!&t&&'g''v(dU(Q(<(&?)) ) #* n* * +f L+G +( ', , D-d -$ E. . G/ / `0h 0V 1J !2F 2J V3U 3h 4 5 5 D6 6D U7 7 L86 8 #999:R:)~::}:8::r:;:):: :a999 9_9v9]9B9Y'9 988P8{8>887r7C7d76WRs4aox;}MnS8V\y_eR@ 8}))cX /6  & D 7  [ h % U J Z F J V h  4  5 $ 7d  T ( .G xf   X   <&<%QtdvdZUVFjK n .;E7KOQLOKD`;0"s%9NsV8d  } 0 p M L)    x V d9 # 0    Q  (  C x f  P  AW  S~A_rR<,R----8&QaWRaa__aUaWaQYYaWaQ[VaQUUQQc_aQRcaaYYu]G1 q_L8# {aH.qT8=Y)y>]|$3DXn$4ALS3WTXuUOE6# =\iup_O>- 9i9N949998888x8g8Ux8Bj8-]8Q8G8?88828/8-8q-8X.8?28&78 ?8H8S8`8p888k8_8S8H8>858,8% 99+9<9L9 ]9 n999999 9 99::"#:)3:1B:9P:C^:Ml:Xy:d:q::::::::.:H:a:{:::::: :#:8:L:_v:qc:O:::#: :99999'>Tix~nbUF6% u`L9& (@MYeqxncW K?3&!% )+.0233Z2Q3H4>657<CDOMYWbbjmryx~999999}:u :k1:`A:TQ:G_:9l:*y:: ::::::::y:f:T:B:0::::::::|:|:s:i:_:V:V:qP:I:@:5:):: :99 999&9,92v95`97E96+949382838486878D8O8Y8c8k 9r9y"9/9=9K9Y9g9u999z{qdgMZ7M#>- lT;!s\E/"" 1@O_o'8IYjz)?U&l4?IPVY[[0YIUaPyI@5*#4DR_kjtQ}6;e;J;0;|;t:j:^:Q:C:3:":r:d:V:J:@:7:0:x*:`':H%:/$:&:*:/:7:@:L:Z:lj:U|:?:)::::::: ;;);:;K;[;l;};;;;;;;;<<"<2<A<P<^< l<z<"J i4 Z) L ? 4 1/,):K\l+7CNYclu}oY@$-CC)zrh^QzDh5X%H:." r[E. '5F|Xgc\pQ|G=4,%  ,;K[jz %,5= G R# ]5 pF T ` j s z ~  ! 9 P g} ~x q i ` U I ; -  1 @O[gqyv]CCX\VsSMF>4)  # . 8 A H O T vW cZ Q[ >[ +Y V R M F = 4 (    -:HVcq~mXA(  %-4:@EJMP SU-XCXg}Nu7k _ RC3!ypuWr>q$s uzu^G1% '6FUfv .>O^n}  ,AWn%+.004.M*e%~ )9IWocWn?w%~ <<u<[<~A >>> >A>c >=====(=4=@=Kp=Ua=^R=fB=m2=t"=y=~=<<<<<SQ N!I8BM9a.t"r]H4 {r$3CR`o}ypeZM>-~qW>5+!  "%))*,"/%7+A1M6Z;h?xCJORS' /' ' ' ' & & & & & & & }& l&  . F ] s     x h X F 3  ! ) 0 6 : < > =~ ;k 8X 3E ,4 $#          , D \ t           ! / q; _F LP 9X $_ d h j i g e d te ig _i Tj [v c l v             w& & & & & & & ' %' 6'x F'h T'X b'F n'3 y' ' ' ' ' ' ' ' '~ 'k 'X 'E '4 '# |' p' b' S' B' ?' =' =' <' =', ?'D A'\ A't A' @' ?' <' 6' /' &' ' ' ' &! &/ &; &F &P &X &_ r&d \&h F&j +&i &g %e %d %e %g %i %j %v % % % % % % & & #& 1& ?& M& [& i& w& > ? = 9 p3 W+ ?! )         o W ? ' } { z { ~  u \ C +      7 W w  | { ~  ; Y w      . J &h 1 9 > ? = 7+ -M o          r b% R+ A0 15 8 ; = > > +> += l+: R+5 9+. +$ + * * * * * * * y* m*z c*d Z*L S*4 M* J* H* H* I* M* R* Z*m c*T o*< }*% * * * * * + 6+ X+ y+~ +{ +| + + , 9, V, q, , , , , ,: ,X ,v - - - - - -; ,\ ,~ , , , , , v, g, X, I, 9,$ ),* ,0 ,5 +8 +; += +? +? +>     . A T f w       r a P = +          v f W H C > < : 9 8 1 + ' # . : F S k          ' 9 tJ iY ]g Ps C} 6 (           q X A 7 - $   $ ( , 1 = O f s        + + + + , , -, ?, P, `, o, ~, , , , ,m ,\ ,J ,7 ,% , , , , , , , , , ,s ,d ,U ,H ,C ,> ,< ,: ,9 ,8 ,1 ,+ ,' z,# w,. v,: u,F t,R t,j t, u, v, v, t, n, g, ^,! S,4 G,E :,V +,e ,s , + + + + + + ~+ k+ Y+ F+ 5+ #+ + + + * * * * * * + + !+ 8+ E+ S+ b+ q+ + + + + a E *     y l ] sM a; Q) A 4 '     v ] D +      , ; Mh aR mF {: / $     %6GXiz     ,* ;5 I@ WM kb }x       ! : S l        p$ `7 NI ;Z 'i w      } a 7 7 6 6 6 6 6 m6x X6j D6Z 16I 67 6$ 6 5 5 5 5 5 5 5n 5U 5; 5" 5 5 5 5 5 5 6x 6b /6M O61 p6 6 666787Y7x777 7 7+ 8? 8V 38o G8 X8 g8 s8 }8 8 8@ 8a 8 |8 q8 a8 N8 78% 8C 8P 7\ 7f 7p 7z 7 7 7 7 7 t7 c7 R7 A7 07 7 as xs p l g ` X O E : - . ; G R \ e m t y ~ u a N : & ~ y s k c X L H C ? : 0 ' 'S !g {           q \ G 1           % 0 ; D L T Z ` e i l )o 7q Er Ss as $7s ;7r Q7p f7l z7f 7_ 7V 7M 7B 76 7) 7 7 8 8 !8 *8 28 98 ?8 D8 H8n J8[ L8I K86 J8$ G8 C8 >8 78 /8 %8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7" 7. 7: 7G 7S 7k 7 7 7 7 7 7 7 7 |7 m7 ^7 O7 @7 17 !7 7 7 6 6 6 6 6 6 x6 p6 i6 d6 k6% s60 |6: 6D 6L 6S 6Z 6` 6d 6i 6l 6o 6q 7r 7s $7s _ C ( w o f ] U L B = . .  "    v ] D +     $ 4 E Y lf `t T I ? 5 , %     ! 2 C T e v         % -6&@4JBVObcwu  7 P j        y( k< [P Jb 7s #  { _ '1 1 0 0 0 0 0 u0 `0 L0s 90b (0P 0= 0( / / / / / / / /k /Q /8 / / //// 00w10b?0VM0J[0@j06y0-0%0000 0 00 11.1?1P1a1q1 1 1111%1,151?1I 2T2`'2l;2M2\2i2t2}22 2+ 2D 2^ 2w 2 2 }2 u2 l2 `2 T2 F2/ 62B &2U 2g 2w 1 1 1 1 1 w1 ]1 B1 '1 _ x y o c U G ,7 :& H T ^ h p v |  t ` L 8 }& x q h^SE6%#"# # #; !Y i x        # x * ` 0 F 4 ) 8  9  9  9 7 4 3 4 5 7 8 A J N R V X \ _ b e k q v {   8 O _ ,1 E1 \1 s1 1 1y 1o 1c 1U 1G 17 2& 2 2 *2 32 <2 C2 H2 L2 O2u P2a P2M N29 K2& F2 ?2 62,2 2221111 1 1; 1Y 1i 1x 1 1 1 1 1 1 1 1 1 1 1 1 o1 [1# E1* -10 14 08 09 09 09 07 04 03 04 ~05 u07 l08 o0A r0J s0N u0R x0V |0X |0\ }0_ 0b 0e 0k 0q 0v 0{ 0 0 0 1 1 ,1 ----$M(3i+#M(30%M(----(8M)Mr(D!r(M))r(r()'(&'('(M'(M&D!'(M'(----T8Y[;7})Z)6))))~)t)ai)Rc)D])7W)*P)H)A) 9)0)())) ))((((('(=(Tv(nd(T(E(7(*( (,(O (s(''''*'M'p''((( (("(@.(V<(jK({[(m(w((((((((w(l(`(R(C)3 )")$)/):)D)N)W)a)qi)Xq)>x)#))))))})*)))))))))j))N)|)2)u))m)(d)([)(Q)(G)(<)(1)w(&)e()T()C()5(('(((((((('('('('('('('}('u('m(([((K(-(<(D(.(\("(w(((((((((')'6)'Y)'})')')')'*(2* (U*(w*(**(*6(*D(*S(+d(-+v(E+([+(o+(+(+(+(+(+(+)+)+)+)+')~+/)u+7)l+?)a+F)U+M)I+T)<+[)-+a)+h)+m)*s)*x)*)*)}*)T*),*)*)m)l)j)e) _)*X)IN)gD)8)+))) ))((( (((#()(.((((((}(a(C)#)))#)%)')t')]()B()*')')')')))-)2):)A)H)N)S)X)\)!`)@f)^j){l)m))m)*m))*l)>*k)T*i)k*f)*c)*^)*Y)*S)*L)*D)*:)+0)#+$)4+)D+)"+)+ )* )*)*)W*):*")*#))#))!)))))f))8)))(((((((((((((((((()( )()()(!) )-))8)4)A)J)I)a)P)x)V))\))`))h))m)----p8ACqqaan T,Y + + +> + a+ T+ F+ 9+ ++: +b + + * (' !) >) K) W)f c)H o)* |) ) ) )t ) * ) )' )> })U n)l _) Q) D) 8) ) )B (r ( ( ( (8 (k ( ( (w(*N+ [+ h+ u+r +G + + + + +q +F + , , ', =,n T, 3T,2=,2',2,Z2,/2+2+1+1+1+]1+21+1+0u+0h+|0[+L0N+v0w(0(0( 1(@1(r1(1(1(2(92(j2 )2)2)2*)27)2C)2P)3^)%3m)<3|)R3)h3)}3)m3*3)2)2)n2)O2|)12o)2b)1V)1I)1=)O1 )0(0*0+1+:1+`1*+18+1F+1T+1c+?2+2+2+"3+ 3T,3*VM(3% #M(3*Mx*t*m*d*nW*>I*8*&**))h)Q)=)-v) Y):))(((#(0|(B\(W=(q(('''+']x'b'T'H'>'4'B,'e%' '''''6'X'y''"'('.'6'5?'QH'lR'^'j'w''''''0'?'K'V (_(f0(lC(qV(sj(u~(u(s(p(l(f(^(V )K)@0)3C)$W)j)|)))))))h)M*0* *.*7*@*H*P*pW*U]*;b* g*k*o*r*t*v*w*gx*Mx*3*x**x*)w*)v*)t*)r*)o*{)k*a)g*F)b*,)]*)W*(P*(H*(@*(7*(.*s(!*U(*9(*()()')')')')')')o'l)`'Y)Q'F)D'2)8').' )%'('('('('('('~('j('W('D('0(&'(/' (:''G''V''f''x'''''''''w''j''^'(R'3(H'P(?'m(6'(.'(('("'(' )'+)'M)'o)')')')') '*%'B*,'f*4'*>'*H'*T'*b'(+x'Y+'+'+'+'+',(,,;(B,[(S,z(a,(k,(r,(t,(s,)n,9)e,X)Y,v)I,)5,),),)+)+*+&*t+8*G+I*+W**c**m*q*t*3*x*3^*D"M(3<&M(3^*R*z***)):)^))))))#)@)[v)te)S)A).)))((((((z(f(S(?(-((''y'X'6'''''r'H'''''q'F''''''\':((.(E(](v((((((}(} ))-)>)M)\)j)x)))))))&);)P)f)})))))* *#*;*R*3**b*****)*)+)++)L+)k+)+)+)+)+)+m)+Y)+D)+.),),),(+(+(+(+(+t(+](+F(+/(i+(F+( +'*'*'*'w*'M*'#*')')')')'W)'0)' )'('('('{('Z('<('('(''''''('(')('=('R('g('~(~'('('('('(')')'#)'4)'C)'R)(`)(n))({)>()S()i()()()()()()())))))B))\))u)))))))*)*)*****3**----80@ + + * *c *? * * * * * *| *] *> * + '+ I+ <+ )+ + + + * * * * * * * * * * * * * * * )4 )D * * *K + + 8+ V+2 z+ +3+C3y+2U+27+o2+/2+1*1*71*G1)g2*2*2(*2A*3[*D3t*r3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3+3+3"+3.+3:+3E+3N+3,+M3+3*2*2*2*2*^2*:2*2*1*1*1*1*2*82*v2*2+2++23K+R3[+s3m+3+3+3+----L8AIAAIIAA69+*6+3+0+ ++&+!+++++***************|*s*k*c*\*T*N*@* 6*/*.+*>(*M)*\+*j0*x6*>*H*S*_*l*z********** ++ +(+w/+d4+N8+69+%.9+.8+.7+.5+-3+-0+-,+-(+-#+-+-+-+- +-+-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-w*-o*-f*-^*-R*-H*-?*-9*-3*-0* .-*.-*".-*../*:.1*F.5*Q.:*\.@*g.G*p.O*y.W*.`*.j*.u*.*.*.*.*.*.*.*.*.*.*.*. +x.+n.+d."+Y.)+M..+@.3+3.6+%.9+ZH*MH*AF*5D*)A*=*8* 3*,*&*****))))))))))))))v)n)f)_)X)M)%F)4@)D=)S;)b<)p>)~B)H)O)W)`)k)v))))))))))) ** ***4*<*qC*ZH*%H*$C*$<*$4*$+*$ *$*$ *$)$)$)$)$)$)$)$)$)$)$v)$j)$`)$W)$N)$G)$B)$>)$;) %;)%<)+%@);%E)K%M)[%X)d%_)l%f)s%n)y%w)%)%)%)%)%)%)%)%)%)%)%)%)%)%)z%*t%*n%*g%*_%&*W%-*N%3*E%8*;%=*0%A*%%D*%F* %H*%H*G(G(F(D(A(=(9(4(/()("((( (('}'z'x'v'u'u'u'v'x'{'~'''v'm'd'\'S'L'F'A'>'='='='@' C'+G'6M'AS'KZ'Ub']k'et'm~'s'x'|''''''{'v'o(g(](P'(F1(;8(0?($C(G( H(I(G(k.G(a.H(W.I(N.H(D.G(;.D(3.A(*.>(".9(.4(./( .)(."(-(-(- (-(-'-'-'-'-'-'-'-'-'-'-'-'-'-~'-u'-l'.a'.W'.O'(.H'5.C'A.?'N.='Z.<'g.<'s.='.@'.D'.H'.N'.U'.\'.d'.n'.w'.'.'.'.'.'.'.'.'.'.'.(.(.(.&(./(.6(.<(.A(.D(x.G(k.G(@W'3V''U'S'P'L'G'B'<'5'.''''' ''&&&&&&&&&&&&&~&v&n&f&\& T&N&(J&7I&EI&SK&aO&nU&z[&d&m&x&&&&&&&&&&& ''#'.'9'|B'jJ'VQ'@W'%W'%Q'$K'$B'$9'$/'$#'$'$ '$&$&$&$&$&$&$&$&$&$&$w&$l&$c&$[&$T&$N& %J&%H&)%H&8%I&G%M&W%S&f%[&v%f&%n&%v&%~&%&%&%&%&%&%&%&%&%&%&%&%&%&%'%'%'%'%''%/'|%6't%<'k%B'b%G'W%L'L%P'A%S'5%U'(%V'%W'----O8P.v/^+:..-;.Z./. ..P.v//[.G- ..7./<'j.0$u-R', 'U-(-'-<'j.jP.I-P,?-o-%-jP. %.e- ,-o!_-- %.--libgdiplus-6.0.4+dfsg/tests/testpngcodec.c0000644000175000017500000017444413542672033021331 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static const char *file = "temp_asset.png"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'p', 'n', 'g', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccess(buffer, format, width, height, flags, propertyCount) \ { \ createFile (buffer, Ok); \ /* FIXME: grayscale image flags are incorrect. */ \ verifyBitmap (image, pngRawFormat, format, width, height, flags, propertyCount, FALSE); \ GdipDisposeImage (image); \ } static void test_valid1bpp() { BYTE grayscale1bpp1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x68, 0x00, 0x00, 0x00, 0x82, 0x00, 0x81, 0xA7, 0x01, 0xBA, 0x10, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale1bpp1x1NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x37, 0x6E, 0xF9, 0x24, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x98, 0x63, 0x6C, 0xD7, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale1bpp1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x68, 0x00, 0x00, 0x00, 0x82, 0x00, 0x81, 0xA7, 0x01, 0xBA, 0x10, /* PLTE */ 0x00, 0x00, 0x00, 0x06, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA5, 0xD9, 0x9F, 0xDD, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE indexed1bpp1x1PaletteFirst[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xDB, 0x56, 0xCA, /* PLTE */ 0x00, 0x00, 0x00, 0x06, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA5, 0xD9, 0x9F, 0xDD, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x68, 0x00, 0x00, 0x00, 0x82, 0x00, 0x81, 0xA7, 0x01, 0xBA, 0x10, /* IEND*/ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE indexed1bpp1x1PaletteLast[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xDB, 0x56, 0xCA, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x68, 0x00, 0x00, 0x00, 0x82, 0x00, 0x81, 0xA7, 0x01, 0xBA, 0x10, /* PLTE */ 0x00, 0x00, 0x00, 0x06, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA5, 0xD9, 0x9F, 0xDD, /* IEND*/ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif createFileSuccess (grayscale1bpp1x1Interlaced, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (grayscale1bpp1x1NotInterlaced, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (grayscale1bpp1x1WithPalette, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (indexed1bpp1x1PaletteFirst, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); // FIXME: GDI+ allows indexed images with palettes last. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (indexed1bpp1x1PaletteLast, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif } static void test_valid2bpp () { #if defined(USE_WINDOWS_GDIPLUS) BYTE grayscale2bpp1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x07, 0xC9, 0xB3, 0x62, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x70, 0x00, 0x00, 0x00, 0x42, 0x00, 0x41, 0xF9, 0xFB, 0x3C, 0x49, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale2bpp6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xDF, 0x09, 0x3E, /* IDAT */ 0x00, 0x00, 0x00, 0x14, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x08, 0x0D, 0x60, 0xC8, 0x9A, 0xC0, 0x50, 0x70, 0x81, 0x81, 0x81, 0x01, 0x00, 0x13, 0x83, 0x02, 0xE0, 0x20, 0x93, 0x79, 0xCF, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale2bpp1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x07, 0xC9, 0xB3, 0x62, /* PLTE */ 0x00, 0x00, 0x00, 0x09, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xE6, 0xE6, 0xFA, 0x0D, 0xB2, 0xEB, 0x46, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x70, 0x00, 0x00, 0x00, 0x42, 0x00, 0x41, 0xF9, 0xFB, 0x3C, 0x49, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif BYTE indexed2bpp1x1PaletteFirst[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x01, 0x15, 0x7C, 0x1C, 0x8C, /* PLTE */ 0x00, 0x00, 0x00, 0x09, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xE6, 0xE6, 0xFA, 0x0D, 0xB2, 0xEB, 0x46, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x70, 0x00, 0x00, 0x00, 0x42, 0x00, 0x41, 0xF9, 0xFB, 0x3C, 0x49, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE indexed2bpp6x4PaletteLast[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x02, 0x03, 0x00, 0x00, 0x01, 0xA7, 0x6D, 0x96, 0x46, /* IDAT */ 0x00, 0x00, 0x00, 0x16, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x70, 0x00, 0x43, 0x1F, 0x86, 0x10, 0x86, 0x23, 0x0C, 0x59, 0x13, 0x18, 0x18, 0x18, 0x00, 0x1B, 0x38, 0x03, 0x1F, 0xE2, 0xF7, 0x9D, 0x3B, /* PLTE */ 0x00, 0x00, 0x00, 0x09, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xE6, 0xE6, 0xFA, 0x0D, 0xB2, 0xEB, 0x46, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif // FIXME: this causes an AV in libgdiplus when trying to convert this image to 32bpp as we assume // the image has a palette. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (grayscale2bpp1x1Interlaced, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscale2bpp6x4NotInterlaced, PixelFormat32bppARGB, 6, 4, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscale2bpp1x1WithPalette, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); #endif createFileSuccess (indexed2bpp1x1PaletteFirst, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); // FIXME: GDI+ allows indexed images with palettes last. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (indexed2bpp6x4PaletteLast, PixelFormat32bppARGB, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); #endif } static void test_valid4bpp() { BYTE grayscaleWithAlpha1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x01, 0x88, 0x89, 0x46, 0xC2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x11, 0x75, 0x9A, 0x0F, 0xE8, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscaleWithAlpha6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x9F, 0xFC, 0x9E, /* IDAT */ 0x00, 0x00, 0x00, 0x18, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x10, 0x14, 0x14, 0x64, 0x10, 0x71, 0x71, 0x64, 0x90, 0x2F, 0xFF, 0xC8, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x10, 0xFF, 0x02, 0x54, 0xB8, 0xE8, 0x8D, 0xCD, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscaleWithAlpha1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x01, 0x88, 0x89, 0x46, 0xC2, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x11, 0x75, 0x9A, 0x0F, 0xE8, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE indexed4bpp1x1PaletteFirst[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x03, 0x00, 0x00, 0x01, 0x9A, 0x3C, 0xE9, 0x2C, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x11, 0x75, 0x9A, 0x0F, 0xE8, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE indexed4bpp6x4PaletteLast[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* IDAT */ 0x00, 0x00, 0x00, 0x1B, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x10, 0x00, 0x43, 0xF1, 0x0F, 0x0C, 0x82, 0x02, 0x0C, 0xDF, 0x05, 0x18, 0x44, 0x5C, 0x1C, 0x19, 0x18, 0x18, 0x18, 0x00, 0x22, 0x93, 0x02, 0xF9, 0x27, 0x14, 0x52, 0x58, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif // FIXME: GDI+ converts grayscale alpha 4bpp images to 32bpp. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat expectedGrayscalePixelFormat = PixelFormat32bppARGB; #else PixelFormat expectedGrayscalePixelFormat = PixelFormat4bppIndexed; #endif createFileSuccess (grayscaleWithAlpha1x1Interlaced, expectedGrayscalePixelFormat, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscaleWithAlpha6x4NotInterlaced, expectedGrayscalePixelFormat, 6, 4, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscaleWithAlpha1x1WithPalette, expectedGrayscalePixelFormat, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (indexed4bpp1x1PaletteFirst, PixelFormat4bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); // FIXME: GDI+ allows indexed images with palettes last. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (indexed4bpp6x4PaletteLast, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif } static void test_valid8bpp () { BYTE grayscale1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x01, 0x4D, 0x79, 0xAB, 0xC3, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0x60, 0x04, 0x00, 0x00, 0x03, 0x00, 0x02, 0xA0, 0x80, 0x44, 0x0F, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R',0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88, 0x6F, 0x11, 0x9F, /* IDAT */ 0x00, 0x00, 0x00, 0x1D, 'I', 'D', 'A', 'T',0x18, 0x57, 0x63, 0x64, 0x64, 0x00, 0x01, 0x46, 0x46, 0x26, 0x20, 0xF9, 0x8F, 0x89, 0xE1, 0x0F, 0x0B, 0xCB, 0x1F, 0xB0, 0x08, 0x03, 0x03, 0x03, 0x00, 0x24, 0xA0, 0x03, 0x07, 0xA7, 0x85, 0xE0, 0xA2, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D',0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x01, 0x4D, 0x79, 0xAB, 0xC3, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0x60, 0x04, 0x00, 0x00, 0x03, 0x00, 0x02, 0xA0, 0x80, 0x44, 0x0F, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE indexed1x1PaletteFirst[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x03, 0x00, 0x00, 0x01, 0x5F, 0xCC, 0x04, 0x2D, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x11, 0x75, 0x9A, 0x0F, 0xE8, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE indexed6x4PaletteLast[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x08, 0x03, 0x00, 0x00, 0x01, 0xED, 0xDD, 0x8E, 0xE7, /* IDAT */ 0x00, 0x00, 0x00, 0x1E, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0x60, 0x84, 0x40, 0xF6, 0xFF, 0x0C, 0x8C, 0x8C, 0x8C, 0x0C, 0xFF, 0xD9, 0x81, 0x6C, 0x66, 0x20, 0x60, 0x64, 0x00, 0x01, 0x06, 0x06, 0x00, 0x2A, 0x5E, 0x02, 0x23, 0xF7, 0x26, 0x7C, 0xAC, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif BYTE trueColor1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x01, 0xE7, 0x70, 0x63, 0x48, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x63, 0x24, 0x55, 0xD3, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColor6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x08, 0x02, 0x00, 0x00, 0x00, 0x22, 0x66, 0xD9, 0x14, /* IDAT */ 0x00, 0x00, 0x00, 0x2A, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xFC, 0xCF, 0x80, 0x0E, 0x40, 0x42, 0xCF, 0x9F, 0xFD, 0x82, 0xF2, 0x18, 0x18, 0x24, 0xA5, 0xD8, 0x18, 0x20, 0xAA, 0xDE, 0x35, 0xBD, 0x03, 0x22, 0x20, 0x03, 0xC8, 0x65, 0x04, 0x93, 0x48, 0x80, 0x81, 0x01, 0x00, 0xEE, 0x67, 0x0C, 0xBB, 0x0E, 0x63, 0x55, 0x28, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColor1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x01, 0xE7, 0x70, 0x63, 0x48, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x63, 0x24, 0x55, 0xD3, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlpha1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0x01, 0x68, 0x12, 0xF4, 0x1F, /* IDAT */ 0x00, 0x00, 0x00, 0x0D, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0xB0, 0x1F, 0x00, 0x04, 0xC0, 0x01, 0xBF, 0xBD, 0x98, 0x5E, 0x91, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlpha6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x08, 0x06, 0x00, 0x00, 0x00, 0xAD, 0x04, 0x4E, 0x43, /* IDAT */ 0x00, 0x00, 0x00, 0x3E, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xFC, 0xCF, 0xC0, 0xB0, 0x9F, 0x81, 0x81, 0xE1, 0x00, 0x10, 0x5F, 0x03, 0x62, 0x10, 0xD0, 0x02, 0x62, 0x07, 0x06, 0xA0, 0x44, 0xFD, 0xB3, 0x67, 0xBF, 0xFE, 0x23, 0x63, 0x90, 0x18, 0x13, 0x48, 0x89, 0x94, 0x14, 0x1B, 0x23, 0xC7, 0x9C, 0x2F, 0x61, 0x20, 0x0C, 0x62, 0x83, 0xC4, 0x80, 0x04, 0x48, 0x01, 0x3A, 0x60, 0x60, 0x00, 0x00, 0x90, 0x2B, 0x1C, 0x23, 0xE8, 0xDB, 0x69, 0x10, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlpha1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0x01, 0x68, 0x12, 0xF4, 0x1F, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0D, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0xB0, 0x1F, 0x00, 0x04, 0xC0, 0x01, 0xBF, 0xBD, 0x98, 0x5E, 0x91, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; // FIXME: GDI+ converts grayscale 8bpp images to 32bpp. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat expectedGrayscalePixelFormat = PixelFormat32bppARGB; #else PixelFormat expectedGrayscalePixelFormat = PixelFormat8bppIndexed; #endif createFileSuccess (grayscale1x1Interlaced, expectedGrayscalePixelFormat, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscale6x4NotInterlaced, expectedGrayscalePixelFormat, 6, 4, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscale1x1WithPalette, expectedGrayscalePixelFormat, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (indexed1x1PaletteFirst, PixelFormat8bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); // FIXME: GDI+ allows indexed images with palettes last. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (indexed6x4PaletteLast, PixelFormat8bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif createFileSuccess (trueColor1x1Interlaced, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (trueColor6x4NotInterlaced, PixelFormat24bppRGB, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (trueColor1x1WithPalette, PixelFormat24bppRGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (trueColorWithAlpha1x1Interlaced, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColorWithAlpha6x4NotInterlaced, PixelFormat32bppARGB, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColorWithAlpha1x1WithPalette, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); } static void test_valid16bpp () { BYTE grayscale1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x01, 0x1D, 0xE9, 0x77, 0x80, /* IDAT */ 0x00, 0x00, 0x00, 0x0B, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xA8, 0xFF, 0x0F, 0x00, 0x02, 0x00, 0x01, 0x7F, 0x2F, 0x5A, 0xAA, 0x27, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0xD8, 0xFF, 0xCD, 0xDC, /* IDAT */ 0x00, 0x00, 0x00, 0x21, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xFC, 0xFF, 0x9F, 0x01, 0x0E, 0x80, 0x9C, 0x06, 0x28, 0xB3, 0x81, 0x81, 0x85, 0x81, 0xE1, 0x5A, 0x18, 0x94, 0xB7, 0x0A, 0x4A, 0x83, 0x00, 0x03, 0x03, 0x00, 0xF4, 0x31, 0x06, 0xD9, 0x82, 0x8E, 0x6A, 0xA9, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscale1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x01, 0x1D, 0xE9, 0x77, 0x80, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0B, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xA8, 0xFF, 0x0F, 0x00, 0x02, 0x00, 0x01, 0x7F, 0x2F, 0x5A, 0xAA, 0x27, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColor1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x00, 0x00, 0x01, 0xB7, 0xE0, 0xBF, 0x0B, /* IDAT */ 0x00, 0x00, 0x00, 0x0F, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xFF, 0x9F, 0x81, 0x81, 0x81, 0x01, 0x00, 0x0A, 0xFC, 0x01, 0xFF, 0xC0, 0x18, 0x7E, 0x3E, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColor6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x10, 0x02, 0x00, 0x00, 0x00, 0x72, 0xF6, 0x05, 0x57, /* IDAT */ 0x00, 0x00, 0x00, 0x36, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xFC, 0xFF, 0x9F, 0x81, 0x20, 0x80, 0x2A, 0x7A, 0xFE, 0xFC, 0xD9, 0xB3, 0x5F, 0xBF, 0xC0, 0x22, 0x28, 0x40, 0x52, 0x52, 0x4A, 0x8A, 0x8D, 0x8D, 0x01, 0xD9, 0xA4, 0x77, 0xEF, 0x9A, 0x9A, 0xDE, 0x01, 0x01, 0x88, 0x84, 0x88, 0x40, 0x64, 0x19, 0x11, 0x4C, 0x5C, 0x80, 0x81, 0x01, 0x00, 0x87, 0xD4, 0x19, 0x72, 0xFD, 0x0D, 0x0C, 0x10, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColor1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x00, 0x00, 0x01, 0xB7, 0xE0, 0xBF, 0x0B, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x0F, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xFF, 0x9F, 0x81, 0x81, 0x81, 0x01, 0x00, 0x0A, 0xFC, 0x01, 0xFF, 0xC0, 0x18, 0x7E, 0x3E, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlpha1x1Interlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x06, 0x00, 0x00, 0x01, 0x38, 0x82, 0x28, 0x5C, /* IDAT */ 0x00, 0x00, 0x00, 0x10, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xFF, 0x9F, 0x01, 0x08, 0xEA, 0xFF, 0x03, 0x00, 0x10, 0xF7, 0x03, 0x7D, 0xF1, 0xE9, 0x90, 0xF9, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlpha6x4NotInterlaced[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x10, 0x06, 0x00, 0x00, 0x00, 0xFD, 0x94, 0x92, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x5C, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xFC, 0xFF, 0x9F, 0x01, 0x08, 0xF6, 0x83, 0x49, 0x06, 0x86, 0x03, 0x10, 0x8A, 0xE1, 0x5A, 0x18, 0x94, 0x01, 0x05, 0x5A, 0xAB, 0x20, 0xB4, 0x03, 0x03, 0x54, 0x43, 0xFD, 0xFF, 0xE7, 0xCF, 0x9F, 0x3D, 0xFB, 0xF5, 0xAB, 0x01, 0x2C, 0x8C, 0x0D, 0x48, 0x4A, 0x4A, 0x49, 0xB1, 0xB1, 0x35, 0x30, 0x30, 0x41, 0xF9, 0x0C, 0x52, 0x40, 0xC0, 0xC6, 0xC6, 0xC8, 0xC8, 0xC1, 0x31, 0x67, 0xCE, 0x97, 0x2F, 0x61, 0x61, 0x30, 0x1A, 0x26, 0x0E, 0x55, 0xC6, 0x00, 0x66, 0xFC, 0x07, 0x02, 0x30, 0x8F, 0x20, 0x60, 0x60, 0x00, 0x00, 0x6D, 0xBB, 0x1D, 0xDE, 0xBD, 0x08, 0x32, 0x2C, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlpha1x1WithPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x06, 0x00, 0x00, 0x01, 0x38, 0x82, 0x28, 0x5C, /* PLTE */ 0x00, 0x00, 0x00, 0x18, 'P', 'L', 'T', 'E', 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0xE6, 0xE6, 0xFA, 0xF5, 0xF5, 0xDC, 0xFF, 0xFF, 0xFF, 0x9A, 0xCD, 0x32, 0xEE, 0x82, 0xEE, 0xBD, 0xEB, 0xF4, 0x2B, /* IDAT */ 0x00, 0x00, 0x00, 0x10, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xFF, 0x9F, 0x01, 0x08, 0xEA, 0xFF, 0x03, 0x00, 0x10, 0xF7, 0x03, 0x7D, 0xF1, 0xE9, 0x90, 0xF9, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; // FIXME: GDI+ converts grayscale 16bpp images to 32bpp. #if defined(USE_WINDOWS_GDIPLUS) PixelFormat expectedGrayscalePixelFormat = PixelFormat32bppARGB; PixelFormat expectedTrueColorPixelFormat = PixelFormat32bppARGB; #else PixelFormat expectedGrayscalePixelFormat = PixelFormat8bppIndexed ; PixelFormat expectedTrueColorPixelFormat = PixelFormat24bppRGB ; #endif createFileSuccess (grayscale1x1Interlaced, expectedGrayscalePixelFormat, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscale6x4NotInterlaced, expectedGrayscalePixelFormat, 6, 4, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (grayscale1x1WithPalette, expectedGrayscalePixelFormat, 1, 1, ImageFlagsColorSpaceGRAY | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColor1x1Interlaced, expectedTrueColorPixelFormat, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColor6x4NotInterlaced, expectedTrueColorPixelFormat, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColor1x1WithPalette, expectedTrueColorPixelFormat, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColorWithAlpha1x1Interlaced, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColorWithAlpha6x4NotInterlaced, PixelFormat32bppARGB, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); createFileSuccess (trueColorWithAlpha1x1WithPalette, PixelFormat32bppARGB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 3); } static void test_valid () { #if defined(USE_WINDOWS_GDIPLUS) BYTE longIhdrLength[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0E, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; #endif #if defined(USE_WINDOWS_GDIPLUS) BYTE multipleIhdrs[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif #if defined(USE_WINDOWS_GDIPLUS) BYTE multipleIdats[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x98, 0x63, 0x6C, 0xD7, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif #if defined(USE_WINDOWS_GDIPLUS) BYTE oneEmptyIdat[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x00, 'I', 'D', 'A', 'T', 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; #endif #if defined(USE_WINDOWS_GDIPLUS) BYTE multiplePalettes[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif BYTE noIend[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x98, 0x63, 0x6C, 0xD7, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE invalidCrc[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; #endif #if defined(USE_WINDOWS_GDIPLUS) BYTE invalidCompression[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; #endif BYTE metersPhysicalDimensionsChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* pHYs */ 0x00, 0x00, 0x00, 0x09, 'p', 'H', 'Y', 's', 0x00, 0x00, 0x0E, 0xC3, 0x00, 0x00, 0x0E, 0xC3, 0x01, 0xC7, 0x6F, 0xA8, 0x64, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE zeroDpiXPhysicalDimensionsChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* pHYs */ 0x00, 0x00, 0x00, 0x09, 'p', 'H', 'Y', 's', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xC3, 0x01, 0xC7, 0x6F, 0xA8, 0x64, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE zeroDpiYPhysicalDimensionsChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* pHYs */ 0x00, 0x00, 0x00, 0x09, 'p', 'H', 'Y', 's', 0x00, 0x00, 0x0E, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x01, 0xC7, 0x6F, 0xA8, 0x64, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE unknownPhysicalDimensionsChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* pHYs */ 0x00, 0x00, 0x00, 0x09, 'p', 'H', 'Y', 's', 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0xC7, 0x6F, 0xA8, 0x64, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE invalidPhysicalDimensionsChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* pHYs */ 0x00, 0x00, 0x00, 0x09, 'p', 'H', 'Y', 's', 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x02, 0xC7, 0x6F, 0xA8, 0x64, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE gamaChunkBeforeColors[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* gAMA */ 0x00, 0x00, 0x00, 0x04, 'g', 'A', 'M', 'A', 0x00, 0x00, 0xB1, 0x8F, 0x0B, 0xFC, 0x61, 0x05, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE gamaChunkAfterColors[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* gAMA */ 0x00, 0x00, 0x00, 0x04, 'g', 'A', 'M', 'A', 0x00, 0x00, 0xB1, 0x8F, 0x0B, 0xFC, 0x61, 0x05, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE srgbChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* sRGB */ 0x00, 0x00, 0x00, 0x01, 's', 'R', 'G', 'B', 0x00, 0xAE, 0xCE, 0x1C, 0xE9, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE unknownChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* UNKNOWN */ 0x00, 0x00, 0x00, 0x02, 'U', 'N', 'K', 'N', 0xFE, 0xEF, 0xAE, 0xCE, 0x1C, 0xE9, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #endif BYTE invalidSrgbChunk[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x28, 0x2D, 0x63, 0xE6, /* sRGB */ 0x00, 0x00, 0x00, 0x01, 's', 'R', 'G', 'B', 0xFF, 0xAE, 0xCE, 0x1C, 0xE9, /* PLTE */ 0x00, 0x00, 0x00, 0x0C, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xC1, 0x7F, 0x62, 0xD1, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0xC0, 0x06, 0x18, 0x18, 0x00, 0x00, 0x17, 0x00, 0x01, 0x47, 0xB7, 0x91, 0x37, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE iendWithLength[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x98, 0x63, 0x6C, 0xD7, /* IEND */ 0x00, 0x00, 0x00, 0x01, 'I', 'E', 'N', 'D', 0x00, 0xAE, 0x42, 0x60, 0x82, /* sRGB */ 0x00, 0x00, 0x00, 0x01, 's', 'R', 'G', 'B', 0xFF, 0xAE, 0xCE, 0x1C, 0xE9 }; #endif BYTE iendWithTrailingData[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x98, 0x63, 0x6C, 0xD7, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82, /* sRGB */ 0x00, 0x00, 0x00, 0x01, 's', 'R', 'G', 'B', 0xFF, 0xAE, 0xCE, 0x1C, 0xE9 }; // FIXME: GDI+ allows long IHDR lengths. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (longIhdrLength, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif // FIXME: GDI+ allows multiple IHDRs. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (multipleIhdrs, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif //FIXME: GDI+ allows multiple IDATs. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (multipleIdats, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif // FIXME: GDI+ allows empty IDATs. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (oneEmptyIdat, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif // FIXME: GDI+ allows multiple palettes #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (multiplePalettes, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif createFileSuccess (noIend, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); // FIXME: GDI+ does not validate the CRC. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (invalidCrc, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif // FIXME: GDI+ does not validate the compression. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (invalidCompression, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif createFileSuccess (metersPhysicalDimensionsChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasRealDPI | ImageFlagsReadOnly, 3); createFileSuccess (zeroDpiXPhysicalDimensionsChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (zeroDpiYPhysicalDimensionsChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (unknownPhysicalDimensionsChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (invalidPhysicalDimensionsChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); createFileSuccess (gamaChunkBeforeColors, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 4); createFileSuccess (gamaChunkAfterColors, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 4); createFileSuccess (srgbChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 5); // FIXME: GDI+ does not validate the CRC. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (unknownChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif createFileSuccess (invalidSrgbChunk, PixelFormat4bppIndexed, 6, 4, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 5); // FIXME: GDI+ does not validate the CRC. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (iendWithLength, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); #endif createFileSuccess (iendWithTrailingData, PixelFormat1bppIndexed, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 3); } static void test_invalidHeader () { BYTE noP[] = {0x89}; BYTE noN[] = {0x89, 0x50}; BYTE noG[] = {0x89, 0x50, 0x4E}; BYTE noCLRF[] = {0x89, 0x50, 0x4E, 0x47}; BYTE shortCLRF[] = {0x89, 0x50, 0x4E, 0x47, 0x0D}; BYTE noEOF[] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A}; createFile (noP, OutOfMemory); createFile (noN, OutOfMemory); createFile (noG, OutOfMemory); createFile (noCLRF, OutOfMemory); createFile (shortCLRF, OutOfMemory); createFile (noEOF, OutOfMemory); } static void test_invalidHeaderChunk() { BYTE noDataLength[] = { /*Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }; BYTE shortDataLength[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00 }; BYTE noDataType[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D }; BYTE shortDataType[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D' }; BYTE noWidth[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R' }; BYTE shortWidth[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00 }; BYTE noHeight[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01 }; BYTE shortHeight[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; BYTE noBitDepth[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01 }; BYTE noColorType[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01 }; BYTE noCompression[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00 }; BYTE noFilter[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 }; BYTE noInterlace[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00 }; BYTE noCrc[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 }; BYTE noIDAT[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x37, 0x6E, 0xF9, 0x24 }; createFile (noDataLength, OutOfMemory); createFile (shortDataLength, OutOfMemory); createFile (noDataType, OutOfMemory); createFile (shortDataType, OutOfMemory); createFile (noWidth, OutOfMemory); createFile (shortWidth, OutOfMemory); createFile (noHeight, OutOfMemory); createFile (shortHeight, OutOfMemory); createFile (noBitDepth, OutOfMemory); createFile (noColorType, OutOfMemory); createFile (noCompression, OutOfMemory); createFile (noFilter, OutOfMemory); createFile (noInterlace, OutOfMemory); createFile (noCrc, OutOfMemory); createFile (noIDAT, OutOfMemory); } static void test_invalidImageData() { BYTE lowerCaseHeaders[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'i', 'h', 'd', 'r', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'i', 'd', 'a', 't', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'i', 'e', 'n', 'd', 0x00, 0x00, 0x00, 0x00 }; BYTE shortIhdrLength[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0C, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; BYTE prematureIend[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x69, 0xC9, 0xB2, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x98, 0x63, 0x6C, 0xD7 }; BYTE idatFirst[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IHDR */ 0x00, 0x00, 0x00, 0x0C, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; BYTE zeroWidth[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; BYTE zeroHeight[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; BYTE invalidInterlace[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; BYTE invalidBitDepths[] = {0x00, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0F, 0x11}; for (int i = 0; i < sizeof (invalidBitDepths); i++) { BYTE invalidBitDepth[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, invalidBitDepths[i], 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; createFile (invalidBitDepth, OutOfMemory); } BYTE invalidColorTypes[] = {0x01, 0x05, 0x07}; for (int i = 0; i < sizeof (invalidColorTypes); i++) { BYTE invalidColorType[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, invalidColorTypes[i], 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; createFile (invalidColorType, OutOfMemory); } BYTE noIdat[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xDB, 0x56, 0xCA, /* PLTE */ 0x00, 0x00, 0x00, 0x06, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA5, 0xD9, 0x9F, 0xDD, /* IEND*/ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE onlyEmptyIdat[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IDAT */ 0x00, 0x00, 0x00, 0x00, 'I', 'D', 'A', 'T', 0x00, 0x00, 0x00, 0x00, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0x00, 0x00, 0x00, 0x00 }; createFile (lowerCaseHeaders, OutOfMemory); createFile (shortIhdrLength, OutOfMemory); createFile (prematureIend, OutOfMemory); createFile (idatFirst, OutOfMemory); createFile (zeroWidth, OutOfMemory); createFile (zeroHeight, OutOfMemory); createFile (invalidInterlace, OutOfMemory); createFile (noIdat, OutOfMemory); createFile (onlyEmptyIdat, OutOfMemory); } static void test_invalidImageFormat() { BYTE indexedNoPalette[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xDB, 0x56, 0xCA, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x68, 0x00, 0x00, 0x00, 0x82, 0x00, 0x81, 0xA7, 0x01, 0xBA, 0x10, /* IEND*/ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE indexed16bpp[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x03, 0x00, 0x00, 0x00, 0x25, 0xDB, 0x56, 0xCA, /* PLTE */ 0x00, 0x00, 0x00, 0x06, 'P', 'L', 'T', 'E', 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA5, 0xD9, 0x9F, 0xDD, /* IDAT */ 0x00, 0x00, 0x00, 0x0A, 'I', 'D', 'A', 'T', 0x18, 0xD3, 0x63, 0x68, 0x00, 0x00, 0x00, 0x82, 0x00, 0x81, 0xA7, 0x01, 0xBA, 0x10, /* IEND*/ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE invalidBitsPerPixel[] = {0x01, 0x02, 0x04}; for (int i = 0; i < sizeof (invalidBitsPerPixel); i++) { BYTE trueColorInvalidBpp[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, invalidBitsPerPixel[i], 0x02, 0x00, 0x00, 0x01, 0xE7, 0x70, 0x63, 0x48, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x63, 0x24, 0x55, 0xD3, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE grayscaleWithAlphaInvalidBpp[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, invalidBitsPerPixel[i], 0x04, 0x00, 0x00, 0x01, 0xE7, 0x70, 0x63, 0x48, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x63, 0x24, 0x55, 0xD3, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; BYTE trueColorWithAlphaInvalidBpp[] = { /* Signature */ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, /* IHDR */ 0x00, 0x00, 0x00, 0x0D, 'I', 'H', 'D', 'R', 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, invalidBitsPerPixel[i], 0x06, 0x00, 0x00, 0x01, 0xE7, 0x70, 0x63, 0x48, /* IDAT */ 0x00, 0x00, 0x00, 0x0C, 'I', 'D', 'A', 'T', 0x18, 0x57, 0x63, 0xF8, 0xCF, 0xC0, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x63, 0x24, 0x55, 0xD3, /* IEND */ 0x00, 0x00, 0x00, 0x00, 'I', 'E', 'N', 'D', 0xAE, 0x42, 0x60, 0x82 }; createFile (trueColorInvalidBpp, OutOfMemory); createFile (grayscaleWithAlphaInvalidBpp, OutOfMemory); createFile (trueColorWithAlphaInvalidBpp, OutOfMemory); } createFile (indexedNoPalette, OutOfMemory); createFile (indexed16bpp, OutOfMemory); } int main (int argc, char**argv) { STARTUP; test_valid1bpp (); test_valid2bpp (); test_valid4bpp (); test_valid8bpp (); test_valid16bpp (); test_valid (); test_invalidHeader (); test_invalidHeaderChunk (); test_invalidImageData (); test_invalidImageFormat (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testcustomlinecap.c0000644000175000017500000005065313545154623022413 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include #include #include "testhelpers.h" static void verifyCustomLineCap (GpCustomLineCap *cap, LineCap expectedBaseCap, REAL expectedBaseInset) { assert (cap && "Expected cap to be initialized."); GpStatus status; LineCap baseCap; REAL baseInset; LineCap startCap; LineCap endCap; LineJoin strokeJoin; REAL widthScale; CustomLineCapType type; status = GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (status, Ok); assertEqualInt (baseCap, expectedBaseCap); status = GdipGetCustomLineCapBaseInset (cap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, expectedBaseInset); status = GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (status, Ok); assertEqualInt (startCap, LineCapFlat); assertEqualInt (endCap, LineCapFlat); status = GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (status, Ok); assertEqualInt (strokeJoin, LineJoinMiter); status = GdipGetCustomLineCapType (cap, &type); assertEqualInt (status, Ok); assertEqualInt (type, CustomLineCapTypeDefault); status = GdipGetCustomLineCapWidthScale (cap, &widthScale); assertEqualInt (status, Ok); assertEqualFloat (widthScale, 1); } static void test_createCustomLineCap () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); status = GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); assertEqualInt (status, Ok); verifyCustomLineCap (cap, LineCapFlat, 10); GdipDeleteCustomLineCap (cap); status = GdipCreateCustomLineCap (NULL, strokePath, LineCapCustom, 0, &cap); assertEqualInt (status, Ok); verifyCustomLineCap (cap, LineCapFlat, 0); GdipDeleteCustomLineCap (cap); status = GdipCreateCustomLineCap (fillPath, NULL, (LineCap)(LineCapFlat - 1), -1, &cap); assertEqualInt (status, Ok); verifyCustomLineCap (cap, LineCapFlat, -1); GdipDeleteCustomLineCap (cap); status = GdipCreateCustomLineCap (fillPath, strokePath, (LineCap)(LineCapCustom + 1), 100, &cap); assertEqualInt (status, Ok); verifyCustomLineCap (cap, LineCapFlat, 100); GdipDeleteCustomLineCap (cap); // Negative tests. cap = (GpCustomLineCap *) 0xCC; status = GdipCreateCustomLineCap (NULL, NULL, LineCapRoundAnchor, 10, &cap); assertEqualInt (status, InvalidParameter); assert (cap == (GpCustomLineCap *) 0xCC); status = GdipCreateCustomLineCap (fillPath, fillPath, LineCapRoundAnchor, 10, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); } static void test_deleteCustomLineCap () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); status = GdipDeleteCustomLineCap (cap); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteCustomLineCap (NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); } static void test_cloneCustomLineCap () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; GpCustomLineCap *clonedCap; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); status = GdipCloneCustomLineCap (cap, &clonedCap); assertEqualInt (status, Ok); verifyCustomLineCap (clonedCap, LineCapFlat, 10); GdipDeleteCustomLineCap (clonedCap); // Negative tests. status = GdipCloneCustomLineCap (NULL, &clonedCap); assertEqualInt (status, InvalidParameter); // This causes a null pointer dereference in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipCloneCustomLineCap (cap, NULL); assertEqualInt (status, InvalidParameter); #endif GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_getCustomLineCapType () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; CustomLineCapType type; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Negative tests. status = GdipGetCustomLineCapType (NULL, &type); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapType (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_setCustomLineCapStrokeCaps () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; LineCap startCap; LineCap endCap; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // LineCapFlat/LineCapSquare. status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapSquare); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (startCap, LineCapFlat); assertEqualInt (endCap, LineCapSquare); // LineCapSquare/LineCapFlat. status = GdipSetCustomLineCapStrokeCaps (cap, LineCapSquare, LineCapFlat); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (startCap, LineCapSquare); assertEqualInt (endCap, LineCapFlat); // LineCapRound/LineCapTriangle. status = GdipSetCustomLineCapStrokeCaps (cap, LineCapRound, LineCapTriangle); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (startCap, LineCapRound); assertEqualInt (endCap, LineCapTriangle); // LineCapTriangle/LineCapRound. status = GdipSetCustomLineCapStrokeCaps (cap, LineCapTriangle, LineCapRound); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (startCap, LineCapTriangle); assertEqualInt (endCap, LineCapRound); // Same value. status = GdipSetCustomLineCapStrokeCaps (cap, LineCapTriangle, LineCapRound); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (startCap, LineCapTriangle); assertEqualInt (endCap, LineCapRound); // Negative tests. status = GdipSetCustomLineCapStrokeCaps (NULL, LineCapArrowAnchor, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, (LineCap)(LineCapTriangle + 1), LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapNoAnchor, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapSquareAnchor, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapRoundAnchor, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapDiamondAnchor, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapArrowAnchor, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapCustom, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapAnchorMask, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, (LineCap)(LineCapCustom + 1), LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, (LineCap)(LineCapTriangle + 1)); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapNoAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapSquareAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapRoundAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapDiamondAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapArrowAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapCustom); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, LineCapAnchorMask); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapStrokeCaps (cap, LineCapFlat, (LineCap)(LineCapCustom + 1)); assertEqualInt (status, InvalidParameter); // Make sure nothing changed. GdipGetCustomLineCapStrokeCaps (cap, &startCap, &endCap); assertEqualInt (startCap, LineCapTriangle); assertEqualInt (endCap, LineCapRound); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_getCustomLineCapStrokeCaps () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; LineCap startCap; LineCap endCap; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Negative tests. status = GdipGetCustomLineCapStrokeCaps (NULL, &startCap, &endCap); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapStrokeCaps (cap, NULL, &endCap); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapStrokeCaps (cap, &startCap, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_setCustomLineCapStrokeJoin () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; LineJoin strokeJoin; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // LineJoinMiter. status = GdipSetCustomLineCapStrokeJoin (cap, LineJoinMiter); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, LineJoinMiter); // LineJoinMiter. status = GdipSetCustomLineCapStrokeJoin (cap, LineJoinBevel); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, LineJoinBevel); // LineJoinRound. status = GdipSetCustomLineCapStrokeJoin (cap, LineJoinRound); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, LineJoinRound); // LineJoinMiterClipped. status = GdipSetCustomLineCapStrokeJoin (cap, LineJoinMiterClipped); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, LineJoinMiterClipped); // Same value. status = GdipSetCustomLineCapStrokeJoin (cap, LineJoinMiterClipped); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, LineJoinMiterClipped); // Invalid value - negative. status = GdipSetCustomLineCapStrokeJoin (cap, (LineJoin)(LineJoinMiter - 1)); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, (LineJoin)(LineJoinMiter - 1)); // Invalid value - positive. status = GdipSetCustomLineCapStrokeJoin (cap, (LineJoin)(LineJoinMiterClipped + 1)); assertEqualInt (status, Ok); GdipGetCustomLineCapStrokeJoin (cap, &strokeJoin); assertEqualInt (strokeJoin, (LineJoin)(LineJoinMiterClipped + 1)); // Negative tests. status = GdipSetCustomLineCapStrokeJoin (NULL, LineJoinMiterClipped); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_getCustomLineCapStrokeJoin () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; LineJoin strokeJoin; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Negative tests. status = GdipGetCustomLineCapStrokeJoin (NULL, &strokeJoin); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapStrokeJoin (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_setCustomLineCapBaseCap () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; LineCap baseCap; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // LineCapFlat. status = GdipSetCustomLineCapBaseCap (cap, LineCapFlat); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (baseCap, LineCapFlat); // LineCapSquare. status = GdipSetCustomLineCapBaseCap (cap, LineCapSquare); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (baseCap, LineCapSquare); // LineCapRound. status = GdipSetCustomLineCapBaseCap (cap, LineCapRound); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (baseCap, LineCapRound); // LineCapTriangle. status = GdipSetCustomLineCapBaseCap (cap, LineCapTriangle); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (baseCap, LineCapTriangle); // Same value. status = GdipSetCustomLineCapBaseCap (cap, LineCapTriangle); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (baseCap, LineCapTriangle); // Negative tests. status = GdipSetCustomLineCapBaseCap (NULL, LineCapFlat); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, (LineCap)(LineCapTriangle + 1)); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapNoAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapSquareAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapRoundAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapDiamondAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapArrowAnchor); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapCustom); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, LineCapAnchorMask); assertEqualInt (status, InvalidParameter); status = GdipSetCustomLineCapBaseCap (cap, (LineCap)(LineCapCustom + 1)); assertEqualInt (status, InvalidParameter); // Make sure nothing changed. GdipGetCustomLineCapBaseCap (cap, &baseCap); assertEqualInt (baseCap, LineCapTriangle); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_getCustomLineCapBaseCap () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; LineCap baseCap; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Negative tests. status = GdipGetCustomLineCapBaseCap (NULL, &baseCap); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapBaseCap (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_setCustomLineCapBaseInset () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; REAL baseInset; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Positive value. status = GdipSetCustomLineCapBaseInset (cap, 2); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseInset (cap, &baseInset); assertEqualFloat (baseInset, 2); // Same value. status = GdipSetCustomLineCapBaseInset (cap, 2); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseInset (cap, &baseInset); assertEqualFloat (baseInset, 2); // Zero value. status = GdipSetCustomLineCapBaseInset (cap, 0); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseInset (cap, &baseInset); assertEqualFloat (baseInset, 0); // Negative value. status = GdipSetCustomLineCapBaseInset (cap, -1); assertEqualInt (status, Ok); GdipGetCustomLineCapBaseInset (cap, &baseInset); assertEqualFloat (baseInset, -1); // Negative tests. status = GdipSetCustomLineCapBaseInset (NULL, 1); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_getCustomLineCapBaseInset () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; REAL baseInset; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Negative tests. status = GdipGetCustomLineCapBaseInset (NULL, &baseInset); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapBaseInset (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_setCustomLineCapWidthScale () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; REAL widthScale; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Positive value. status = GdipSetCustomLineCapWidthScale (cap, 2); assertEqualInt (status, Ok); GdipGetCustomLineCapWidthScale (cap, &widthScale); assertEqualFloat (widthScale, 2); // Same value. status = GdipSetCustomLineCapWidthScale (cap, 2); assertEqualInt (status, Ok); GdipGetCustomLineCapWidthScale (cap, &widthScale); assertEqualFloat (widthScale, 2); // Zero value. status = GdipSetCustomLineCapWidthScale (cap, 0); assertEqualInt (status, Ok); GdipGetCustomLineCapWidthScale (cap, &widthScale); assertEqualFloat (widthScale, 0); // Negative value. status = GdipSetCustomLineCapWidthScale (cap, -1); assertEqualInt (status, Ok); GdipGetCustomLineCapWidthScale (cap, &widthScale); assertEqualFloat (widthScale, -1); // Negative tests. status = GdipSetCustomLineCapWidthScale (NULL, 1); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } static void test_getCustomLineCapWidthScale () { GpStatus status; GpCustomLineCap *cap; GpPath *fillPath; GpPath *strokePath; REAL widthScale; GdipCreatePath (FillModeAlternate, &fillPath); GdipCreatePath (FillModeAlternate, &strokePath); GdipCreateCustomLineCap (fillPath, strokePath, LineCapDiamondAnchor, 10, &cap); // Negative tests. status = GdipGetCustomLineCapWidthScale (NULL, &widthScale); assertEqualInt (status, InvalidParameter); status = GdipGetCustomLineCapWidthScale (cap, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (fillPath); GdipDeletePath (strokePath); GdipDeleteCustomLineCap (cap); } int main(int argc, char**argv) { STARTUP; test_createCustomLineCap (); test_deleteCustomLineCap (); test_cloneCustomLineCap (); test_getCustomLineCapType (); test_setCustomLineCapStrokeCaps (); test_getCustomLineCapStrokeCaps (); test_setCustomLineCapStrokeJoin (); test_getCustomLineCapStrokeJoin (); test_setCustomLineCapBaseCap (); test_getCustomLineCapBaseCap (); test_setCustomLineCapBaseInset (); test_getCustomLineCapBaseInset (); test_setCustomLineCapWidthScale (); test_getCustomLineCapWidthScale (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testregion.c0000644000175000017500000137177413545154623021043 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" GpImage *image; GpGraphics *graphics; static void test_createRegion () { GpStatus status; GpRegion *region; status = GdipCreateRegion (®ion); assertEqualInt (status, Ok); verifyInfiniteRegion (region); GdipDeleteRegion (region); // Negative tests. status = GdipCreateRegion (NULL); assertEqualInt (status, InvalidParameter); } static void test_createRegionRect () { GpStatus status; GpRectF normalRect = {1, 2, 3, 4}; GpRegion *region; // Positive width, positive height. status = GdipCreateRegionRect (&normalRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 4, FALSE, FALSE); verifyRegionScans (region, &normalRect, sizeof (normalRect)); GdipDeleteRegion (region); // > Infinite width, > infinite height. GpRectF greaterThanInfiniteGreaterThanInfiniteHeightRect = {1, 2, 8388609.0f, 8388609.0f}; status = GdipCreateRegionRect (&greaterThanInfiniteGreaterThanInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388609.0f, 8388609.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // > Infinite width, infinite height. GpRectF greaterThanInfiniteInfiniteHeightRect = {1, 2, 8388609.0f, 8388608.0f}; status = GdipCreateRegionRect (&greaterThanInfiniteInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388609.0f, 8388608.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // > Infinite width, positive height. GpRectF greaterThanInfinitePositiveHeightRect = {1, 2, 8388609.0f, 4}; status = GdipCreateRegionRect (&greaterThanInfinitePositiveHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388609.0f, 4, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // > Infinite width, zero height. GpRectF greaterThanInfiniteZeroHeightRect = {1, 2, 8388609.0f, 0}; status = GdipCreateRegionRect (&greaterThanInfiniteZeroHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388609.0f, 0, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // > Infinite width, negative height. GpRectF greaterThanInfiniteNegativeHeightRect = {1, 2, 8388609.0f, -4}; status = GdipCreateRegionRect (&greaterThanInfiniteNegativeHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388609.0f, -4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Infinite width, > infinite height. GpRectF infiniteWidthGreaterThanInfiniteHeightRect = {1, 2, 8388608.0f, 8388609.0f}; status = GdipCreateRegionRect (&infiniteWidthGreaterThanInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388608.0f, 8388609.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Infinite width, infinite height. GpRectF infiniteWidthInfiniteHeightRect = {1, 2, 8388608.0f, 8388608.0f}; status = GdipCreateRegionRect (&infiniteWidthInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388608.0f, 8388608.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Infinite width, positive height. GpRectF infiniteWidthPositiveHeightRect = {1, 2, 8388608.0f, 4}; status = GdipCreateRegionRect (&infiniteWidthPositiveHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388608.0f, 4, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Infinite width, zero height. GpRectF infiniteWidthZeroHeightRect = {1, 2, 8388608.0f, 0}; status = GdipCreateRegionRect (&infiniteWidthZeroHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388608.0f, 0, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Infinite width, negative height. GpRectF infiniteWidthNegativeHeightRect = {1, 2, 8388608.0f, -4}; status = GdipCreateRegionRect (&infiniteWidthNegativeHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 8388608.0f, -4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Positive width, > infinite height. GpRectF positiveWidthGreaterThanInfiniteHeightRect = {1, 2, 3, 8388609.0f}; status = GdipCreateRegionRect (&positiveWidthGreaterThanInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 8388609.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Positive width, infinite height. GpRectF positiveWidthInfiniteHeightRect = {1, 2, 3, 8388608.0f}; status = GdipCreateRegionRect (&positiveWidthInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 8388608.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Positive width, zero height. GpRectF positiveWidthZeroHeightRect = {1, 2, 3, 0}; status = GdipCreateRegionRect (&positiveWidthZeroHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 0, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Positive width, negative height. GpRectF positiveWidthNegativeHeightRect = {1, 2, 3, -4}; status = GdipCreateRegionRect (&positiveWidthNegativeHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, -4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Zero width, > infinite height. GpRectF zeroWidthGreaterThanInfiniteHeightRect = {1, 2, 0, 8388609.0f}; status = GdipCreateRegionRect (&zeroWidthGreaterThanInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, 8388609.0f, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Zero width, infinite height. GpRectF zeroWidthInfiniteHeightRect = {1, 2, 0, 8388608.0f}; status = GdipCreateRegionRect (&zeroWidthInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, 8388608.0f, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Zero width, positive height. GpRectF zeroWidthPositiveHeightRect = {1, 2, 0, 4}; status = GdipCreateRegionRect (&zeroWidthPositiveHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, 4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Zero width, zero height. GpRectF zeroWidthZeroHeightRect = {1, 2, 0, 0}; status = GdipCreateRegionRect (&zeroWidthZeroHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, 0, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Zero width, Negative height. GpRectF zeroWidthNegativeHeightRect = {1, 2, 0, -4}; status = GdipCreateRegionRect (&zeroWidthNegativeHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, -4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Negative width, > infinite height. GpRectF negativeWidthGreaterThanInfiniteHeightRect = {1, 2, -3, 8388609.0f}; status = GdipCreateRegionRect (&negativeWidthGreaterThanInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, 8388609.0f, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Negative width, infinite height. GpRectF negativeWidthInfiniteHeightRect = {1, 2, -3, 8388608.0f}; status = GdipCreateRegionRect (&negativeWidthInfiniteHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, 8388608.0f, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Negative width, positive height. GpRectF negativeWidthPositiveHeightRect = {1, 2, -3, 4}; status = GdipCreateRegionRect (&negativeWidthPositiveHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, 4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Negative width, zero height. GpRectF negativeWidthZeroHeightRect = {1, 2, -3, 0}; status = GdipCreateRegionRect (&negativeWidthZeroHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, 0, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Negative width, negative height. GpRectF negativeWidthNegativeHeightRect = {1, 2, -3, -4}; status = GdipCreateRegionRect (&negativeWidthNegativeHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, -4, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Negative tests. status = GdipCreateRegionRect (NULL, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRect (&normalRect, NULL); assertEqualInt (status, InvalidParameter); } static void test_createRegionRectI () { GpStatus status; GpRect normalRect = {1, 2, 3, 4}; GpRect negativeWidthRect = {1, 2, -3, 4}; GpRect negativeHeightRect = {1, 2, 3, -4}; GpRect zeroRect = {0, 0, 0, 0}; GpRect infiniteRect = {-4194304, -4194304, 8388608, 8388608}; GpRegion *region; // Normal. status = GdipCreateRegionRectI (&normalRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 4, FALSE, FALSE); GdipDeleteRegion (region); // Negative width. status = GdipCreateRegionRectI (&negativeWidthRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, 4, TRUE, FALSE); GdipDeleteRegion (region); // Negative height. status = GdipCreateRegionRectI (&negativeHeightRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, -4, TRUE, FALSE); GdipDeleteRegion (region); // Zero. status = GdipCreateRegionRectI (&zeroRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); verifyRegionScans (region, emptyScans, sizeof (emptyScans)); GdipDeleteRegion (region); // Infinite. status = GdipCreateRegionRectI (&infiniteRect, ®ion); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); verifyRegionScans (region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Negative tests. status = GdipCreateRegionRectI (NULL, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRectI (&normalRect, NULL); assertEqualInt (status, InvalidParameter); } static void test_createRegionPath () { GpStatus status; GpPath *path; GpRegion *region; // Normal path. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); status = GdipCreateRegionPath (path, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); GdipDeletePath (path); // Empty path. GdipCreatePath (FillModeWinding, &path); status = GdipCreateRegionPath (path, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); GdipDeletePath (path); // Infinite path - rectangle. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f); status = GdipCreateRegionPath (path, ®ion); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); GdipDeletePath (path); // Infinite path - polygon. GdipCreatePath (FillModeWinding, &path); PointF polygonPoints[] = { {-4194304, -4194304}, {-4194304, 4194304}, {4194304, 4194304}, {4194304, -4194304}, {-4194304, -4194304} }; GdipAddPathPolygon (path, polygonPoints, 5); status = GdipCreateRegionPath (path, ®ion); assertEqualInt (status, Ok); // FIXME: libgdiplus does not identify this as an infinite region. #if defined(USE_WINDOWS_GDIPLUS) verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); #else verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, FALSE); #endif GdipDeleteRegion (region); GdipDeletePath (path); // Empty path - curve. GdipCreatePath (FillModeWinding, &path); PointF emptyCurvePoints[] = { {10, 10}, {20, 20} }; status = GdipAddPathCurve (path, emptyCurvePoints, 2); status = GdipCreateRegionPath (path, ®ion); assertEqualInt (status, Ok); verifyRegion (region, 10, 10, 10, 10, TRUE, FALSE); GdipDeleteRegion (region); GdipDeletePath (path); // Not infinite path - curve. GdipCreatePath (FillModeWinding, &path); PointF infiniteCurvePoints[] = { {-4194304.0f, -4194304.0f}, {4194304.0f, 4194304.0f} }; status = GdipAddPathCurve (path, infiniteCurvePoints, 2); status = GdipCreateRegionPath (path, ®ion); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, TRUE, FALSE); GdipDeleteRegion (region); // Negative tests. status = GdipCreateRegionPath (NULL, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionPath (path, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); } static void test_createRegionRgnData () { GpStatus status; GpRegion *region; BYTE infiniteRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0x9B, 0x34, 0x22, 0xA3, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x03, 0x00, 0x00, 0x10 }; BYTE emptyRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0xFE, 0x53, 0x9E, 0x1B, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x02, 0x00, 0x00, 0x10 }; BYTE rectMagicNumber2[] = { /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic Number */ 0x02, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE rectMagicNumber1[] = { /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xD0, 0x97, 0x65, 0xEE, /* Magic Number */ 0x01, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE rectEmpty[] = { /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0x0E, 0x81, 0x00, 0x6C, /* Magic Number */ 0x01, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x02, 0x00, 0x00, 0x10 }; BYTE rectInfinite[] = { /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0x6B, 0xE6, 0xBC, 0xD4, /* Magic Number */ 0x01, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x03, 0x00, 0x00, 0x10 }; BYTE zeroWidthRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xD2, 0xC2, 0x10, 0xBB, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x00, 0x00, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE zeroHeightRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x2C, 0x49, 0xE4, 0xA1, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x00, 0x00 }; BYTE zeroWidthAndHeightRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x09, 0x1B, 0x4F, 0xF6, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x00, 0x00, /* Height */ 0x00, 0x00, 0x00, 0x00 }; BYTE negativeWidthRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x65, 0x20, 0x5D, 0x5D, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0xC0, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE negativeHeightRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xD7, 0x13, 0x03, 0x01, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0xC0 }; BYTE invalidChecksum[] = { /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x00, 0x00, 0x00, 0x00, /* Magic Number */ 0x02, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE zeroSize[] = { /* Size */ 0x00, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic Number */ 0x02, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE smallSize[] = { /* Size */ 0x18, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic Number */ 0x02, 0x10, 0xC0, 0xDB, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; BYTE invalidMagicNumber[] = { /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x6A, 0x4E, 0xC2, 0x0F, /* Magic Number */ 0xFF, 0xFF, 0xFF, 0xFF, /* Combining ops */ 0x00, 0x00, 0x00, 0x00, /* Rect */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE pathData[] = { /* -- RegionHeader -- */ /* Size */ 0x30, 0x00, 0x00, 0x00, /* Checksum */ 0xCA, 0x7C, 0x8B, 0x34, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x01, 0x00, 0x00, 0x10, /* Size */ 0x20, 0x00, 0x00, 0x00, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Count */ 0x04, 0x00, 0x00, 0x00, /* Flags */ 0x00, 0x60, 0x00, 0x00, /* (1, 2) */ 0x01, 0x00, 0x02, 0x00, /* (4, 2) */ 0x04, 0x00, 0x02, 0x00, /* (4, 6) */ 0x04, 0x00, 0x06, 0x00, /* (1, 6) */ 0x01, 0x00, 0x06, 0x00, /* Start */ 0x00, /* LineTo */ 0x01, /* LineTo */ 0x01, /* CloseLine */ 0x81, }; #endif // Infinite. status = GdipCreateRegionRgnData (infiniteRegionData, sizeof (infiniteRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); verifyRegionScans(region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); // Empty. status = GdipCreateRegionRgnData (emptyRegionData, sizeof (emptyRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); // Rect. status = GdipCreateRegionRgnData (rectMagicNumber2, sizeof (rectMagicNumber2), ®ion); assertEqualInt (status, Ok); GpRectF expectedRect = { 1, 2, 3, 4 }; verifyRegion (region, 1, 2, 3, 4, FALSE, FALSE); verifyRegionScans(region, &expectedRect, sizeof (expectedRect)); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (rectMagicNumber1, sizeof (rectMagicNumber1), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 4, FALSE, FALSE); verifyRegionScans(region, &expectedRect, sizeof (expectedRect)); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (rectEmpty, sizeof (rectEmpty), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (rectInfinite, sizeof (rectInfinite), ®ion); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); verifyRegionScans(region, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (zeroWidthRectRegionData, sizeof (zeroWidthRectRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, 4, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (zeroHeightRectRegionData, sizeof (zeroHeightRectRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 0, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (zeroWidthAndHeightRectRegionData, sizeof (zeroWidthAndHeightRectRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 0, 0, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (negativeWidthRectRegionData, sizeof (negativeWidthRectRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, -3, 4, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); status = GdipCreateRegionRgnData (negativeHeightRectRegionData, sizeof (negativeHeightRectRegionData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, -4, TRUE, FALSE); verifyRegionScans(region, emptyScans, 0); GdipDeleteRegion (region); // Path. // FIXME: match GDI+ parsing. #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreateRegionRgnData (pathData, sizeof (pathData), ®ion); assertEqualInt (status, Ok); verifyRegion (region, 1, 2, 3, 4, FALSE, FALSE); verifyRegionScans(region, &expectedRect, sizeof (expectedRect)); GdipDeleteRegion (region); #endif // Negative tests. status = GdipCreateRegionRgnData (NULL, 12, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (rectMagicNumber2, -1, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (rectMagicNumber2, 0, ®ion); assertEqualInt (status, GenericError); status = GdipCreateRegionRgnData (NULL, 0, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (rectMagicNumber2, 0, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (rectMagicNumber2, 7, ®ion); assertEqualInt (status, GenericError); status = GdipCreateRegionRgnData (NULL, 7, ®ion); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (rectMagicNumber2, 7, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (rectMagicNumber2, 12, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateRegionRgnData (invalidChecksum, sizeof (invalidChecksum), ®ion); assertEqualInt (status, GenericError); status = GdipCreateRegionRgnData (zeroSize, sizeof (zeroSize), ®ion); assertEqualInt (status, GenericError); status = GdipCreateRegionRgnData (smallSize, sizeof (smallSize), ®ion); assertEqualInt (status, GenericError); status = GdipCreateRegionRgnData (smallSize, sizeof (invalidMagicNumber), ®ion); assertEqualInt (status, GenericError); } static void test_getRegionData () { GpRegion *region; GpPath *path; GpStatus status; BYTE buffer[1024]; UINT sizeFilled; // Infinite region. GdipCreateRegion (®ion); BYTE infiniteRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0x9B, 0x34, 0x22, 0xA3, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x03, 0x00, 0x00, 0x10 }; verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); BYTE emptyRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x0C, 0x00, 0x00, 0x00, /* Checksum */ 0xFE, 0x53, 0x9E, 0x1B, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x02, 0x00, 0x00, 0x10 }; verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); // Infinite Rect. GpRectF infiniteRect = {-4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f}; GdipCreateRegionRect (&infiniteRect, ®ion); BYTE infiniteRectRegionData[] = { /* --RegionHeader-- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x19, 0x83, 0xAD, 0x2A, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0xCA, /* Y */ 0x00, 0x00, 0x80, 0xCA, /* Width */ 0x00, 0x00, 0x00, 0x4B, /* Height */ 0x00, 0x00, 0x00, 0x4B }; verifyRegionData (region, infiniteRectRegionData); GdipDeleteRegion (region); // Empty Rect. GpRectF emptyRect = {0, 0, 0, 0}; GdipCreateRegionRect (&emptyRect, ®ion); BYTE emptyRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xF6, 0xCF, 0xA7, 0x8B, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x00, 0x00, /* Y */ 0x00, 0x00, 0x00, 0x00, /* Width */ 0x00, 0x00, 0x00, 0x00, /* Height */ 0x00, 0x00, 0x00, 0x00 }; verifyRegionData (region, emptyRectRegionData); GdipDeleteRegion (region); // Rect. GpRectF rect = {1, 2, 3, 4}; GdipCreateRegionRect (&rect, ®ion); BYTE nonEmptyRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; verifyRegionData (region, nonEmptyRectRegionData); GdipDeleteRegion (region); // Zero Width Rect. GpRectF zeroWidthRect = {1, 2, 0, 4}; GdipCreateRegionRect (&zeroWidthRect, ®ion); BYTE zeroWidthRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xD2, 0xC2, 0x10, 0xBB, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x00, 0x00, /* Height */ 0x00, 0x00, 0x80, 0x40 }; verifyRegionData (region, zeroWidthRectRegionData); GdipDeleteRegion (region); // Zero Height Rect. GpRectF zeroHeightRect = {1, 2, 3, 0}; GdipCreateRegionRect (&zeroHeightRect, ®ion); BYTE zeroHeightRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x2C, 0x49, 0xE4, 0xA1, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x00, 0x00 }; verifyRegionData (region, zeroHeightRectRegionData); GdipDeleteRegion (region); // Zero Width and Height Rect. GpRectF zeroWidthAndHeightRect = {1, 2, 0, 0}; GdipCreateRegionRect (&zeroWidthAndHeightRect, ®ion); BYTE zeroWidthAndHeightRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x09, 0x1B, 0x4F, 0xF6, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x00, 0x00, /* Height */ 0x00, 0x00, 0x00, 0x00 }; verifyRegionData (region, zeroWidthAndHeightRectRegionData); GdipDeleteRegion (region); // Negative Width Rect. GpRectF negativeWidthRect = {1, 2, -3, 4}; GdipCreateRegionRect (&negativeWidthRect, ®ion); BYTE negativeWidthRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0x65, 0x20, 0x5D, 0x5D, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0xC0, /* Height */ 0x00, 0x00, 0x80, 0x40 }; verifyRegionData (region, negativeWidthRectRegionData); GdipDeleteRegion (region); // Negative Height Rect. GpRectF negativeHeightRect = {1, 2, 3, -4}; GdipCreateRegionRect (&negativeHeightRect, ®ion); BYTE negativeHeightRectRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xD7, 0x13, 0x03, 0x01, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0xC0 }; verifyRegionData (region, negativeHeightRectRegionData); GdipDeleteRegion (region); // Path. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 1, 2, 3, 4); GdipCreateRegionPath (path, ®ion); // FIXME: match GDI+ serializing. #if defined(USE_WINDOWS_GDIPLUS) BYTE pathRegionData[] = { /* -- RegionHeader -- */ /* Size */ 0x30, 0x00, 0x00, 0x00, /* Checksum */ 0xCA, 0x7C, 0x8B, 0x34, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x01, 0x00, 0x00, 0x10, /* Size */ 0x20, 0x00, 0x00, 0x00, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Count */ 0x04, 0x00, 0x00, 0x00, /* Flags */ 0x00, 0x60, 0x00, 0x00, /* (1, 2) */ 0x01, 0x00, 0x02, 0x00, /* (4, 2) */ 0x04, 0x00, 0x02, 0x00, /* (4, 6) */ 0x04, 0x00, 0x06, 0x00, /* (1, 6) */ 0x01, 0x00, 0x06, 0x00, /* Start */ 0x00, /* LineTo */ 0x01, /* LineTo */ 0x01, /* CloseLine */ 0x81, }; verifyRegionData (region, pathRegionData); #endif GdipDeletePath (path); // Negative tests. status = GdipGetRegionData (NULL, buffer, sizeof(buffer), &sizeFilled); assertEqualInt (status, InvalidParameter); status = GdipGetRegionData (region, NULL, sizeof(buffer), &sizeFilled); assertEqualInt (status, InvalidParameter); status = GdipGetRegionData (region, buffer, 0, &sizeFilled); assertEqualInt (status, InvalidParameter); status = GdipGetRegionData (region, buffer, 1, &sizeFilled); assertEqualInt (status, InsufficientBuffer); status = GdipGetRegionData (region, buffer, 2, &sizeFilled); assertEqualInt (status, InsufficientBuffer); status = GdipGetRegionData (region, buffer, sizeof (buffer), NULL); assertEqualInt (status, Ok); GdipDeleteRegion (region); } static void test_getRegionDataReplace () { GpRegion *region; GpRegion *other; GpPath *path; GpRectF rect1 = { 1, 2, 3, 4 }; GpRectF rect2 = { 1, 2, 3, 4 }; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); BYTE rectRegionData[] = { /* --RegionHeader-- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; // Infinite Region + Infinite Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Empty Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Rect Region. GdipCreateRegion (®ion); GdipCreateRegionRect (&rect1, &other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Rect. GdipCreateRegion (®ion); GdipCombineRegionRect (region, &rect1, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); // Empty Region + Infinite Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (region); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Empty Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (region); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Rect Region. GdipCreateRegion (®ion); GdipCreateRegionRect (&rect1, &other); GdipSetEmpty (region); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Rect. GdipCreateRegion (®ion); GdipSetEmpty (region); GdipCombineRegionRect (region, &rect1, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); // Rect Region + Infinite Region. GdipCreateRegionRect (&rect1, ®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Rect Region + Empty Region. GdipCreateRegionRect (&rect1, ®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Rect Region + Rect Region. GdipCreateRegionRect (&rect2, ®ion); GdipCreateRegionRect (&rect1, &other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Rect Region + Rect. GdipCreateRegionRect (&rect2, ®ion); GdipCombineRegionRect (region, &rect1, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); // Path Region + Infinite Region. GdipCreateRegionPath (path, ®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Path Region + Empty Region. GdipCreateRegionPath (path, ®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Path Region + Rect Region. GdipCreateRegionPath (path, ®ion); GdipCreateRegionRect (&rect1, &other); GdipCombineRegionRegion (region, other, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Path Region + Rect. GdipCreateRegionPath (path, ®ion); GdipCombineRegionRect (region, &rect1, CombineModeReplace); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeletePath (path); } static void test_getRegionDataUnion () { GpRegion *region; GpRegion *other; GpPath *path; GpRectF rect1 = { 1, 2, 3, 4 }; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); BYTE rectRegionData[] = { /* --RegionHeader-- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; // Infinite Region + Infinite Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Empty Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Rect Region. GdipCreateRegion (®ion); GdipCreateRegionRect (&rect1, &other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Rect. GdipCreateRegion (®ion); GdipCombineRegionRect (region, &rect1, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); // Infinite Region + Path. GdipCreateRegion (®ion); GdipCombineRegionPath (region, path, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); // Empty Region + Infinite Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (region); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Empty Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (region); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Rect Region. GdipCreateRegion (®ion); GdipCreateRegionRect (&rect1, &other); GdipSetEmpty (region); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Rect. GdipCreateRegion (®ion); GdipSetEmpty (region); GdipCombineRegionRect (region, &rect1, CombineModeUnion); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); // Rect Region + Infinite Region. GdipCreateRegionRect (&rect1, ®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Rect Region + Empty Region. GdipCreateRegionRect (&rect1, ®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Path Region + Infinite Region. GdipCreateRegionPath (path, ®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeUnion); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); GdipDeletePath (path); } static void test_getRegionDataComplement () { GpRegion *region; GpRegion *other; GpPath *path; GpRectF rect1 = { 1, 2, 3, 4 }; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); BYTE rectRegionData[] = { /* --RegionHeader-- */ /* Size */ 0x1C, 0x00, 0x00, 0x00, /* Checksum */ 0xF7, 0x90, 0xBB, 0xEC, /* Magic */ 0x02, 0x10, 0xC0, 0xDB, /* Combining Ops */ 0x00, 0x00, 0x00, 0x00, /* -- Entry -- */ /* Type */ 0x00, 0x00, 0x00, 0x10, /* X */ 0x00, 0x00, 0x80, 0x3F, /* Y */ 0x00, 0x00, 0x00, 0x40, /* Width */ 0x00, 0x00, 0x40, 0x40, /* Height */ 0x00, 0x00, 0x80, 0x40 }; // Infinite Region + Infinite Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Empty Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Rect Region. GdipCreateRegion (®ion); GdipCreateRegionRect (&rect1, &other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Path Region. GdipCreateRegion (®ion); GdipCreateRegionPath (path, &other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Infinite Region + Rect. GdipCreateRegion (®ion); GdipCombineRegionRect (region, &rect1, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); // Infinite Region + Path. GdipCreateRegion (®ion); GdipCombineRegionPath (region, path, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); // Empty Region + Infinite Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (region); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, infiniteRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Empty Region. GdipCreateRegion (®ion); GdipCreateRegion (&other); GdipSetEmpty (region); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Rect Region. GdipCreateRegion (®ion); GdipCreateRegionRect (&rect1, &other); GdipSetEmpty (region); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Empty Region + Rect. GdipCreateRegion (®ion); GdipSetEmpty (region); GdipCombineRegionRect (region, &rect1, CombineModeComplement); verifyRegionData (region, rectRegionData); GdipDeleteRegion (region); // Rect Region + Empty Region. GdipCreateRegionRect (&rect1, ®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); // Path Region + Empty Region. GdipCreateRegionPath (path, ®ion); GdipCreateRegion (&other); GdipSetEmpty (other); GdipCombineRegionRegion (region, other, CombineModeComplement); verifyRegionData (region, emptyRegionData); GdipDeleteRegion (region); GdipDeleteRegion (other); GdipDeletePath (path); } static void test_getRegionDataSize() { GpStatus status; GpRegion *region; UINT bufferSize; GdipCreateRegion (®ion); // Negative tests. status = GdipGetRegionDataSize (NULL, &bufferSize); assertEqualInt (status, InvalidParameter); status = GdipGetRegionDataSize (region, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteRegion (region); } static void test_cloneRegion () { GpStatus status; GpPath *path; GpRegion *region; GpRegion *clone; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipCloneRegion (region, &clone); assertEqualInt (status, Ok); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipCloneRegion (region, &clone); assertEqualInt (status, Ok); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); GdipDeletePath (path); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipCloneRegion (region, &clone); assertEqualInt (status, Ok); verifyRegion (clone, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); GdipDeleteRegion (clone); // Infinite region. GdipCreateRegion (®ion); status = GdipCloneRegion (region, &clone); assertEqualInt (status, Ok); verifyRegion (clone, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); GdipDeleteRegion (clone); // Negative tests. status = GdipCloneRegion (NULL, &clone); assertEqualInt (status, InvalidParameter); status = GdipCloneRegion (region, NULL); assertEqualInt (status, InvalidParameter); } static void test_deleteRegion () { GpStatus status; GpPath *path; GpRegion *region; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipDeleteRegion (region); assertEqualInt (status, Ok); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipDeleteRegion (region); assertEqualInt (status, Ok); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipDeleteRegion (region); assertEqualInt (status, Ok); // Infinite region. GdipCreateRegion (®ion); status = GdipDeleteRegion (region); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteRegion (NULL); assertEqualInt (status, InvalidParameter); } static void test_setInfinite () { GpStatus status; GpPath *path; GpRegion *region; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipSetInfinite (region); assertEqualInt (status, Ok); verifyInfiniteRegion (region); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipSetInfinite (region); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipSetInfinite (region); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipSetInfinite (region); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Negative tests. status = GdipSetInfinite (NULL); assertEqualInt (status, InvalidParameter); } static void test_setEmpty () { GpStatus status; GpPath *path; GpRegion *region; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipSetEmpty (region); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipSetEmpty (region); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipSetEmpty (region); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipSetEmpty (region); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); assertEqualInt (status, Ok); GdipDeleteRegion (region); // Negative tests. status = GdipSetEmpty (NULL); assertEqualInt (status, InvalidParameter); } static void test_getRegionBounds () { GpStatus status; GpRegion *region; GpRectF rect; GdipCreateRegion (®ion); // Negative tests. status = GdipGetRegionBounds (NULL, graphics, &rect); assertEqualInt (status, InvalidParameter); status = GdipGetRegionBounds (region, NULL, &rect); assertEqualInt (status, InvalidParameter); status = GdipGetRegionBounds (region, graphics, NULL); assertEqualInt (status, InvalidParameter); } static void test_isEmptyRegion () { GpStatus status; GpRegion *region; BOOL isEmpty; GdipCreateRegion (®ion); // Negative tests. status = GdipIsEmptyRegion (NULL, graphics, &isEmpty); assertEqualInt (status, InvalidParameter); status = GdipIsEmptyRegion (region, NULL, &isEmpty); assertEqualInt (status, InvalidParameter); status = GdipIsEmptyRegion (region, graphics, NULL); assertEqualInt (status, InvalidParameter); } static void test_isEqualRegion () { GpStatus status; GpRegion *infiniteRegion1; GpRegion *infiniteRegion2; GpRegion *emptyRegion1; GpRegion *emptyRegion2; GpRegion *infiniteRectRegion1; GpRegion *infiniteRectRegion2; GpRegion *emptyRectRegion1; GpRegion *emptyRectRegion2; GpRegion *zeroWidthRectRegion1; GpRegion *zeroWidthRectRegion2; GpRegion *zeroHeightRectRegion1; GpRegion *zeroHeightRectRegion2; GpRegion *negativeWidthRectRegion1; GpRegion *negativeWidthRectRegion2; GpRegion *negativeHeightRectRegion1; GpRegion *negativeHeightRectRegion2; GpRegion *rectRegion1; GpRegion *rectRegion2; GpRegion *rectRegion3; GpRegion *rectRegion4; GpRegion *rectRegion5; GpRegion *rectRegion6; GpRegion *multiRectRegion1; GpRegion *multiRectRegion2; GpRegion *multiRectRegion3; GpRegion *multiRectRegion4; GpRegion *multiRectRegion5; GpRegion *multiRectRegion6; GpRegion *emptyPathRegion1; GpRegion *emptyPathRegion2; GpRegion *infinitePathRegion1; GpRegion *infinitePathRegion2; GpRegion *pathRegion1; GpRegion *pathRegion2; GpRegion *pathRegion3; GpRegion *pathRegion4; GpRegion *pathRegion5; GpRegion *pathRegion6; BOOL isEqual; GdipCreateRegion (&infiniteRegion1); GdipCreateRegion (&infiniteRegion2); GdipSetInfinite (infiniteRegion2); GpRectF infiniteRect = {-4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f}; GdipCreateRegionRect (&infiniteRect, &infiniteRectRegion1); GdipCreateRegionRect (&infiniteRect, &infiniteRectRegion2); GdipCreateRegion (&emptyRegion1); GdipSetEmpty (emptyRegion1); GdipCreateRegion (&emptyRegion2); GdipSetEmpty (emptyRegion2); GpRectF emptyRect = {0, 0, 0, 0}; GdipCreateRegionRect (&emptyRect, &emptyRectRegion1); GdipCreateRegionRect (&emptyRect, &emptyRectRegion2); GpRectF zeroWidthRect = {1, 2, 0, 4}; GdipCreateRegionRect (&zeroWidthRect, &zeroWidthRectRegion1); GdipCreateRegionRect (&zeroWidthRect, &zeroWidthRectRegion2); GpRectF zeroHeightRect = {1, 2, 3, 0}; GdipCreateRegionRect (&zeroHeightRect, &zeroHeightRectRegion1); GdipCreateRegionRect (&zeroHeightRect, &zeroHeightRectRegion2); GpRectF negativeWidthRect = {1, 2, -1, 4}; GdipCreateRegionRect (&negativeWidthRect, &negativeWidthRectRegion1); GdipCreateRegionRect (&negativeWidthRect, &negativeWidthRectRegion2); GpRectF negativeHeightRect = {1, 2, 3, -1}; GdipCreateRegionRect (&negativeHeightRect, &negativeHeightRectRegion1); GdipCreateRegionRect (&negativeHeightRect, &negativeHeightRectRegion2); GpRectF rect1 = {1, 2, 3, 4}; GdipCreateRegionRect (&rect1, &rectRegion1); GpRectF rect2 = {1, 2, 3, 4}; GdipCreateRegionRect (&rect2, &rectRegion2); GpRectF rect3 = {2, 2, 3, 4}; GdipCreateRegionRect (&rect3, &rectRegion3); GpRectF rect4 = {1, 3, 3, 4}; GdipCreateRegionRect (&rect4, &rectRegion4); GpRectF rect5 = {1, 2, 4, 4}; GdipCreateRegionRect (&rect5, &rectRegion5); GpRectF rect6 = {1, 2, 3, 5}; GdipCreateRegionRect (&rect6, &rectRegion6); GpRectF multiRect1_1 = {1, 2, 3, 4}; GpRectF multiRect1_2 = {6, 7, 8, 9}; GdipCreateRegionRect (&multiRect1_1, &multiRectRegion1); GdipCombineRegionRect (multiRectRegion1, &multiRect1_2, CombineModeUnion); GpRectF multiRect2_1 = {1, 2, 3, 4}; GpRectF multiRect2_2 = {6, 7, 8, 9}; GdipCreateRegionRect (&multiRect2_1, &multiRectRegion2); GdipCombineRegionRect (multiRectRegion2, &multiRect2_2, CombineModeUnion); GpRectF multiRect3_1 = {1, 2, 3, 4}; GpRectF multiRect3_2 = {7, 7, 8, 9}; GdipCreateRegionRect (&multiRect3_1, &multiRectRegion3); GdipCombineRegionRect (multiRectRegion3, &multiRect3_2, CombineModeUnion); GpRectF multiRect4_1 = {1, 2, 3, 4}; GpRectF multiRect4_2 = {6, 8, 8, 9}; GdipCreateRegionRect (&multiRect4_1, &multiRectRegion4); GdipCombineRegionRect (multiRectRegion4, &multiRect4_2, CombineModeUnion); GpRectF multiRect5_1 = {1, 2, 3, 4}; GpRectF multiRect5_2 = {6, 7, 9, 9}; GdipCreateRegionRect (&multiRect5_1, &multiRectRegion5); GdipCombineRegionRect (multiRectRegion5, &multiRect5_2, CombineModeUnion); GpRectF multiRect6_1 = {1, 2, 3, 4}; GpRectF multiRect6_2 = {6, 7, 8, 10}; GdipCreateRegionRect (&multiRect6_1, &multiRectRegion6); GdipCombineRegionRect (multiRectRegion6, &multiRect6_2, CombineModeUnion); GpPath *emptyPath; GdipCreatePath (FillModeAlternate, &emptyPath); GdipCreateRegionPath (emptyPath, &emptyPathRegion1); GdipCreateRegionPath (emptyPath, &emptyPathRegion2); GpPath *infinitePath; GdipCreatePath (FillModeAlternate, &infinitePath); GdipAddPathRectangle (infinitePath, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f); GdipCreateRegionPath (infinitePath, &infinitePathRegion1); GdipCreateRegionPath (infinitePath, &infinitePathRegion2); GpPath *path1; GdipCreatePath (FillModeAlternate, &path1); GdipAddPathRectangle (path1, 1, 2, 3, 4); GdipCreateRegionPath (path1, &pathRegion1); GpPath *path2; GdipCreatePath (FillModeAlternate, &path2); GdipAddPathRectangle (path2, 1, 2, 3, 4); GdipCreateRegionPath (path2, &pathRegion2); GpPath *path3; GdipCreatePath (FillModeAlternate, &path3); GdipAddPathRectangle (path3, 2, 2, 3, 4); GdipCreateRegionPath (path3, &pathRegion3); GpPath *path4; GdipCreatePath (FillModeAlternate, &path4); GdipAddPathRectangle (path4, 1, 3, 3, 4); GdipCreateRegionPath (path4, &pathRegion4); GpPath *path5; GdipCreatePath (FillModeAlternate, &path5); GdipAddPathRectangle (path5, 1, 2, 4, 4); GdipCreateRegionPath (path5, &pathRegion5); GpPath *path6; GdipCreatePath (FillModeAlternate, &path6); GdipAddPathRectangle (path6, 1, 2, 3, 5); GdipCreateRegionPath (path6, &pathRegion6); // Infinite region. status = GdipIsEqualRegion (infiniteRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRegion1, infiniteRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Empty region. status = GdipIsEqualRegion (emptyRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, emptyRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - infinite. status = GdipIsEqualRegion (infiniteRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRectRegion1, infiniteRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infiniteRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infiniteRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - empty. status = GdipIsEqualRegion (emptyRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, emptyRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - zero width. status = GdipIsEqualRegion (zeroWidthRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, emptyRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, zeroWidthRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroWidthRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroWidthRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroWidthRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroWidthRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroWidthRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroWidthRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - zero height. status = GdipIsEqualRegion (zeroHeightRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, emptyRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, zeroHeightRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (zeroHeightRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroHeightRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroHeightRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroHeightRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroHeightRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (zeroHeightRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - negative width. status = GdipIsEqualRegion (negativeWidthRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, emptyRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, negativeWidthRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeWidthRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeWidthRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeWidthRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeWidthRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeWidthRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeWidthRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - negative height. status = GdipIsEqualRegion (negativeHeightRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, emptyRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, negativeWidthRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (negativeHeightRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeHeightRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeHeightRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeHeightRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeHeightRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (negativeHeightRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - normal. status = GdipIsEqualRegion (rectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (rectRegion1, rectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (rectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (rectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, rectRegion3, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, rectRegion4, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, rectRegion5, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, rectRegion6, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, pathRegion3, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, pathRegion4, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, pathRegion5, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, pathRegion6, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (rectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Rectangular region - multiple. status = GdipIsEqualRegion (multiRectRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (multiRectRegion1, multiRectRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (multiRectRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, multiRectRegion3, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, multiRectRegion4, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, multiRectRegion5, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, multiRectRegion6, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (multiRectRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Path region - infinite. status = GdipIsEqualRegion (infinitePathRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infinitePathRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infinitePathRegion1, infinitePathRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infinitePathRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (infinitePathRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (infinitePathRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Path region - empty. status = GdipIsEqualRegion (emptyPathRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, emptyPathRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, zeroWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, zeroHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, negativeWidthRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, negativeHeightRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (emptyPathRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyPathRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyPathRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyPathRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyPathRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (emptyPathRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Path region - normal. status = GdipIsEqualRegion (pathRegion1, rectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (pathRegion1, pathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (pathRegion1, pathRegion2, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, TRUE); status = GdipIsEqualRegion (pathRegion1, infiniteRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, emptyRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, infiniteRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, emptyRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, rectRegion3, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, rectRegion4, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, rectRegion5, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, rectRegion6, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, multiRectRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, emptyPathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, infinitePathRegion1, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, pathRegion3, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, pathRegion4, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, pathRegion5, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); status = GdipIsEqualRegion (pathRegion1, pathRegion6, graphics, &isEqual); assertEqualInt (status, Ok); assertEqualInt (isEqual, FALSE); // Negative tests. status = GdipIsEqualRegion (NULL, infiniteRegion2, graphics, &isEqual); assertEqualInt (status, InvalidParameter); status = GdipIsEqualRegion (infiniteRegion1, NULL, graphics, &isEqual); assertEqualInt (status, InvalidParameter); status = GdipIsEqualRegion (infiniteRegion1, infiniteRegion2, NULL, &isEqual); assertEqualInt (status, InvalidParameter); status = GdipIsEqualRegion (infiniteRegion1, infiniteRegion2, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteRegion (infiniteRegion1); GdipDeleteRegion (infiniteRegion2); GdipDeleteRegion (infiniteRectRegion1); GdipDeleteRegion (infiniteRectRegion2); GdipDeleteRegion (emptyRegion1); GdipDeleteRegion (emptyRegion2); GdipDeleteRegion (emptyRectRegion1); GdipDeleteRegion (emptyRectRegion2); GdipDeleteRegion (rectRegion1); GdipDeleteRegion (rectRegion2); GdipDeleteRegion (rectRegion3); GdipDeleteRegion (rectRegion4); GdipDeleteRegion (rectRegion5); GdipDeleteRegion (rectRegion6); GdipDeleteRegion (emptyPathRegion1); GdipDeleteRegion (emptyPathRegion2); GdipDeleteRegion (infinitePathRegion1); GdipDeleteRegion (infinitePathRegion2); GdipDeleteRegion (pathRegion1); GdipDeleteRegion (pathRegion2); GdipDeleteRegion (pathRegion3); GdipDeleteRegion (pathRegion4); GdipDeleteRegion (pathRegion5); GdipDeleteRegion (pathRegion6); } static void test_isInfiniteRegion () { GpStatus status; GpRegion *region; BOOL isInfinite; GdipCreateRegion (®ion); // Negative tests. status = GdipIsInfiniteRegion (NULL, graphics, &isInfinite); assertEqualInt (status, InvalidParameter); status = GdipIsInfiniteRegion (region, NULL, &isInfinite); assertEqualInt (status, InvalidParameter); status = GdipIsInfiniteRegion (region, graphics, NULL); assertEqualInt (status, InvalidParameter); } static void test_isVisibleRegionPoint () { GpStatus status; GpPath *path; GpRegion *region; BOOL isVisible; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipIsVisibleRegionPoint (region, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 39, 59, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 39, 60, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 40, 49, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 9, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 10, 19, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 10, 20, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 10, 19, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipIsVisibleRegionPoint (region, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 39, 59, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 39, 60, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 40, 49, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 9, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 10, 19, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 10, 20, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 10, 19, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipIsVisibleRegionPoint (region, 0, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 0, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipIsVisibleRegionPoint (region, 0, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, -4194304, -4194304, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 4194303, 4194303, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, -4194305, -4194304, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, -4194304, -4194305, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 4194303, 4194304, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 4194304, 4194303, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 8388608, 8388608, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPoint (region, 0, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPoint (region, 8388608, 8388608, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Negative tests. status = GdipIsVisibleRegionPoint (NULL, 0, 0, graphics, &isVisible); assertEqualInt (status, InvalidParameter); status = GdipIsVisibleRegionPoint (region, 0, 0, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteRegion (region); } static void test_isVisibleRegionPointI () { GpStatus status; GpPath *path; GpRegion *region; BOOL isVisible; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipIsVisibleRegionPointI (region, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 39, 59, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 39, 60, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 40, 49, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 9, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 10, 19, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 10, 20, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 10, 19, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipIsVisibleRegionPointI (region, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 39, 59, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 39, 60, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 40, 49, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 9, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 10, 19, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipIsVisibleRegionPointI (region, 0, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 0, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipIsVisibleRegionPointI (region, 0, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, -4194304, -4194304, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 4194303, 4194303, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, -4194305, -4194304, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, -4194304, -4194305, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 4194303, 4194304, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 4194304, 4194303, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 8388608, 8388608, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionPointI (region, 0, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionPointI (region, 8388608, 8388608, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Negative tests. status = GdipIsVisibleRegionPointI (NULL, 0, 0, graphics, &isVisible); assertEqualInt (status, InvalidParameter); status = GdipIsVisibleRegionPointI (region, 0, 0, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteRegion (region); } static void test_isVisibleRegionRect () { GpStatus status; GpPath *path; GpRegion *region; BOOL isVisible; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 30, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 39, 59, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 31, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 30, 41, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 39, 60, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 40, 49, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 9, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 19, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 0, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 30, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 39, 59, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 31, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 30, 41, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 39, 60, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 40, 49, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 9, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 19, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 0, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 10, 20, 1, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipIsVisibleRegionRect (region, 0, 0, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 10, 20, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 0, 0, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 8388608, 8388608, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 4194303, 4194303, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 8388609, 8388608, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 8388608, 8388609, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, -4194305, -4194305, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, 4194303, 4194304, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 4194304, 4194303, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 4194303, 4194304, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, 4194304, 4194303, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 0, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 1, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRect (region, -4194304, -4194304, 1, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Negative tests. status = GdipIsVisibleRegionRect (NULL, 0, 0, 0, 0, graphics, &isVisible); assertEqualInt (status, InvalidParameter); status = GdipIsVisibleRegionRect (region, 0, 0, 0, 0, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteRegion (region); } static void test_isVisibleRegionRectI () { GpStatus status; GpPath *path; GpRegion *region; BOOL isVisible; // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 30, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 39, 59, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 31, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 30, 41, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 39, 60, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 40, 49, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 9, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 19, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 0, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 30, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 39, 59, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 31, 40, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 30, 41, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 9, 19, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 39, 60, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 40, 49, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 9, 20, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 19, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 0, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 10, 20, 1, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipIsVisibleRegionRectI (region, 0, 0, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 10, 20, 10, 20, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 0, 0, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 8388608, 8388608, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 4194303, 4194303, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 8388609, 8388608, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 8388608, 8388609, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, -4194305, -4194305, 2, 2, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, 4194303, 4194304, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 4194304, 4194303, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 4194303, 4194304, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, 4194304, 4194303, 1, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 0, 1, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 1, 0, graphics, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 1, 1, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, TRUE); status = GdipIsVisibleRegionRectI (region, -4194304, -4194304, 1, 0, NULL, &isVisible); assertEqualInt (status, Ok); assertEqualInt (isVisible, FALSE); // Negative tests. status = GdipIsVisibleRegionRectI (NULL, 0, 0, 0, 0, graphics, &isVisible); assertEqualInt (status, InvalidParameter); status = GdipIsVisibleRegionRectI (region, 0, 0, 0, 0, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteRegion (region); } static void test_getRegionScansCount () { GpStatus status; GpPath *path; GpRegion *region; GpMatrix *matrix; UINT count; GdipCreateMatrix (&matrix); // Rect region. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); status = GdipGetRegionScansCount (region, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); GdipDeleteRegion (region); // Path region. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); status = GdipGetRegionScansCount (region, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); GdipDeleteRegion (region); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipGetRegionScansCount (region, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipGetRegionScansCount (region, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Negative tests. status = GdipGetRegionScansCount (NULL, &count, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetRegionScansCount (region, NULL, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetRegionScansCount (region, &count, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); GdipDeleteRegion (region); } static void test_getRegionScans () { GpStatus status; GpPath *path; GpRegion *region; GpMatrix *matrix; GpRectF scans[2]; INT count; GdipCreateMatrix (&matrix); // Rect region - non null rects. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, 10); assertEqualFloat (scans[0].Y, 20); assertEqualFloat (scans[0].Width, 30); assertEqualFloat (scans[0].Height, 40); assertEqualInt (count, 1); // Rect region - null rects. count = 0xFF; status = GdipGetRegionScans (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region < 0.5 - non null rects. GpRectF lessThanPointFiveRect = {10.2f, 20.2f, 30.2f, 40.2f}; GdipCreateRegionRect (&lessThanPointFiveRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, 11); assertEqualFloat (scans[0].Y, 21); assertEqualFloat (scans[0].Width, 30); assertEqualFloat (scans[0].Height, 40); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region == 0.5 - non null rects. GpRectF pointFiveRect = {10.5f, 20.5f, 30.5f, 40.5f}; GdipCreateRegionRect (&pointFiveRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, 11); assertEqualFloat (scans[0].Y, 21); assertEqualFloat (scans[0].Width, 30); assertEqualFloat (scans[0].Height, 40); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region > 0.5 - non null rects. GpRectF greaterThanPointFiveRect = {10.6f, 20.6f, 30.6f, 40.6f}; GdipCreateRegionRect (&greaterThanPointFiveRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, 11); assertEqualFloat (scans[0].Y, 21); assertEqualFloat (scans[0].Width, 31); assertEqualFloat (scans[0].Height, 41); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region zero width - non null rects. GpRectF zeroWidthRect = {10, 20, 0, 40}; status = GdipCreateRegionRect (&zeroWidthRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region zero height - non null rects. GpRectF zeroHeightRect = {10, 20, 30, 0}; GdipCreateRegionRect (&zeroHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region zero width and height - non null rects. GpRectF zeroWidthAndHeightRect = {10, 20, 0, 0}; GdipCreateRegionRect (&zeroWidthAndHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region negative width - non null rects. GpRectF negativeWidthRect = {10, 20, -30, 40}; status = GdipCreateRegionRect (&negativeWidthRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region negative height - non null rects. GpRectF negativeHeightRect = {10, 20, 30, -40}; status = GdipCreateRegionRect (&negativeHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region negative width and height - non null rects. GpRectF negativeWidthAndHeightRect = {10, 20, 30, -40}; status = GdipCreateRegionRect (&negativeWidthAndHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Path region - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, 10); assertEqualFloat (scans[0].Y, 20); assertEqualFloat (scans[0].Width, 30); assertEqualFloat (scans[0].Height, 40); assertEqualInt (count, 1); // Path region - null rects. count = 0xFF; status = GdipGetRegionScans (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); GdipDeletePath (path); GdipDeleteRegion (region); // Path region < 0.5 - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10.2f, 20.2f, 30.2f, 40.2f); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); // FIXME: these are incorrect. #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (scans[0].X, 11); assertEqualFloat (scans[0].Y, 21); #endif assertEqualFloat (scans[0].Width, 30); assertEqualFloat (scans[0].Height, 40); assertEqualInt (count, 1); GdipDeletePath (path); GdipDeleteRegion (region); // Path region == 0.5 - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10.5f, 20.5f, 30.5f, 40.5f); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); // FIXME: these are incorrect: https://github.com/mono/libgdiplus/issues/430 #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (scans[0].X, 11); assertEqualFloat (scans[0].Y, WINDOWS_GDIPLUS ? 21 : 20); assertEqualFloat (scans[0].Width, 30); assertEqualFloat (scans[0].Height, 40); assertEqualInt (count, 1); #endif GdipDeletePath (path); GdipDeleteRegion (region); // Path region > 0.5 - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10.6f, 20.6f, 30.6f, 40.6f); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, 11); assertEqualFloat (scans[0].Y, 21); // FIXME: these are incorrect. #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (scans[0].Width, 31); assertEqualFloat (scans[0].Height, 41); #endif assertEqualInt (count, 1); GdipDeletePath (path); GdipDeleteRegion (region); // Empty region - non null rects. GdipCreateRegion (®ion); GdipSetEmpty (region); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Empty region - null rects. count = 0xFF; status = GdipGetRegionScans (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Infinite region - non null rects. GdipCreateRegion (®ion); count = 0xFF; status = GdipGetRegionScans (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualFloat (scans[0].X, -4194304); assertEqualFloat (scans[0].Y, -4194304); assertEqualFloat (scans[0].Width, 8388608); assertEqualFloat (scans[0].Height, 8388608); assertEqualInt (count, 1); // Infinite region - null rects. count = 0xFF; status = GdipGetRegionScans (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Negative tests. status = GdipGetRegionScans (NULL, scans, &count, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetRegionScans (region, scans, NULL, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetRegionScans (region, scans, &count, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); GdipDeleteRegion (region); } static void test_getRegionScansI () { GpStatus status; GpPath *path; GpRegion *region; GpMatrix *matrix; GpRect scans[2]; INT count; GdipCreateMatrix (&matrix); // Rect region - non null rects. GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (scans[0].X, 10); assertEqualInt (scans[0].Y, 20); assertEqualInt (scans[0].Width, 30); assertEqualInt (scans[0].Height, 40); assertEqualInt (count, 1); // Rect region - null rects. count = 0xFF; status = GdipGetRegionScansI (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region < 0.5 - non null rects. GpRectF lessThanPointFiveRect = {10.2f, 20.2f, 30.2f, 40.2f}; GdipCreateRegionRect (&lessThanPointFiveRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (scans[0].X, 11); assertEqualInt (scans[0].Y, 21); assertEqualInt (scans[0].Width, 30); assertEqualInt (scans[0].Height, 40); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region == 0.5 - non null rects. GpRectF pointFiveRect = {10.5f, 20.5f, 30.5f, 40.5f}; GdipCreateRegionRect (&pointFiveRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (scans[0].X, 11); assertEqualInt (scans[0].Y, 21); assertEqualInt (scans[0].Width, 30); assertEqualInt (scans[0].Height, 40); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region > 0.5 - non null rects. GpRectF greaterThanPointFiveRect = {10.6f, 20.6f, 30.6f, 40.6f}; GdipCreateRegionRect (&greaterThanPointFiveRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (scans[0].X, 11); assertEqualInt (scans[0].Y, 21); assertEqualInt (scans[0].Width, 31); assertEqualInt (scans[0].Height, 41); assertEqualInt (count, 1); GdipDeleteRegion (region); // Rect region zero width - non null rects. GpRectF zeroWidthRect = {10, 20, 0, 40}; status = GdipCreateRegionRect (&zeroWidthRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region zero height - non null rects. GpRectF zeroHeightRect = {10, 20, 30, 0}; GdipCreateRegionRect (&zeroHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region zero width and height - non null rects. GpRectF zeroWidthAndHeightRect = {10, 20, 0, 0}; GdipCreateRegionRect (&zeroWidthAndHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region negative width - non null rects. GpRectF negativeWidthRect = {10, 20, -30, 40}; status = GdipCreateRegionRect (&negativeWidthRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region negative height - non null rects. GpRectF negativeHeightRect = {10, 20, 30, -40}; status = GdipCreateRegionRect (&negativeHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Rect region negative width and height - non null rects. GpRectF negativeWidthAndHeightRect = {10, 20, 30, -40}; status = GdipCreateRegionRect (&negativeWidthAndHeightRect, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Path region - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (scans[0].X, 10); assertEqualInt (scans[0].Y, 20); assertEqualInt (scans[0].Width, 30); assertEqualInt (scans[0].Height, 40); assertEqualInt (count, 1); // Path region - null rects. count = 0xFF; status = GdipGetRegionScansI (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); GdipDeletePath (path); GdipDeleteRegion (region); // Path region < 0.5 - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10.2f, 20.2f, 30.2f, 40.2f); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); // FIXME: these are incorrect. #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (scans[0].X, 11); assertEqualInt (scans[0].Y, 21); #endif assertEqualInt (scans[0].Width, 30); assertEqualInt (scans[0].Height, 40); assertEqualInt (count, 1); GdipDeletePath (path); GdipDeleteRegion (region); // Path region == 0.5 - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10.5f, 20.5f, 30.5f, 40.5f); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); // FIXME: these are incorrect: https://github.com/mono/libgdiplus/issues/430 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (scans[0].X, 11); assertEqualInt (scans[0].Y, 21); assertEqualInt (scans[0].Width, 30); assertEqualInt (scans[0].Height, 40); assertEqualInt (count, 1); #endif GdipDeletePath (path); GdipDeleteRegion (region); // Path region > 0.5 - non null rects. GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10.6f, 20.6f, 30.6f, 40.6f); GdipCreateRegionPath (path, ®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); // FIXME: these are incorrect: https://github.com/mono/libgdiplus/issues/430 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (scans[0].X, 11); assertEqualInt (scans[0].Y, 21); assertEqualInt (scans[0].Width, 31); assertEqualInt (scans[0].Height, 41); assertEqualInt (count, 1); #endif GdipDeletePath (path); GdipDeleteRegion (region); // Empty region - non null rects. GdipCreateRegion (®ion); GdipSetEmpty (region); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Empty region - null rects. count = 0xFF; status = GdipGetRegionScansI (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 0); GdipDeleteRegion (region); // Infinite region - non null rects. GdipCreateRegion (®ion); count = 0xFF; status = GdipGetRegionScansI (region, scans, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (scans[0].X, -4194304); assertEqualInt (scans[0].Y, -4194304); assertEqualInt (scans[0].Width, 8388608); assertEqualInt (scans[0].Height, 8388608); assertEqualInt (count, 1); // Infinite region - null rects. count = 0xFF; status = GdipGetRegionScansI (region, NULL, &count, matrix); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Negative tests. status = GdipGetRegionScansI (NULL, scans, &count, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetRegionScansI (region, scans, NULL, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetRegionScansI (region, scans, &count, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (matrix); GdipDeleteRegion (region); } static void verifyCombineRegionWithRegionImpl (GpRegion *region, GpRegion *region2, CombineMode mode, float x, float y, float width, float height, BOOL isEmpty, BOOL isInfinite, RectF * scans, INT scansCount, const char *file, const char *function, int line) { GpStatus status = GdipCombineRegionRegion (region, region2, mode); assertEqualIntImpl (status, Ok, NULL, file, function, line); verifyRegionImpl (region, x, y, width, height, isEmpty, isInfinite, file, function, line); verifyRegionScansImpl (region, scans, scansCount, file, function, line); } #define verifyCombineRegionWithRegion(region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ verifyCombineRegionWithRegionImpl (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount, __FILE__, __func__, __LINE__) static void verifyCombineRegionWithRectImpl (GpRegion *region, RectF *rect, CombineMode mode, float x, float y, float width, float height, BOOL isEmpty, BOOL isInfinite, RectF *scans, INT scansCount, const char *file, const char *function, int line) { GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (rect, ®ion2); verifyCombineRegionWithRegionImpl (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount, file, function, line); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ GdipCombineRegionRect (clone, rect, mode); verifyRegionImpl (clone, x, y, width, height, isEmpty, isInfinite, file, function, line); verifyRegionScansImpl (clone, scans, scansCount, file, function, line); GdipDeleteRegion (clone); } #define verifyCombineRegionWithRect(region, rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ verifyCombineRegionWithRectImpl (region, rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount, __FILE__, __func__, __LINE__) static void verifyCombineRegionWithPathImpl (GpRegion *region, GpPath *path, CombineMode mode, float x, float y, float width, float height, BOOL isEmpty, BOOL isInfinite, RectF *scans, INT scansCount, const char *file, const char *function, int line) { GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a path region. */ GpRegion *region2; GdipCreateRegionPath (path, ®ion2); verifyCombineRegionWithRegionImpl (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount, file, function, line); GdipDeleteRegion (region2); /* Second, test combining with an actual path. */ GdipCombineRegionPath (clone, path, mode); verifyRegionImpl (clone, x, y, width, height, isEmpty, isInfinite, file, function, line); verifyRegionScansImpl (clone, scans, scansCount, file, function, line); GdipDeleteRegion (clone); } #define verifyCombineRegionWithPath(region, path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ verifyCombineRegionWithPathImpl (region, path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount, __FILE__, __func__, __LINE__) #define verifyCombineInfiniteWithRegion(region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegion (®ion); \ \ verifyCombineRegionWithRegion (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineInfiniteWithRect(rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegion (®ion); \ \ verifyCombineRegionWithRect (region, rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineInfiniteWithPath(path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegion (®ion); \ \ verifyCombineRegionWithPath (region, path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineEmptyWithRegion(region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegion (®ion); \ GdipSetEmpty (region); \ \ verifyCombineRegionWithRegion (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineEmptyWithRect(rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegion (®ion); \ GdipSetEmpty (region); \ \ verifyCombineRegionWithRect (region, rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineEmptyWithPath(path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegion (®ion); \ GdipSetEmpty (region); \ \ verifyCombineRegionWithPath (region, path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineRectWithRegion(rect, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionRect (rect, ®ion); \ \ verifyCombineRegionWithRegion (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineRectWithRect(rect, rect2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionRect (rect, ®ion); \ \ verifyCombineRegionWithRect (region, rect2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineRects(rects, rectsCount, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionRect (rects, ®ion); \ int _c = rectsCount / sizeof (GpRectF); \ \ for (int _i = 1; _i < _c - 1; _i++) \ GdipCombineRegionRect (region, &rects[_i], mode); \ verifyCombineRegionWithRect (region, &rects[_c - 1], mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombineRectWithPath(rect, path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionRect (rect, ®ion); \ \ verifyCombineRegionWithPath (region, path, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombinePathWithRegion(path, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionPath (path, ®ion); \ \ verifyCombineRegionWithRegion (region, region2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombinePathWithRect(path, rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionPath (path, ®ion); \ \ verifyCombineRegionWithRect (region, rect, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ #define verifyCombinePathWithPath(path, path2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount) \ { \ GpRegion *region; \ GdipCreateRegionPath (path, ®ion); \ \ verifyCombineRegionWithPath (region, path2, mode, x, y, width, height, isEmpty, isInfinite, scans, scansCount); \ GdipDeleteRegion (region); \ } \ static GpPath *createPathFromRect(RectF *rect) { GpPath *path; GdipCreatePath (FillModeAlternate, &path); GdipAddPathRectangle (path, rect->X, rect->Y, rect->Width, rect->Height); return path; } static void test_combineReplace () { GpRegion *infiniteRegion; GpRegion *emptyRegion; GpRegion *rectRegion; GpRegion *pathRegion; GdipCreateRegion (&infiniteRegion); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); RectF rect1 = {10, 20, 30, 40}; RectF rect2 = {20, 30, 40, 50}; GdipCreateRegionRect (&rect1, &rectRegion); GpPath *path1 = createPathFromRect (&rect1); GpPath *path2 = createPathFromRect (&rect2); GdipCreateRegionPath (path1, &pathRegion); // Infinite + Infinite = Infinite. verifyCombineInfiniteWithRegion (infiniteRegion, CombineModeReplace, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Empty = Empty. verifyCombineInfiniteWithRegion (emptyRegion, CombineModeReplace, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Rect = Rect. verifyCombineInfiniteWithRect (&rect1, CombineModeReplace, 10, 20, 30, 40, FALSE, FALSE, &rect1, sizeof (rect1)); // Infinite + Path = Path. verifyCombineInfiniteWithPath (path1, CombineModeReplace, 10, 20, 30, 40, FALSE, FALSE, &rect1, sizeof (rect1)); // Empty + Infinite = Infinite. verifyCombineEmptyWithRegion (infiniteRegion, CombineModeReplace, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty = Empty. verifyCombineEmptyWithRegion (emptyRegion, CombineModeReplace, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Rect = Rect. verifyCombineEmptyWithRect (&rect1, CombineModeReplace, 10, 20, 30, 40, FALSE, FALSE, &rect1, sizeof (rect1)); // Empty + Path = Path. verifyCombineEmptyWithPath (path1, CombineModeReplace, 10, 20, 30, 40, FALSE, FALSE, &rect1, sizeof (rect1)); // Rect + Infinite = Infinite. verifyCombineRectWithRegion (&rect1, infiniteRegion, CombineModeReplace, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Rect + Empty = Empty. verifyCombineRectWithRegion (&rect1, emptyRegion, CombineModeReplace, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Other Rect = Other Rect. verifyCombineRectWithRect (&rect1, &rect2, CombineModeReplace, 20, 30, 40, 50, FALSE, FALSE, &rect2, sizeof (rect2)); // Rect + Path = Path. verifyCombineRectWithPath (&rect1, path2, CombineModeReplace, 20, 30, 40, 50, FALSE, FALSE, &rect2, sizeof (rect2)); // Path + Infinite = Infinite. verifyCombinePathWithRegion (path1, infiniteRegion, CombineModeReplace, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Path + Empty = Empty. verifyCombinePathWithRegion (path1, emptyRegion, CombineModeReplace, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Rect = Rect. verifyCombinePathWithRect (path1, &rect2, CombineModeReplace, 20, 30, 40, 50, FALSE, FALSE, &rect2, sizeof (rect2)); // Path + Other Path = Other Path. verifyCombinePathWithPath (path1, path2, CombineModeReplace, 20, 30, 40, 50, FALSE, FALSE, &rect2, sizeof (rect2)); GdipDeleteRegion (infiniteRegion); GdipDeleteRegion (emptyRegion); GdipDeleteRegion (rectRegion); GdipDeleteRegion (pathRegion); GdipDeletePath (path1); GdipDeletePath (path2); } static void test_combineIntersect () { GpRegion *infiniteRegion; GpRegion *emptyRegion; GpRegion *rectRegion; GpRegion *pathRegion; GdipCreateRegion (&infiniteRegion); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); RectF rect = {10, 20, 30, 40}; RectF superRect = {0, 10, 50, 60}; RectF subRect = {15, 25, 20, 30}; RectF intersectLeftRect = {0, 20, 30, 40}; RectF intersectTopRect = {10, 10, 30, 40}; RectF intersectRightRect = {20, 20, 30, 40}; RectF intersectBottomRect = {10, 30, 30, 40}; RectF intersectTopLeftRect = {0, 10, 30, 40}; RectF intersectTopRightRect = {20, 10, 30, 40}; RectF intersectBottomRightRect = {20, 30, 30, 40}; RectF intersectBottomLeftRect = {0, 30, 30, 40}; RectF touchingLeftRect = {-20, 20, 30, 40}; RectF touchingTopRect = {10, -20, 30, 40}; RectF touchingRightRect = {40, 20, 30, 40}; RectF touchingBottomRect = {10, 60, 30, 40}; RectF touchingTopLeftRect = {-20, -20, 30, 40}; RectF touchingTopRightRect = {40, -20, 30, 40}; RectF touchingBottomRightRect = {40, 60, 30, 40}; RectF touchingBottomLeftRect = {-20, 60, 30, 40}; RectF noIntersectLeftRect = {-21, 20, 30, 40}; RectF noIntersectTopRect = {10, -21, 30, 40}; RectF noIntersectRightRect = {41, 20, 30, 40}; RectF noIntersectBottomRect = {10, 61, 30, 40}; RectF noIntersectTopLeftRect = {-21, -21, 30, 40}; RectF noIntersectTopRightRect = {41, -21, 30, 40}; RectF noIntersectBottomRightRect = {41, 61, 30, 40}; RectF noIntersectBottomLeftRect = {-21, 61, 30, 40}; RectF emptyRect = {0, 0, 0, 0}; RectF infiniteRect = {-4194304, -4194304, 8388608, 8388608}; RectF negativeRect = {20, 30, -10, -10}; GdipCreateRegionRect (&rect, &rectRegion); GpPath *path = createPathFromRect (&rect); GpPath *superPath = createPathFromRect (&superRect); GpPath *subPath = createPathFromRect (&subRect); GpPath *intersectLeftPath = createPathFromRect (&intersectLeftRect); GpPath *intersectTopPath = createPathFromRect (&intersectTopRect); GpPath *intersectRightPath = createPathFromRect (&intersectRightRect); GpPath *intersectBottomPath = createPathFromRect (&intersectBottomRect); GpPath *intersectTopLeftPath = createPathFromRect (&intersectTopLeftRect); GpPath *intersectTopRightPath = createPathFromRect (&intersectTopRightRect); GpPath *intersectBottomRightPath = createPathFromRect (&intersectBottomRightRect); GpPath *intersectBottomLeftPath = createPathFromRect (&intersectBottomLeftRect); GpPath *touchingLeftPath = createPathFromRect (&touchingLeftRect); GpPath *touchingTopPath = createPathFromRect (&touchingTopRect); GpPath *touchingRightPath = createPathFromRect (&touchingRightRect); GpPath *touchingBottomPath = createPathFromRect (&touchingBottomRect); GpPath *touchingTopLeftPath = createPathFromRect (&touchingTopLeftRect); GpPath *touchingTopRightPath = createPathFromRect (&touchingTopRightRect); GpPath *touchingBottomRightPath = createPathFromRect (&touchingBottomRightRect); GpPath *touchingBottomLeftPath = createPathFromRect (&touchingBottomLeftRect); GpPath *noIntersectLeftPath = createPathFromRect (&noIntersectLeftRect); GpPath *noIntersectTopPath = createPathFromRect (&noIntersectTopRect); GpPath *noIntersectRightPath = createPathFromRect (&noIntersectRightRect); GpPath *noIntersectBottomPath = createPathFromRect (&noIntersectBottomRect); GpPath *noIntersectTopLeftPath = createPathFromRect (&noIntersectTopLeftRect); GpPath *noIntersectTopRightPath = createPathFromRect (&noIntersectTopRightRect); GpPath *noIntersectBottomRightPath = createPathFromRect (&noIntersectBottomRightRect); GpPath *noIntersectBottomLeftPath = createPathFromRect (&noIntersectBottomLeftRect); GpPath *emptyPath = createPathFromRect (&emptyRect); GpPath *infinitePath = createPathFromRect (&infiniteRect); GpPath *negativePath = createPathFromRect (&negativeRect); GdipCreateRegionPath (path, &pathRegion); // Infinite + Infinite = Infinite. verifyCombineInfiniteWithRegion (infiniteRegion, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Empty = Empty. verifyCombineInfiniteWithRegion (emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Infinite Rect = Infinite. verifyCombineInfiniteWithRect (&infiniteRect, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Empty Rect = Empty. verifyCombineInfiniteWithRect (&emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Rect = Rect. verifyCombineInfiniteWithRect (&rect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Infinite + Negative Rect = Rect. { GpRegion *region; GdipCreateRegion (®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeIntersect, 20, 30, -10, -10, TRUE, FALSE, emptyScans, 0); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF negativeRectScan = {10, 20, 10, 10}; GdipCombineRegionRect (clone, &negativeRect, CombineModeIntersect); verifyRegion (clone, 10, 20, 10, 10, FALSE, FALSE); verifyRegionScans (clone, &negativeRectScan, sizeof (negativeRectScan)); GdipDeleteRegion (clone); } // Infinite + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/411 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineInfiniteWithPath (infinitePath, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Infinite + Empty Path = Empty. verifyCombineInfiniteWithPath (emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Path = Path. verifyCombineInfiniteWithPath (path, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty + Infinite = Empty. verifyCombineEmptyWithRegion (infiniteRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Empty = Empty. verifyCombineEmptyWithRegion (emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Rect = Empty. verifyCombineEmptyWithRect (&infiniteRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Empty Rect = Empty. verifyCombineEmptyWithRect (&emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Rect = Rect. verifyCombineEmptyWithRect (&rect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Rect = Empty. verifyCombineEmptyWithPath (infinitePath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Empty Rect = Empty. verifyCombineEmptyWithPath (emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Path = Path. verifyCombineEmptyWithPath (path, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Infinite = Infinite. verifyCombineRectWithRegion (&infiniteRect, infiniteRegion, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Empty = Empty. verifyCombineRectWithRegion (&infiniteRect, emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Infinite Rect = Infinite. verifyCombineRectWithRect (&infiniteRect, &infiniteRect, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Empty Rect = Empty. verifyCombineRectWithRect (&infiniteRect, &emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Rect = Rect. verifyCombineRectWithRect (&infiniteRect, &rect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Infinite Rect + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/411 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&infiniteRect, infinitePath, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Infinite Rect + Empty Path = Empty. verifyCombineRectWithPath (&infiniteRect, emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Path = Path. verifyCombineRectWithPath (&infiniteRect, path, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Rect + Infinite = Empty. verifyCombineRectWithRegion (&emptyRect, infiniteRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Empty = Empty. verifyCombineRectWithRegion (&emptyRect, emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Rect = Empty. verifyCombineRectWithRect (&emptyRect, &infiniteRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Empty Rect = Empty. verifyCombineRectWithRect (&emptyRect, &emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Rect = Empty. verifyCombineRectWithRect (&emptyRect, &rect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Path = Empty. verifyCombineRectWithPath (&emptyRect, infinitePath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Empty Path = Empty. verifyCombineRectWithPath (&emptyRect, emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Path = Empty. verifyCombineRectWithPath (&emptyRect, path, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Infinite = Rect. verifyCombineRectWithRegion (&rect, infiniteRegion, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Empty = Empty. verifyCombineRectWithRegion (&rect, emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Infinite Rect = Rect. verifyCombineRectWithRect (&rect, &infiniteRect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Empty Rect = Empty. verifyCombineRectWithRect (&rect, &emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Negative Rect = Empty. { GpRegion *region; GdipCreateRegionRect (&rect, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF negativeRectScan = {10, 20, 10, 10}; GdipCombineRegionRect (clone, &negativeRect, CombineModeIntersect); verifyRegion (clone, 10, 20, 10, 10, FALSE, FALSE); verifyRegionScans (clone, &negativeRectScan, sizeof (negativeRectScan)); GdipDeleteRegion (clone); } // Rect + Equal Rect = Equal Rect. verifyCombineRectWithRect (&rect, &rect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Super Rect = Rect. verifyCombineRectWithRect (&rect, &superRect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Sub Rect = Sub Rect. verifyCombineRectWithRect (&rect, &subRect, CombineModeIntersect, 15, 25, 20, 30, FALSE, FALSE, &subRect, sizeof (subRect)); // Rect + Intersect Left = Calculation. RectF intersectLeftScan = {10, 20, 20, 40}; verifyCombineRectWithRect (&rect, &intersectLeftRect, CombineModeIntersect, 10, 20, 20, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Calculation. RectF intersectTopScan = {10, 20, 30, 30}; verifyCombineRectWithRect (&rect, &intersectTopRect, CombineModeIntersect, 10, 20, 30, 30, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Calculation. RectF intersectRightScan = {20, 20, 20, 40}; verifyCombineRectWithRect (&rect, &intersectRightRect, CombineModeIntersect, 20, 20, 20, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Calculation. RectF intersectBottomScan = {10, 30, 30, 30}; verifyCombineRectWithRect (&rect, &intersectBottomRect, CombineModeIntersect, 10, 30, 30, 30, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Calculation. RectF intersectTopLeftScan = {10, 20, 20, 30}; verifyCombineRectWithRect (&rect, &intersectTopLeftRect, CombineModeIntersect, 10, 20, 20, 30, FALSE, FALSE, &intersectTopLeftScan, sizeof (intersectTopLeftScan)); // Rect + Intersect Top Right = Calculation. RectF intersectTopRightScan = {20, 20, 20, 30}; verifyCombineRectWithRect (&rect, &intersectTopRightRect, CombineModeIntersect, 20, 20, 20, 30, FALSE, FALSE, &intersectTopRightScan, sizeof (intersectTopRightScan)); // Rect + Intersect Bottom Right = Calculation. RectF intersectBottomRightScan = {20, 30, 20, 30}; verifyCombineRectWithRect (&rect, &intersectBottomRightRect, CombineModeIntersect, 20, 30, 20, 30, FALSE, FALSE, &intersectBottomRightScan, sizeof (intersectBottomRightScan)); // Rect + Intersect Bottom Left = Calculation. RectF intersectBottomLeftScan = {10, 30, 20, 30}; verifyCombineRectWithRect (&rect, &intersectBottomLeftRect, CombineModeIntersect, 10, 30, 20, 30, FALSE, FALSE, &intersectBottomLeftScan, sizeof (intersectBottomLeftScan)); // Rect + Touching Left = Empty. verifyCombineRectWithRect (&rect, &touchingLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Top = Empty. verifyCombineRectWithRect (&rect, &touchingTopRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Right = Empty. verifyCombineRectWithRect (&rect, &touchingRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Bottom = Empty. verifyCombineRectWithRect (&rect, &touchingBottomRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Top Left = Empty. verifyCombineRectWithRect (&rect, &touchingTopLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Top Right = Empty. verifyCombineRectWithRect (&rect, &touchingTopRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Bottom Right = Empty. verifyCombineRectWithRect (&rect, &touchingBottomRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Bottom Left = Empty. verifyCombineRectWithRect (&rect, &touchingBottomLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Left = Empty. verifyCombineRectWithRect (&rect, &noIntersectLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Top = Empty. verifyCombineRectWithRect (&rect, &noIntersectTopRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Right = Empty. verifyCombineRectWithRect (&rect, &noIntersectRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Bottom = Empty. verifyCombineRectWithRect (&rect, &noIntersectBottomRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Top Left = Empty. verifyCombineRectWithRect (&rect, &noIntersectTopLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Top Right = Empty. verifyCombineRectWithRect (&rect, &noIntersectTopRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Bottom Right = Empty. verifyCombineRectWithRect (&rect, &noIntersectBottomRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Bottom Left = Empty. verifyCombineRectWithRect (&rect, &noIntersectBottomLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Infinite Path = Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, infinitePath, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); #endif // Rect + Empty Path = Empty. verifyCombineRectWithPath (&rect, emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Negative Path = Empty. verifyCombineRectWithPath (&rect, negativePath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Equal Path = Equal Path. verifyCombineRectWithPath (&rect, path, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Super Path = Path. verifyCombineRectWithPath (&rect, superPath, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Sub Path = Sub Path. verifyCombineRectWithPath (&rect, subPath, CombineModeIntersect, 15, 25, 20, 30, FALSE, FALSE, &subRect, sizeof (subRect)); // Rect + Intersect Left = Calculation. verifyCombineRectWithPath (&rect, intersectLeftPath, CombineModeIntersect, 10, 20, 20, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Calculation. verifyCombineRectWithPath (&rect, intersectTopPath, CombineModeIntersect, 10, 20, 30, 30, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Calculation. verifyCombineRectWithPath (&rect, intersectRightPath, CombineModeIntersect, 20, 20, 20, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Calculation. verifyCombineRectWithPath (&rect, intersectBottomPath, CombineModeIntersect, 10, 30, 30, 30, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Calculation. verifyCombineRectWithPath (&rect, intersectTopLeftPath, CombineModeIntersect, 10, 20, 20, 30, FALSE, FALSE, &intersectTopLeftScan, sizeof (intersectTopLeftScan)); // Rect + Intersect Top Right = Calculation. verifyCombineRectWithPath (&rect, intersectTopRightPath, CombineModeIntersect, 20, 20, 20, 30, FALSE, FALSE, &intersectTopRightScan, sizeof (intersectTopRightScan)); // Rect + Intersect Bottom Right = Calculation. verifyCombineRectWithPath (&rect, intersectBottomRightPath, CombineModeIntersect, 20, 30, 20, 30, FALSE, FALSE, &intersectBottomRightScan, sizeof (intersectBottomRightScan)); // Rect + Intersect Bottom Left = Calculation. verifyCombineRectWithPath (&rect, intersectBottomLeftPath, CombineModeIntersect, 10, 30, 20, 30, FALSE, FALSE, &intersectBottomLeftScan, sizeof (intersectBottomLeftScan)); // Rect + Touching Left = Empty. verifyCombineRectWithPath (&rect, touchingLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Top = Empty. verifyCombineRectWithPath (&rect, touchingTopPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Right = Empty. verifyCombineRectWithPath (&rect, touchingRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Bottom = Empty. verifyCombineRectWithPath (&rect, touchingBottomPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Top Left = Empty. verifyCombineRectWithPath (&rect, touchingTopLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Top Right = Empty. verifyCombineRectWithPath (&rect, touchingTopRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Bottom Right = Empty. verifyCombineRectWithPath (&rect, touchingBottomRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Touching Bottom Left = Empty. verifyCombineRectWithPath (&rect, touchingBottomLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Left = Empty. verifyCombineRectWithPath (&rect, noIntersectLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Top = Empty. verifyCombineRectWithPath (&rect, noIntersectTopPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Right = Empty. verifyCombineRectWithPath (&rect, noIntersectRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Bottom = Empty. verifyCombineRectWithPath (&rect, noIntersectBottomPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Top Left = Empty. verifyCombineRectWithPath (&rect, noIntersectTopLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Top Right = Empty. verifyCombineRectWithPath (&rect, noIntersectTopRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Bottom Right = Empty. verifyCombineRectWithPath (&rect, noIntersectBottomRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + No Intersect Bottom Left = Empty. verifyCombineRectWithPath (&rect, noIntersectBottomLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Infinite = Infinite. verifyCombinePathWithRegion (infinitePath, infiniteRegion, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Empty = Empty. verifyCombinePathWithRegion (infinitePath, emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Infinite Rect = Infinite. verifyCombinePathWithRect (infinitePath, &infiniteRect, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Empty Rect = Empty. verifyCombinePathWithRect (infinitePath, &emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Rect = Rect. verifyCombinePathWithRect (infinitePath, &rect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Infinite Path + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/411 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (infinitePath, infinitePath, CombineModeIntersect, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Infinite Path + Empty Path = Empty. verifyCombinePathWithPath (infinitePath, emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Path = Path. verifyCombinePathWithPath (infinitePath, path, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Path + Infinite = Empty. verifyCombinePathWithRegion (emptyPath, infiniteRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Empty = Empty. verifyCombinePathWithRegion (emptyPath, emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Rect = Empty. verifyCombinePathWithRect (emptyPath, &infiniteRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Empty Rect = Empty. verifyCombinePathWithRect (emptyPath, &emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Rect = Empty. verifyCombinePathWithRect (emptyPath, &rect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Path = Empty. verifyCombinePathWithPath (emptyPath, infinitePath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Empty Path = Empty. verifyCombinePathWithPath (emptyPath, emptyPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Path = Empty. verifyCombinePathWithPath (emptyPath, path, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Infinite = Path. verifyCombinePathWithRegion (path, infiniteRegion, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Empty = Empty. verifyCombinePathWithRegion (path, emptyRegion, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Infinite Rect = Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338. #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &infiniteRect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); #endif // Path + Empty Rect = Empty. verifyCombinePathWithRect (path, &emptyRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Negative Rect = Empty. { GpRegion *region; GdipCreateRegionPath (path, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF negativeRectScan = {10, 20, 10, 10}; GdipCombineRegionRect (clone, &negativeRect, CombineModeIntersect); verifyRegion (clone, 10, 20, 10, 10, FALSE, FALSE); verifyRegionScans (clone, &negativeRectScan, sizeof (negativeRectScan)); GdipDeleteRegion (clone); } // Path + Equal Rect = Equal Rect. verifyCombinePathWithRect (path, &rect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Super Rect = Rect. verifyCombinePathWithRect (path, &superRect, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Sub Rect = Sub Rect. verifyCombinePathWithRect (path, &subRect, CombineModeIntersect, 15, 25, 20, 30, FALSE, FALSE, &subRect, sizeof (subRect)); // Path + Intersect Left = Calculation. verifyCombinePathWithRect (path, &intersectLeftRect, CombineModeIntersect, 10, 20, 20, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Calculation. verifyCombinePathWithRect (path, &intersectTopRect, CombineModeIntersect, 10, 20, 30, 30, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Calculation. verifyCombinePathWithRect (path, &intersectRightRect, CombineModeIntersect, 20, 20, 20, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Calculation. verifyCombinePathWithRect (path, &intersectBottomRect, CombineModeIntersect, 10, 30, 30, 30, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Calculation. verifyCombinePathWithRect (path, &intersectTopLeftRect, CombineModeIntersect, 10, 20, 20, 30, FALSE, FALSE, &intersectTopLeftScan, sizeof (intersectTopLeftScan)); // Path + Intersect Top Right = Calculation. verifyCombinePathWithRect (path, &intersectTopRightRect, CombineModeIntersect, 20, 20, 20, 30, FALSE, FALSE, &intersectTopRightScan, sizeof (intersectTopRightScan)); // Path + Intersect Bottom Right = Calculation. verifyCombinePathWithRect (path, &intersectBottomRightRect, CombineModeIntersect, 20, 30, 20, 30, FALSE, FALSE, &intersectBottomRightScan, sizeof (intersectBottomRightScan)); // Path + Intersect Bottom Left = Calculation. verifyCombinePathWithRect (path, &intersectBottomLeftRect, CombineModeIntersect, 10, 30, 20, 30, FALSE, FALSE, &intersectBottomLeftScan, sizeof (intersectBottomLeftScan)); // Path + Touching Left = Empty. verifyCombinePathWithRect (path, &touchingLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Top = Empty. verifyCombinePathWithRect (path, &touchingTopRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Right = Empty. verifyCombinePathWithRect (path, &touchingRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Bottom = Empty. verifyCombinePathWithRect (path, &touchingBottomRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Top Left = Empty. verifyCombinePathWithRect (path, &touchingTopLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Top Right = Empty. verifyCombinePathWithRect (path, &touchingTopRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Bottom Right = Empty. verifyCombinePathWithRect (path, &touchingBottomRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Bottom Left = Empty. verifyCombinePathWithRect (path, &touchingBottomLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Left = Empty. verifyCombinePathWithRect (path, &noIntersectLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Top = Empty. verifyCombinePathWithRect (path, &noIntersectTopRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Right = Empty. verifyCombinePathWithRect (path, &noIntersectRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Bottom = Empty. verifyCombinePathWithRect (path, &noIntersectBottomRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Top Left = Empty. verifyCombinePathWithRect (path, &noIntersectTopLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Top Right = Empty. verifyCombinePathWithRect (path, &noIntersectTopRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Bottom Right = Empty. verifyCombinePathWithRect (path, &noIntersectBottomRightRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Bottom Left = Empty. verifyCombinePathWithRect (path, &noIntersectBottomLeftRect, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Equal Path = Equal Path. verifyCombinePathWithPath (path, path, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Super Path = Path. verifyCombinePathWithPath (path, superPath, CombineModeIntersect, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Sub Path = Sub Path. verifyCombinePathWithPath (path, subPath, CombineModeIntersect, 15, 25, 20, 30, FALSE, FALSE, &subRect, sizeof (subRect)); // Path + Intersect Left = Calculation. verifyCombinePathWithPath (path, intersectLeftPath, CombineModeIntersect, 10, 20, 20, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Calculation. verifyCombinePathWithPath (path, intersectTopPath, CombineModeIntersect, 10, 20, 30, 30, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Calculation. verifyCombinePathWithPath (path, intersectRightPath, CombineModeIntersect, 20, 20, 20, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Calculation. verifyCombinePathWithPath (path, intersectBottomPath, CombineModeIntersect, 10, 30, 30, 30, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Calculation. verifyCombinePathWithPath (path, intersectTopLeftPath, CombineModeIntersect, 10, 20, 20, 30, FALSE, FALSE, &intersectTopLeftScan, sizeof (intersectTopLeftScan)); // Path + Intersect Top Right = Calculation. verifyCombinePathWithPath (path, intersectTopRightPath, CombineModeIntersect, 20, 20, 20, 30, FALSE, FALSE, &intersectTopRightScan, sizeof (intersectTopRightScan)); // Path + Intersect Bottom Right = Calculation. verifyCombinePathWithPath (path, intersectBottomRightPath, CombineModeIntersect, 20, 30, 20, 30, FALSE, FALSE, &intersectBottomRightScan, sizeof (intersectBottomRightScan)); // Path + Intersect Bottom Left = Calculation. verifyCombinePathWithPath (path, intersectBottomLeftPath, CombineModeIntersect, 10, 30, 20, 30, FALSE, FALSE, &intersectBottomLeftScan, sizeof (intersectBottomLeftScan)); // Path + Touching Left = Empty. verifyCombinePathWithPath (path, touchingLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Top = Empty. verifyCombinePathWithPath (path, touchingTopPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Right = Empty. verifyCombinePathWithPath (path, touchingRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Bottom = Empty. verifyCombinePathWithPath (path, touchingBottomPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Top Left = Empty. verifyCombinePathWithPath (path, touchingTopLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Top Right = Empty. verifyCombinePathWithPath (path, touchingTopRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Bottom Right = Empty. verifyCombinePathWithPath (path, touchingBottomRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Touching Bottom Left = Empty. verifyCombinePathWithPath (path, touchingBottomLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Left = Empty. verifyCombinePathWithPath (path, noIntersectLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Top = Empty. verifyCombinePathWithPath (path, noIntersectTopPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Right = Empty. verifyCombinePathWithPath (path, noIntersectRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Bottom = Empty. verifyCombinePathWithPath (path, noIntersectBottomPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Top Left = Empty. verifyCombinePathWithPath (path, noIntersectTopLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Top Right = Empty. verifyCombinePathWithPath (path, noIntersectTopRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Bottom Right = Empty. verifyCombinePathWithPath (path, noIntersectBottomRightPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + No Intersect Bottom Left = Empty. verifyCombinePathWithPath (path, noIntersectBottomLeftPath, CombineModeIntersect, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); GdipDeleteRegion (infiniteRegion); GdipDeleteRegion (emptyRegion); GdipDeleteRegion (rectRegion); GdipDeleteRegion (pathRegion); GdipDeletePath (path); GdipDeletePath (superPath); GdipDeletePath (subPath); GdipDeletePath (intersectLeftPath); GdipDeletePath (intersectTopPath); GdipDeletePath (intersectRightPath); GdipDeletePath (intersectBottomPath); GdipDeletePath (intersectTopLeftPath); GdipDeletePath (intersectTopRightPath); GdipDeletePath (intersectBottomRightPath); GdipDeletePath (intersectBottomLeftPath); GdipDeletePath (touchingLeftPath); GdipDeletePath (touchingTopPath); GdipDeletePath (touchingRightPath); GdipDeletePath (touchingBottomPath); GdipDeletePath (touchingTopLeftPath); GdipDeletePath (touchingTopRightPath); GdipDeletePath (touchingBottomRightPath); GdipDeletePath (touchingBottomLeftPath); GdipDeletePath (noIntersectLeftPath); GdipDeletePath (noIntersectTopPath); GdipDeletePath (noIntersectRightPath); GdipDeletePath (noIntersectBottomPath); GdipDeletePath (noIntersectTopLeftPath); GdipDeletePath (noIntersectTopRightPath); GdipDeletePath (noIntersectBottomRightPath); GdipDeletePath (noIntersectBottomLeftPath); GdipDeletePath (emptyPath); GdipDeletePath (infinitePath); GdipDeletePath (negativePath); } static void test_combineUnion () { GpRegion *infiniteRegion; GpRegion *emptyRegion; GpRegion *rectRegion; GpRegion *pathRegion; GdipCreateRegion (&infiniteRegion); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); RectF rect = {10, 20, 30, 40}; RectF superRect = {0, 10, 50, 60}; RectF subRect = {15, 25, 20, 30}; RectF intersectLeftRect = {0, 20, 30, 40}; RectF intersectTopRect = {10, 10, 30, 40}; RectF intersectRightRect = {20, 20, 30, 40}; RectF intersectBottomRect = {10, 30, 30, 40}; RectF intersectTopLeftRect = {0, 10, 30, 40}; RectF intersectTopRightRect = {20, 10, 30, 40}; RectF intersectBottomRightRect = {20, 30, 30, 40}; RectF intersectBottomLeftRect = {0, 30, 30, 40}; RectF touchingLeftRect = {-20, 20, 30, 40}; RectF touchingTopRect = {10, -20, 30, 40}; RectF touchingRightRect = {40, 20, 30, 40}; RectF touchingBottomRect = {10, 60, 30, 40}; RectF touchingTopLeftRect = {-20, -20, 30, 40}; RectF touchingTopRightRect = {40, -20, 30, 40}; RectF touchingBottomRightRect = {40, 60, 30, 40}; RectF touchingBottomLeftRect = {-20, 60, 30, 40}; RectF noIntersectLeftRect = {-21, 20, 30, 40}; RectF noIntersectTopRect = {10, -21, 30, 40}; RectF noIntersectRightRect = {41, 20, 30, 40}; RectF noIntersectBottomRect = {10, 61, 30, 40}; RectF noIntersectTopLeftRect = {-21, -21, 30, 40}; RectF noIntersectTopRightRect = {41, -21, 30, 40}; RectF noIntersectBottomRightRect = {41, 61, 30, 40}; RectF noIntersectBottomLeftRect = {-21, 61, 30, 40}; RectF intersectLeftNarrowRect = {-30, 30, 60, 10}; RectF intersectTopNarrowRect = {20, -20, 10, 60}; RectF intersectRightNarrowRect = {20, 30, 60, 10}; RectF intersectBottomNarrowRect = {20, 40, 10, 60}; RectF touchesTopIntersectBottomNarrowRect = {20, 20, 10, 60}; RectF intersectRightTallerRect = {20, 20, 30, 60}; RectF intersectRightShorterRect = {20, 20, 30, 20}; RectF tallerRect = {10, 20, 30, 70}; RectF tallerNarrowRect = {10, 20, 10, 70}; RectF widerRect = {10, 20, 60, 40}; RectF widerShorterRect = {10, 20, 60, 20}; RectF largerRect = {10, 20, 60, 70}; RectF crossingRect = {0, 30, 50, 20}; RectF emptyRect = {0, 0, 0, 0}; RectF infiniteRect = {-4194304, -4194304, 8388608, 8388608}; RectF negativeRect = {20, 30, -10, -10}; GdipCreateRegionRect (&rect, &rectRegion); GpPath *path = createPathFromRect (&rect); GpPath *superPath = createPathFromRect (&superRect); GpPath *subPath = createPathFromRect (&subRect); GpPath *intersectLeftPath = createPathFromRect (&intersectLeftRect); GpPath *intersectTopPath = createPathFromRect (&intersectTopRect); GpPath *intersectRightPath = createPathFromRect (&intersectRightRect); GpPath *intersectBottomPath = createPathFromRect (&intersectBottomRect); GpPath *intersectTopLeftPath = createPathFromRect (&intersectTopLeftRect); GpPath *intersectTopRightPath = createPathFromRect (&intersectTopRightRect); GpPath *intersectBottomRightPath = createPathFromRect (&intersectBottomRightRect); GpPath *intersectBottomLeftPath = createPathFromRect (&intersectBottomLeftRect); GpPath *touchingLeftPath = createPathFromRect (&touchingLeftRect); GpPath *touchingTopPath = createPathFromRect (&touchingTopRect); GpPath *touchingRightPath = createPathFromRect (&touchingRightRect); GpPath *touchingBottomPath = createPathFromRect (&touchingBottomRect); GpPath *touchingTopLeftPath = createPathFromRect (&touchingTopLeftRect); GpPath *touchingTopRightPath = createPathFromRect (&touchingTopRightRect); GpPath *touchingBottomRightPath = createPathFromRect (&touchingBottomRightRect); GpPath *touchingBottomLeftPath = createPathFromRect (&touchingBottomLeftRect); GpPath *noIntersectLeftPath = createPathFromRect (&noIntersectLeftRect); GpPath *noIntersectTopPath = createPathFromRect (&noIntersectTopRect); GpPath *noIntersectRightPath = createPathFromRect (&noIntersectRightRect); GpPath *noIntersectBottomPath = createPathFromRect (&noIntersectBottomRect); GpPath *noIntersectTopLeftPath = createPathFromRect (&noIntersectTopLeftRect); GpPath *noIntersectTopRightPath = createPathFromRect (&noIntersectTopRightRect); GpPath *noIntersectBottomRightPath = createPathFromRect (&noIntersectBottomRightRect); GpPath *noIntersectBottomLeftPath = createPathFromRect (&noIntersectBottomLeftRect); GpPath *emptyPath = createPathFromRect (&emptyRect); GpPath *infinitePath = createPathFromRect (&infiniteRect); GpPath *negativePath = createPathFromRect (&negativeRect); GdipCreateRegionPath (path, &pathRegion); // Infinite + Infinite = Infinite verifyCombineInfiniteWithRegion (infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Empty = Infinite. verifyCombineInfiniteWithRegion (emptyRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Infinite Rect = Infinite. verifyCombineInfiniteWithRect (&infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Empty Rect = Infinite. verifyCombineInfiniteWithRect (&emptyRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Rect = Infinite. verifyCombineInfiniteWithRect (&rect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Negative Rect = Infinite. verifyCombineInfiniteWithRect (&negativeRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Infinite Path = Infinite. verifyCombineInfiniteWithPath (infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Empty Path = Infinite. verifyCombineInfiniteWithPath (emptyPath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Path = Infinite. verifyCombineInfiniteWithPath (path, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Infinite = Infinite. verifyCombineEmptyWithRegion (infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty = Empty. verifyCombineEmptyWithRegion (emptyRegion, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Rect = Infinite. verifyCombineEmptyWithRect (&infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty Rect = Empty. verifyCombineEmptyWithRect (&emptyRect, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Rect = Rect. verifyCombineEmptyWithRect (&rect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty + Infinite Path = Infinite. // FIXME: this should have scans: https://github.com/mono/libgdiplus/issues/412 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineEmptyWithPath (infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty + Empty Path = Empty. verifyCombineEmptyWithPath (emptyPath, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Path = Path. verifyCombineEmptyWithPath (path, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Infinite Rect + Infinite = Infinite. verifyCombineRectWithRegion (&infiniteRect, infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Empty = Infinite. verifyCombineRectWithRegion (&infiniteRect, emptyRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Infinite Rect = Infinite. verifyCombineRectWithRect (&infiniteRect, &infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Empty Rect = Infinite. verifyCombineRectWithRect (&infiniteRect, &emptyRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Rect = Infinite. verifyCombineRectWithRect (&infiniteRect, &rect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Infinite Path = Infinite. verifyCombineRectWithPath (&infiniteRect, infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Empty Path = Infinite. verifyCombineRectWithPath (&infiniteRect, emptyPath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Path = Infinite. verifyCombineRectWithPath (&infiniteRect, path, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Infinite = Infinite. verifyCombineRectWithRegion (&emptyRect, infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Empty = Empty. verifyCombineRectWithRegion (&emptyRect, emptyRegion, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Rect = Infinite. verifyCombineRectWithRect (&emptyRect, &infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Empty Rect = Empty. verifyCombineRectWithRect (&emptyRect, &emptyRect, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Rect = Rect. verifyCombineRectWithRect (&emptyRect, &rect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Rect + Infinite Path = Infinite. // FIXME: this should have scans: https://github.com/mono/libgdiplus/issues/412 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&emptyRect, infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty Rect + Empty Path = Empty. verifyCombineRectWithPath (&emptyRect, emptyPath, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Path = Path. verifyCombineRectWithPath (&emptyRect, path, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite = Infinite. verifyCombineRectWithRegion (&rect, infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Rect + Empty = Rect. verifyCombineRectWithRegion (&rect, emptyRegion, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite Rect = Infinite. // FIXME: this should be infinite: https://github.com/mono/libgdiplus/issues/339 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithRect (&rect, &infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Rect + Empty Rect = Rect. verifyCombineRectWithRect (&rect, &emptyRect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Negative Rect = Empty. verifyCombineRectWithRect (&rect, &negativeRect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Equal Rect = Equal Rect. verifyCombineRectWithRect (&rect, &rect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Super Rect = Super Rect. verifyCombineRectWithRect (&rect, &superRect, CombineModeUnion, 0, 10, 50, 60, FALSE, FALSE, &superRect, sizeof (superRect)); // Rect + Sub Rect = Rect. verifyCombineRectWithRect (&rect, &subRect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Intersect Left = Calculation. RectF intersectLeftScan = {0, 20, 40, 40}; verifyCombineRectWithRect (&rect, &intersectLeftRect, CombineModeUnion, 0, 20, 40, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Calculation. RectF intersectTopScan = {10, 10, 30, 50}; RectF intersectTopScansRect[] = {intersectTopScan}; verifyCombineRectWithRect (&rect, &intersectTopRect, CombineModeUnion, 10, 10, 30, 50, FALSE, FALSE, intersectTopScansRect, sizeof (intersectTopScansRect)); // Rect + Intersect Right = Calculation. RectF intersectRightScan = {10, 20, 40, 40}; verifyCombineRectWithRect (&rect, &intersectRightRect, CombineModeUnion, 10, 20, 40, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Calculation. RectF intersectBottomScan = {10, 20, 30, 50}; RectF intersectBottomScansRect[] = {intersectBottomScan}; verifyCombineRectWithRect (&rect, &intersectBottomRect, CombineModeUnion, 10, 20, 30, 50, FALSE, FALSE, intersectBottomScansRect, sizeof (intersectBottomScansRect)); // Rect + Intersect Top Left = Calculation. RectF intersectTopLeftScans[] = { {0, 10, 30, 10}, {0, 20, 40, 30}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopLeftRect, CombineModeUnion, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Calculation. RectF intersectTopRightScans[] = { {20, 10, 30, 10}, {10, 20, 40, 30}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopRightRect, CombineModeUnion, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Calculation. RectF intersectBottomRightScans[] = { {10, 20, 30, 10}, {10, 30, 40, 30}, {20, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomRightRect, CombineModeUnion, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Calculation. RectF intersectBottomLeftScans[] = { {10, 20, 30, 10}, {0, 30, 40, 30}, {0, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomLeftRect, CombineModeUnion, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Calculation. RectF touchingLeftScan = {-20, 20, 60, 40}; verifyCombineRectWithRect (&rect, &touchingLeftRect, CombineModeUnion, -20, 20, 60, 40, FALSE, FALSE, &touchingLeftScan, sizeof (touchingLeftScan)); // Rect + Touching Top = Calculation. RectF touchingTopScan = {10, -20, 30, 80}; RectF touchingTopScansRect[] = {touchingTopScan}; verifyCombineRectWithRect (&rect, &touchingTopRect, CombineModeUnion, 10, -20, 30, 80, FALSE, FALSE, touchingTopScansRect, sizeof (touchingTopScansRect)); // Rect + Touching Right = Calculation. RectF touchingRightScan = {10, 20, 60, 40}; verifyCombineRectWithRect (&rect, &touchingRightRect, CombineModeUnion, 10, 20, 60, 40, FALSE, FALSE, &touchingRightScan, sizeof (touchingRightScan)); // Rect + Touching Bottom = Calculation. RectF touchingBottomScan = {10, 20, 30, 80}; RectF touchingBottomScansRect[] = {touchingBottomScan}; verifyCombineRectWithRect (&rect, &touchingBottomRect, CombineModeUnion, 10, 20, 30, 80, FALSE, FALSE, touchingBottomScansRect, sizeof (touchingBottomScansRect)); // Rect + Touching Top Left = Both. RectF touchingTopLeftScans[] = { touchingTopLeftRect, rect }; verifyCombineRectWithRect (&rect, &touchingTopLeftRect, CombineModeUnion, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Rect + Touching Top Right = Both. RectF touchingTopRightScans[] = { touchingTopRightRect, rect }; verifyCombineRectWithRect (&rect, &touchingTopRightRect, CombineModeUnion, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Rect + Touching Bottom Right = Both. RectF touchingBottomRightScans[] = { rect, touchingBottomRightRect }; verifyCombineRectWithRect (&rect, &touchingBottomRightRect, CombineModeUnion, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Rect + Touching Bottom Left = Both. RectF touchingBottomLeftScans[] = { rect, touchingBottomLeftRect }; verifyCombineRectWithRect (&rect, &touchingBottomLeftRect, CombineModeUnion, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Rect + No Intersect Left = Both. RectF noIntersectLeftScans[] = { noIntersectLeftRect, rect }; verifyCombineRectWithRect (&rect, &noIntersectLeftRect, CombineModeUnion, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); // Rect + No Intersect Top = Both. RectF noIntersectTopScans[] = { noIntersectTopRect, rect }; verifyCombineRectWithRect (&rect, &noIntersectTopRect, CombineModeUnion, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); // Rect + No Intersect Right = Both. RectF noIntersectRightScans[] = { rect, noIntersectRightRect }; verifyCombineRectWithRect (&rect, &noIntersectRightRect, CombineModeUnion, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); // Rect + No Intersect Bottom = Both. RectF noIntersectBottomScans[] = { rect, noIntersectBottomRect }; verifyCombineRectWithRect (&rect, &noIntersectBottomRect, CombineModeUnion, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); // Rect + Intersect Left Narrow = Calculation. RectF intersectLeftNarrowScans[] = { {10, 20, 30, 10}, {-30, 30, 70, 10}, {10, 40, 30, 20}, }; verifyCombineRectWithRect (&rect, &intersectLeftNarrowRect, CombineModeUnion, -30, 20, 70, 40, FALSE, FALSE, intersectLeftNarrowScans, sizeof (intersectLeftNarrowScans)); // RectF intersectTopNarrowRect = {20, -20, 10, 60}; // Rect + Intersect Top Narrow = Calculation. RectF intersectTopNarrowScans[] = { {20, -20, 10, 40}, {10, 20, 30, 40}, }; verifyCombineRectWithRect (&rect, &intersectTopNarrowRect, CombineModeUnion, 10, -20, 30, 80, FALSE, FALSE, intersectTopNarrowScans, sizeof (intersectTopNarrowScans)); // Rect + Intersect Right Narrow = Calculation. RectF intersectRightNarrowScans[] = { {10, 20, 30, 10}, {10, 30, 70, 10}, {10, 40, 30, 20}, }; verifyCombineRectWithRect (&rect, &intersectRightNarrowRect, CombineModeUnion, 10, 20, 70, 40, FALSE, FALSE, intersectRightNarrowScans, sizeof (intersectRightNarrowScans)); // Rect + Intersect Bottom Narrow = Calculation. RectF intersectBottomNarrowScans[] = { {10, 20, 30, 40}, {20, 60, 10, 40} }; verifyCombineRectWithRect (&rect, &intersectBottomNarrowRect, CombineModeUnion, 10, 20, 30, 80, FALSE, FALSE, intersectBottomNarrowScans, sizeof (intersectBottomNarrowScans)); // Rect + Touches Top Intersect Bottom Narrow = Calculation. RectF touchesTopIntersectBottomNarrowScans[] = { {10, 20, 30, 40}, {20, 60, 10, 20} }; verifyCombineRectWithRect (&rect, &touchesTopIntersectBottomNarrowRect, CombineModeUnion, 10, 20, 30, 60, FALSE, FALSE, touchesTopIntersectBottomNarrowScans, sizeof (touchesTopIntersectBottomNarrowScans)); // Rect + Intersect Right Taller = Calculation. RectF intersectRightTallerScans[] = { {10, 20, 40, 40}, {20, 60, 30, 20}, }; verifyCombineRectWithRect (&rect, &intersectRightTallerRect, CombineModeUnion, 10, 20, 40, 60, FALSE, FALSE, intersectRightTallerScans, sizeof (intersectRightTallerScans)); // Rect + Intersect Right Shorter = Calculation. RectF intersectRightShorterScans[] = { {10, 20, 40, 20}, {10, 40, 30, 20}, }; verifyCombineRectWithRect (&rect, &intersectRightShorterRect, CombineModeUnion, 10, 20, 40, 40, FALSE, FALSE, intersectRightShorterScans, sizeof (intersectRightShorterScans)); // Rect + Taller = Calculation. RectF tallerScan = tallerRect; verifyCombineRectWithRect (&rect, &tallerRect, CombineModeUnion, 10, 20, 30, 70, FALSE, FALSE, &tallerScan, sizeof (tallerScan)); // Rect + Taller Narrow = Calculation. RectF tallerNarrowScans[] = { {10, 20, 30, 40}, {10, 60, 10, 30}, }; verifyCombineRectWithRect (&rect, &tallerNarrowRect, CombineModeUnion, 10, 20, 30, 70, FALSE, FALSE, tallerNarrowScans, sizeof (tallerNarrowScans)); // Rect + Wider = Calculation. RectF widerScan = widerRect; verifyCombineRectWithRect (&rect, &widerRect, CombineModeUnion, 10, 20, 60, 40, FALSE, FALSE, &widerScan, sizeof (widerScan)); // Rect + Wider Shorter = Calculation. RectF widerShorterScans[] = { {10, 20, 60, 20}, {10, 40, 30, 20}, }; verifyCombineRectWithRect (&rect, &widerShorterRect, CombineModeUnion, 10, 20, 60, 40, FALSE, FALSE, widerShorterScans, sizeof (widerShorterScans)); // Rect + Larger = Calculation. RectF largerScan = largerRect; verifyCombineRectWithRect (&rect, &largerRect, CombineModeUnion, 10, 20, 60, 70, FALSE, FALSE, &largerScan, sizeof (largerScan)); // Rect + Overlap Taller Narrow = Calculation. RectF crossingScans[] = { {10, 20, 30, 10}, {0, 30, 50, 20}, {10, 50, 30, 10}, }; verifyCombineRectWithRect (&rect, &crossingRect, CombineModeUnion, 0, 20, 50, 40, FALSE, FALSE, crossingScans, sizeof (crossingScans)); // Ported from mono/external/corefx/src/System.Drawing.Common/tests/RegionTests.cs:1813 RectF intersectThreeRects[] = { {20, 180, 40, 50}, {50, 190, 40, 50}, {70, 210, 30, 50} }; RectF intersectThreeRectsScans[] = { {20, 180, 40, 10}, {20, 190, 70, 20}, {20, 210, 80, 20}, {50, 230, 50, 10}, {70, 240, 30, 20} }; verifyCombineRects (intersectThreeRects, sizeof (intersectThreeRects), CombineModeUnion, 20, 180, 80, 80, FALSE, FALSE, intersectThreeRectsScans, sizeof (intersectThreeRectsScans)); // Ported from mono/external/corefx/src/System.Drawing.Common/tests/RegionTests.cs:1831 RectF intersectFourRects[] = { {20, 330, 40, 50}, {50, 340, 40, 50}, {70, 360, 30, 50}, {80, 400, 30, 10} }; RectF intersectFourRectsScans[] = { {20, 330, 40, 10}, {20, 340, 70, 20}, {20, 360, 80, 20}, {50, 380, 50, 10}, {70, 390, 30, 10}, {70, 400, 40, 10} }; verifyCombineRects (intersectFourRects, sizeof (intersectFourRects), CombineModeUnion, 20, 330, 90, 80, FALSE, FALSE, intersectFourRectsScans, sizeof (intersectFourRectsScans)); // Ported from mono/external/corefx/src/System.Drawing.Common/tests/RegionTests.cs:1918 // Has two regions separated by 0 pixels. RectF fourPartialIntersectRects[] = { {30, 30, 80, 80}, {45, 45, 200, 200}, {160, 260, 10, 10}, {170, 260, 10, 10} }; RectF fourPartialIntersectRectsScans[] = { {30, 30, 80, 15}, {30, 45, 215, 65}, {45, 110, 200, 135}, {160, 260, 20, 10} }; verifyCombineRects (fourPartialIntersectRects, sizeof (fourPartialIntersectRects), CombineModeUnion, 30, 30, 215, 240, FALSE, FALSE, fourPartialIntersectRectsScans, sizeof (fourPartialIntersectRectsScans)); // Rect + No Intersect Top Left = Both. RectF noIntersectTopLeftScans[] = { noIntersectTopLeftRect, rect }; verifyCombineRectWithRect (&rect, &noIntersectTopLeftRect, CombineModeUnion, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Rect + No Intersect Top Right = Both. RectF noIntersectTopRightScans[] = { noIntersectTopRightRect, rect }; verifyCombineRectWithRect (&rect, &noIntersectTopRightRect, CombineModeUnion, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Rect + No Intersect Bottom Right = Both. RectF noIntersectBottomRightScans[] = { rect, noIntersectBottomRightRect }; verifyCombineRectWithRect (&rect, &noIntersectBottomRightRect, CombineModeUnion, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Rect + No Intersect Bottom Left = Both. RectF noIntersectBottomLeftScans[] = { rect, noIntersectBottomLeftRect }; verifyCombineRectWithRect (&rect, &noIntersectBottomLeftRect, CombineModeUnion, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); // No Intersect Top Rect + No Intersect Bottom Right = Both. RectF noIntersectTopAndBottomRight[] = { touchingTopRect, touchingBottomRightRect }; verifyCombineRectWithRect (&touchingTopRect, &touchingBottomRightRect, CombineModeUnion, 10, -20, 60, 120, FALSE, FALSE, noIntersectTopAndBottomRight, sizeof (noIntersectTopAndBottomRight)); // Rect + Infinite Path = Infinite. // FIXME: this should be infinite: https://github.com/mono/libgdiplus/issues/339 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Rect + Empty Path = Empty. verifyCombineRectWithPath (&rect, emptyPath, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Negative Path = Rect. verifyCombineRectWithPath (&rect, negativePath, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Equal Path = Equal Path. verifyCombineRectWithPath (&rect, path, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Super Path = Super Path. verifyCombineRectWithPath (&rect, superPath, CombineModeUnion, 0, 10, 50, 60, FALSE, FALSE, &superRect, sizeof (superRect)); // Rect + Sub Path = Path. verifyCombineRectWithPath (&rect, subPath, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Intersect Left = Calculation. verifyCombineRectWithPath (&rect, intersectLeftPath, CombineModeUnion, 0, 20, 40, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Calculation. verifyCombineRectWithPath (&rect, intersectTopPath, CombineModeUnion, 10, 10, 30, 50, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Calculation. verifyCombineRectWithPath (&rect, intersectRightPath, CombineModeUnion, 10, 20, 40, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Calculation. verifyCombineRectWithPath (&rect, intersectBottomPath, CombineModeUnion, 10, 20, 30, 50, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Calculation. verifyCombineRectWithPath (&rect, intersectTopLeftPath, CombineModeUnion, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Calculation. verifyCombineRectWithPath (&rect, intersectTopRightPath, CombineModeUnion, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Calculation. verifyCombineRectWithPath (&rect, intersectBottomRightPath, CombineModeUnion, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Calculation. verifyCombineRectWithPath (&rect, intersectBottomLeftPath, CombineModeUnion, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Calculation. verifyCombineRectWithPath (&rect, touchingLeftPath, CombineModeUnion, -20, 20, 60, 40, FALSE, FALSE, &touchingLeftScan, sizeof (touchingLeftScan)); // Rect + Touching Top = Calculation. verifyCombineRectWithPath (&rect, touchingTopPath, CombineModeUnion, 10, -20, 30, 80, FALSE, FALSE, &touchingTopScan, sizeof (touchingTopScan)); // Rect + Touching Right = Calculation. verifyCombineRectWithPath (&rect, touchingRightPath, CombineModeUnion, 10, 20, 60, 40, FALSE, FALSE, &touchingRightScan, sizeof (touchingRightScan)); // Rect + Touching Bottom = Calculation. verifyCombineRectWithPath (&rect, touchingBottomPath, CombineModeUnion, 10, 20, 30, 80, FALSE, FALSE, &touchingBottomScan, sizeof (touchingBottomScan)); // Rect + Touching Top Left = Both. verifyCombineRectWithPath (&rect, touchingTopLeftPath, CombineModeUnion, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Rect + Touching Top Right = Both. verifyCombineRectWithPath (&rect, touchingTopRightPath, CombineModeUnion, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Rect + Touching Bottom Right = Both. verifyCombineRectWithPath (&rect, touchingBottomRightPath, CombineModeUnion, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Rect + Touching Bottom Left = Both. verifyCombineRectWithPath (&rect, touchingBottomLeftPath, CombineModeUnion, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Rect + No Intersect Left = Calculation. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, noIntersectLeftPath, CombineModeUnion, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); #endif // Rect + No Intersect Top = Calculation. #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, noIntersectTopPath, CombineModeUnion, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); #endif // Rect + No Intersect Right = Calculation. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, noIntersectRightPath, CombineModeUnion, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); #endif // Rect + No Intersect Bottom = Calculation. #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, noIntersectBottomPath, CombineModeUnion, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); #endif // Rect + No Intersect Top Left = Both. verifyCombineRectWithPath (&rect, noIntersectTopLeftPath, CombineModeUnion, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Rect + No Intersect Top Right = Both. verifyCombineRectWithPath (&rect, noIntersectTopRightPath, CombineModeUnion, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Rect + No Intersect Bottom Right = Both. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, noIntersectBottomRightPath, CombineModeUnion, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); #endif // Rect + No Intersect Bottom Left = Both. verifyCombineRectWithPath (&rect, noIntersectBottomLeftPath, CombineModeUnion, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); // Infinite Path + Infinite = Infinite. verifyCombinePathWithRegion (infinitePath, infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Empty = Infinite. verifyCombinePathWithRegion (infinitePath, emptyRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Infinite Rect = Infinite. verifyCombinePathWithRect (infinitePath, &infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Empty Rect = Infinite. verifyCombinePathWithRect (infinitePath, &emptyRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Rect = Infinite. verifyCombinePathWithRect (infinitePath, &rect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Infinite Path = Infinite. verifyCombinePathWithPath (infinitePath, infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Empty Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/412 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (infinitePath, emptyPath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Infinite Path + Path = Infinite. verifyCombinePathWithPath (infinitePath, path, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Infinite = Infinite. verifyCombinePathWithRegion (emptyPath, infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Empty = Empty. verifyCombinePathWithRegion (emptyPath, emptyRegion, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Rect = Infinite. verifyCombinePathWithRect (emptyPath, &infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Empty Rect = Empty. verifyCombinePathWithRect (emptyPath, &emptyRect, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Rect = Rect. verifyCombinePathWithRect (emptyPath, &rect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Path + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/412 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (emptyPath, infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty Path + Empty Path = Empty. verifyCombinePathWithPath (emptyPath, emptyPath, CombineModeUnion, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Path = Path. verifyCombinePathWithPath (emptyPath, path, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite = Infinite. verifyCombinePathWithRegion (path, infiniteRegion, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Path + Empty = Empty. verifyCombinePathWithRegion (path, emptyRegion, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite Rect = Infinite. // FIXME: this should be infinite: https://github.com/mono/libgdiplus/issues/339 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &infiniteRect, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Path + Empty Rect = Empty. verifyCombinePathWithRect (path, &emptyRect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Negative Rect = Rect. verifyCombinePathWithRect (path, &negativeRect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Equal Rect = Equal Rect. verifyCombinePathWithRect (path, &rect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Super Rect = Super Rect. verifyCombinePathWithRect (path, &superRect, CombineModeUnion, 0, 10, 50, 60, FALSE, FALSE, &superRect, sizeof (superRect)); // Path + Sub Rect = Rect. verifyCombinePathWithRect (path, &subRect, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Intersect Left = Calculation. verifyCombinePathWithRect (path, &intersectLeftRect, CombineModeUnion, 0, 20, 40, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Calculation. verifyCombinePathWithRect (path, &intersectTopRect, CombineModeUnion, 10, 10, 30, 50, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Calculation. verifyCombinePathWithRect (path, &intersectRightRect, CombineModeUnion, 10, 20, 40, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Calculation. verifyCombinePathWithRect (path, &intersectBottomRect, CombineModeUnion, 10, 20, 30, 50, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Calculation. verifyCombinePathWithRect (path, &intersectTopLeftRect, CombineModeUnion, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Calculation. verifyCombinePathWithRect (path, &intersectTopRightRect, CombineModeUnion, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Calculation. verifyCombinePathWithRect (path, &intersectBottomRightRect, CombineModeUnion, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Calculation. verifyCombinePathWithRect (path, &intersectBottomLeftRect, CombineModeUnion, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Calculation. verifyCombinePathWithRect (path, &touchingLeftRect, CombineModeUnion, -20, 20, 60, 40, FALSE, FALSE, &touchingLeftScan, sizeof (touchingLeftScan)); // Path + Touching Top = Calculation. verifyCombinePathWithRect (path, &touchingTopRect, CombineModeUnion, 10, -20, 30, 80, FALSE, FALSE, &touchingTopScan, sizeof (touchingTopScan)); // Path + Touching Right = Calculation. verifyCombinePathWithRect (path, &touchingRightRect, CombineModeUnion, 10, 20, 60, 40, FALSE, FALSE, &touchingRightScan, sizeof (touchingRightScan)); // Path + Touching Bottom = Calculation. verifyCombinePathWithRect (path, &touchingBottomRect, CombineModeUnion, 10, 20, 30, 80, FALSE, FALSE, &touchingBottomScan, sizeof (touchingBottomScan)); // Path + Touching Top Left = Both. verifyCombinePathWithRect (path, &touchingTopLeftRect, CombineModeUnion, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Path + Touching Top Right = Both. verifyCombinePathWithRect (path, &touchingTopRightRect, CombineModeUnion, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Path + Touching Bottom Right = Both. verifyCombinePathWithRect (path, &touchingBottomRightRect, CombineModeUnion, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Path + Touching Bottom Left = Both. verifyCombinePathWithRect (path, &touchingBottomLeftRect, CombineModeUnion, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Path + No Intersect Left = Calculation. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &noIntersectLeftRect, CombineModeUnion, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); #endif // Path + No Intersect Top = Calculation. #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &noIntersectTopRect, CombineModeUnion, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); #endif // Path + No Intersect Right = Calculation. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &noIntersectRightRect, CombineModeUnion, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); #endif // Path + No Intersect Bottom = Calculation. #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &noIntersectBottomRect, CombineModeUnion, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); #endif // Path + No Intersect Top Left = Both. verifyCombinePathWithRect (path, &noIntersectTopLeftRect, CombineModeUnion, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Path + No Intersect Top Right = Both. verifyCombinePathWithRect (path, &noIntersectTopRightRect, CombineModeUnion, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Path + No Intersect Bottom Right = Both. verifyCombinePathWithRect (path, &noIntersectBottomRightRect, CombineModeUnion, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Path + No Intersect Bottom Left = Both. verifyCombinePathWithRect (path, &noIntersectBottomLeftRect, CombineModeUnion, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); // Path + Infinite Path = Infinite. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338. #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, infinitePath, CombineModeUnion, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Path + Empty Path = Empty. verifyCombinePathWithPath (path, emptyPath, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Negative Path = Path. verifyCombinePathWithPath (path, negativePath, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Equal Path = Equal Path. verifyCombinePathWithPath (path, path, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Super Path = Super Path. verifyCombinePathWithPath (path, superPath, CombineModeUnion, 0, 10, 50, 60, FALSE, FALSE, &superRect, sizeof (superRect)); // Path + Sub Path = Path. verifyCombinePathWithPath (path, subPath, CombineModeUnion, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Intersect Left = Calculation. verifyCombinePathWithPath (path, intersectLeftPath, CombineModeUnion, 0, 20, 40, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Calculation. verifyCombinePathWithPath (path, intersectTopPath, CombineModeUnion, 10, 10, 30, 50, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Calculation. verifyCombinePathWithPath (path, intersectRightPath, CombineModeUnion, 10, 20, 40, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Calculation. verifyCombinePathWithPath (path, intersectBottomPath, CombineModeUnion, 10, 20, 30, 50, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Calculation. verifyCombinePathWithPath (path, intersectTopLeftPath, CombineModeUnion, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Calculation. verifyCombinePathWithPath (path, intersectTopRightPath, CombineModeUnion, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Calculation. verifyCombinePathWithPath (path, intersectBottomRightPath, CombineModeUnion, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Calculation. verifyCombinePathWithPath (path, intersectBottomLeftPath, CombineModeUnion, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Calculation. verifyCombinePathWithPath (path, touchingLeftPath, CombineModeUnion, -20, 20, 60, 40, FALSE, FALSE, &touchingLeftScan, sizeof (touchingLeftScan)); // Path + Touching Top = Calculation. verifyCombinePathWithPath (path, touchingTopPath, CombineModeUnion, 10, -20, 30, 80, FALSE, FALSE, &touchingTopScan, sizeof (touchingTopScan)); // Path + Touching Right = Calculation. verifyCombinePathWithPath (path, touchingRightPath, CombineModeUnion, 10, 20, 60, 40, FALSE, FALSE, &touchingRightScan, sizeof (touchingRightScan)); // Path + Touching Bottom = Calculation. verifyCombinePathWithPath (path, touchingBottomPath, CombineModeUnion, 10, 20, 30, 80, FALSE, FALSE, &touchingBottomScan, sizeof (touchingBottomScan)); // Path + Touching Top Left = Both. verifyCombinePathWithPath (path, touchingTopLeftPath, CombineModeUnion, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Path + Touching Top Right = Both. verifyCombinePathWithPath (path, touchingTopRightPath, CombineModeUnion, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Path + Touching Bottom Right = Both. verifyCombinePathWithPath (path, touchingBottomRightPath, CombineModeUnion, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Path + Touching Bottom Left = Both. verifyCombinePathWithPath (path, touchingBottomLeftPath, CombineModeUnion, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Path + No Intersect Left = Calculation. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, noIntersectLeftPath, CombineModeUnion, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); #endif // Path + No Intersect Top = Calculation. #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, noIntersectTopPath, CombineModeUnion, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); #endif // Path + No Intersect Right = Calculation. // FIXME: scans are wrong: https://github.com/mono/libgdiplus/issues/413 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, noIntersectRightPath, CombineModeUnion, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); #endif // Path + No Intersect Bottom = Calculation. #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, noIntersectBottomPath, CombineModeUnion, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); #endif // Path + No Intersect Top Left = Both. verifyCombinePathWithPath (path, noIntersectTopLeftPath, CombineModeUnion, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Path + No Intersect Top Right = Both. verifyCombinePathWithPath (path, noIntersectTopRightPath, CombineModeUnion, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Path + No Intersect Bottom Right = Both. verifyCombinePathWithPath (path, noIntersectBottomRightPath, CombineModeUnion, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Path + No Intersect Bottom Left = Both. verifyCombinePathWithPath (path, noIntersectBottomLeftPath, CombineModeUnion, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); GdipDeleteRegion (infiniteRegion); GdipDeleteRegion (emptyRegion); GdipDeleteRegion (rectRegion); GdipDeleteRegion (pathRegion); GdipDeletePath (path); GdipDeletePath (superPath); GdipDeletePath (subPath); GdipDeletePath (intersectLeftPath); GdipDeletePath (intersectTopPath); GdipDeletePath (intersectRightPath); GdipDeletePath (intersectBottomPath); GdipDeletePath (intersectTopLeftPath); GdipDeletePath (intersectTopRightPath); GdipDeletePath (intersectBottomRightPath); GdipDeletePath (intersectBottomLeftPath); GdipDeletePath (touchingLeftPath); GdipDeletePath (touchingTopPath); GdipDeletePath (touchingRightPath); GdipDeletePath (touchingBottomPath); GdipDeletePath (touchingTopLeftPath); GdipDeletePath (touchingTopRightPath); GdipDeletePath (touchingBottomRightPath); GdipDeletePath (touchingBottomLeftPath); GdipDeletePath (noIntersectLeftPath); GdipDeletePath (noIntersectTopPath); GdipDeletePath (noIntersectRightPath); GdipDeletePath (noIntersectBottomPath); GdipDeletePath (noIntersectTopLeftPath); GdipDeletePath (noIntersectTopRightPath); GdipDeletePath (noIntersectBottomRightPath); GdipDeletePath (noIntersectBottomLeftPath); GdipDeletePath (emptyPath); GdipDeletePath (infinitePath); GdipDeletePath (negativePath); } static void test_combineXor () { GpRegion *infiniteRegion; GpRegion *emptyRegion; GpRegion *rectRegion; GpRegion *pathRegion; GdipCreateRegion (&infiniteRegion); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); RectF rect = {10, 20, 30, 40}; RectF superRect = {0, 10, 50, 60}; RectF subRect = {15, 25, 20, 30}; RectF intersectLeftRect = {0, 20, 30, 40}; RectF intersectTopRect = {10, 10, 30, 40}; RectF intersectRightRect = {20, 20, 30, 40}; RectF intersectBottomRect = {10, 30, 30, 40}; RectF intersectTopLeftRect = {0, 10, 30, 40}; RectF intersectTopRightRect = {20, 10, 30, 40}; RectF intersectBottomRightRect = {20, 30, 30, 40}; RectF intersectBottomLeftRect = {0, 30, 30, 40}; RectF touchingLeftRect = {-20, 20, 30, 40}; RectF touchingTopRect = {10, -20, 30, 40}; RectF touchingRightRect = {40, 20, 30, 40}; RectF touchingBottomRect = {10, 60, 30, 40}; RectF touchingTopLeftRect = {-20, -20, 30, 40}; RectF touchingTopRightRect = {40, -20, 30, 40}; RectF touchingBottomRightRect = {40, 60, 30, 40}; RectF touchingBottomLeftRect = {-20, 60, 30, 40}; RectF noIntersectLeftRect = {-21, 20, 30, 40}; RectF noIntersectTopRect = {10, -21, 30, 40}; RectF noIntersectRightRect = {41, 20, 30, 40}; RectF noIntersectBottomRect = {10, 61, 30, 40}; RectF noIntersectTopLeftRect = {-21, -21, 30, 40}; RectF noIntersectTopRightRect = {41, -21, 30, 40}; RectF noIntersectBottomRightRect = {41, 61, 30, 40}; RectF noIntersectBottomLeftRect = {-21, 61, 30, 40}; RectF emptyRect = {0, 0, 0, 0}; RectF infiniteRect = {-4194304, -4194304, 8388608, 8388608}; RectF negativeRect = {20, 30, -10, -10}; GdipCreateRegionRect (&rect, &rectRegion); GpPath *path = createPathFromRect (&rect); GpPath *superPath = createPathFromRect (&superRect); GpPath *subPath = createPathFromRect (&subRect); GpPath *intersectLeftPath = createPathFromRect (&intersectLeftRect); GpPath *intersectTopPath = createPathFromRect (&intersectTopRect); GpPath *intersectRightPath = createPathFromRect (&intersectRightRect); GpPath *intersectBottomPath = createPathFromRect (&intersectBottomRect); GpPath *intersectTopLeftPath = createPathFromRect (&intersectTopLeftRect); GpPath *intersectTopRightPath = createPathFromRect (&intersectTopRightRect); GpPath *intersectBottomRightPath = createPathFromRect (&intersectBottomRightRect); GpPath *intersectBottomLeftPath = createPathFromRect (&intersectBottomLeftRect); GpPath *touchingLeftPath = createPathFromRect (&touchingLeftRect); GpPath *touchingTopPath = createPathFromRect (&touchingTopRect); GpPath *touchingRightPath = createPathFromRect (&touchingRightRect); GpPath *touchingBottomPath = createPathFromRect (&touchingBottomRect); GpPath *touchingTopLeftPath = createPathFromRect (&touchingTopLeftRect); GpPath *touchingTopRightPath = createPathFromRect (&touchingTopRightRect); GpPath *touchingBottomRightPath = createPathFromRect (&touchingBottomRightRect); GpPath *touchingBottomLeftPath = createPathFromRect (&touchingBottomLeftRect); GpPath *noIntersectLeftPath = createPathFromRect (&noIntersectLeftRect); GpPath *noIntersectTopPath = createPathFromRect (&noIntersectTopRect); GpPath *noIntersectRightPath = createPathFromRect (&noIntersectRightRect); GpPath *noIntersectBottomPath = createPathFromRect (&noIntersectBottomRect); GpPath *noIntersectTopLeftPath = createPathFromRect (&noIntersectTopLeftRect); GpPath *noIntersectTopRightPath = createPathFromRect (&noIntersectTopRightRect); GpPath *noIntersectBottomRightPath = createPathFromRect (&noIntersectBottomRightRect); GpPath *noIntersectBottomLeftPath = createPathFromRect (&noIntersectBottomLeftRect); GpPath *emptyPath = createPathFromRect (&emptyRect); GpPath *infinitePath = createPathFromRect (&infiniteRect); GpPath *negativePath = createPathFromRect (&negativeRect); GdipCreateRegionPath (path, &pathRegion); // Infinite + Infinite = Empty verifyCombineInfiniteWithRegion (infiniteRegion, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Empty = Infinite. verifyCombineInfiniteWithRegion (emptyRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Infinite Rect = Empty // FIXME: should be empty: https://github.com/mono/libgdiplus/issues/342 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineInfiniteWithRect (&infiniteRect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Infinite + Empty Rect = Infinite. verifyCombineInfiniteWithRect (&emptyRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Rect = Not Rect. RectF infiniteWithRectScans[] = { {-4194304, -4194304, 8388608, 4194324}, {-4194304, 20, 4194314, 40}, {40, 20, 4194264, 40}, {-4194304, 60, 8388608, 4194244} }; verifyCombineInfiniteWithRect (&rect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Infinite + Negative Rect = Infinite. { GpRegion *region; GdipCreateRegion (®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF infiniteWithNegativeRectScans[] = { {-4194304, -4194304, 8388608, 4194324}, {-4194304, 20, 4194314, 10}, {20, 20, 4194284, 10}, {-4194304, 30, 8388608, 4194274} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeXor); verifyRegion (clone, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE); verifyRegionScans (clone, infiniteWithNegativeRectScans, sizeof (infiniteWithNegativeRectScans)); GdipDeleteRegion (clone); } // Infinite + Infinite Path = Empty // FIXME: shoud be infinite: https://github.com/mono/libgdiplus/issues/342 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineInfiniteWithPath (infinitePath, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Infinite + Empty Path = Infinite. verifyCombineInfiniteWithPath (emptyPath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Path = Not Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineInfiniteWithPath (path, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Empty + Infinite = Infinite. verifyCombineEmptyWithRegion (infiniteRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty = Empty. verifyCombineEmptyWithRegion (emptyRegion, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Rect = Infinite. verifyCombineEmptyWithRect (&infiniteRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty Rect = Empty. verifyCombineEmptyWithRect (&emptyRect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Rect = Rect. verifyCombineEmptyWithRect (&rect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty + Infinite Path = Infinite. #if defined(USE_WINDOWS_GDIPLUS) verifyCombineEmptyWithPath (infinitePath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty + Empty Path = Empty. verifyCombineEmptyWithPath (emptyPath, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Path = Path. verifyCombineEmptyWithPath (path, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Infinite Rect + Infinite = Empty. verifyCombineRectWithRegion (&infiniteRect, infiniteRegion, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Empty = Infinite Rect. verifyCombineRectWithRegion (&infiniteRect, emptyRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Infinite Rect = Empty. // FIXME: this should be empty: https://github.com/mono/libgdiplus/issues/342 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithRect (&infiniteRect, &infiniteRect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Infinite Rect + Empty Rect = Infinite. verifyCombineRectWithRect (&infiniteRect, &emptyRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Rect = Not Rect. verifyCombineRectWithRect (&infiniteRect, &rect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Infinite Rect + Infinite Path = Empty. // FIXME: this should be empty: https://github.com/mono/libgdiplus/issues/342 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&infiniteRect, infinitePath, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Infinite Rect + Empty Path = Infinite. verifyCombineRectWithPath (&infiniteRect, emptyPath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Path = Not Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&infiniteRect, path, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Empty Rect + Infinite = Infinite. verifyCombineRectWithRegion (&emptyRect, infiniteRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Empty = Empty. verifyCombineRectWithRegion (&emptyRect, emptyRegion, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Rect = Infinite. verifyCombineRectWithRect (&emptyRect, &infiniteRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Empty Rect = Empty. verifyCombineRectWithRect (&emptyRect, &emptyRect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Rect = Rect. verifyCombineRectWithRect (&emptyRect, &rect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Rect + Infinite Path = Infinite. #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&emptyRect, infinitePath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty Rect + Empty Path = Empty. verifyCombineRectWithPath (&emptyRect, emptyPath, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Path = Path. verifyCombineRectWithPath (&emptyRect, path, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite = Not Rect. verifyCombineRectWithRegion (&rect, infiniteRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Rect + Empty = Rect. verifyCombineRectWithRegion (&rect, emptyRegion, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite Rect = Not Rect. verifyCombineRectWithRect (&rect, &infiniteRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Rect + Empty Rect = Rect. verifyCombineRectWithRect (&rect, &emptyRect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Negative Rect = Rect. { GpRegion *region; GdipCreateRegionRect (&rect, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); RectF negativeRectScan = {10, 20, 30, 40}; verifyCombineRegionWithRegion (region, region2, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &negativeRectScan, sizeof (negativeRectScan)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF rectWithNegativeRectScans[] = { {20, 20, 20, 10}, {10, 30, 30, 30} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeXor); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); verifyRegionScans (clone, rectWithNegativeRectScans, sizeof (rectWithNegativeRectScans)); GdipDeleteRegion (clone); } // Rect + Equal Rect = Empty Rect. verifyCombineRectWithRect (&rect, &rect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Super Rect = Not Rect and Super Rect. RectF superScans[] = { {0, 10, 50, 10}, {0, 20, 10, 40}, {40, 20, 10, 40}, {0, 60, 50, 10} }; verifyCombineRectWithRect (&rect, &superRect, CombineModeXor, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); // Rect + Sub Rect = Not Sub Rect and Rect. RectF subScans[] = { {10, 20, 30, 5}, {10, 25, 5, 30}, {35, 25, 5, 30}, {10, 55, 30, 5} }; verifyCombineRectWithRect (&rect, &subRect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); // Rect + Intersect Left = Not (Rect and Intersect Left) RectF intersectLeftScans[] = { {0, 20, 10, 40}, {30, 20, 10, 40} }; verifyCombineRectWithRect (&rect, &intersectLeftRect, CombineModeXor, 0, 20, 40, 40, FALSE, FALSE, intersectLeftScans, sizeof (intersectLeftScans)); // Rect + Intersect Top = Not (Rect and Intersect Top). RectF intersectTopScans[] = { {10, 10, 30, 10}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopRect, CombineModeXor, 10, 10, 30, 50, FALSE, FALSE, intersectTopScans, sizeof (intersectTopScans)); // Rect + Intersect Right = Not (Rect and Intersect Right). RectF intersectRightScans[] = { {10, 20, 10, 40}, {40, 20, 10, 40} }; verifyCombineRectWithRect (&rect, &intersectRightRect, CombineModeXor, 10, 20, 40, 40, FALSE, FALSE, intersectRightScans, sizeof (intersectRightScans)); // Rect + Intersect Bottom = Not (Rect and Intersect Bottom). RectF intersectBottomScans[] = { {10, 20, 30, 10}, {10, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomRect, CombineModeXor, 10, 20, 30, 50, FALSE, FALSE, intersectBottomScans, sizeof (intersectBottomScans)); // Rect + Intersect Top Left = Not (Rect and Intersect Left). RectF intersectTopLeftScans[] = { {0, 10, 30, 10}, {0, 20, 10, 30}, {30, 20, 10, 30}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopLeftRect, CombineModeXor, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Calculation. RectF intersectTopRightScans[] = { {20, 10, 30, 10}, {10, 20, 10, 30}, {40, 20, 10, 30}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopRightRect, CombineModeXor, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Calculation. RectF intersectBottomRightScans[] = { {10, 20, 30, 10}, {10, 30, 10, 30}, {40, 30, 10, 30}, {20, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomRightRect, CombineModeXor, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Calculation. RectF intersectBottomLeftScans[] = { {10, 20, 30, 10}, {0, 30, 10, 30}, {30, 30, 10, 30}, {0, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomLeftRect, CombineModeXor, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Both. // FIXME: combine adjacent regions: https://github.com/mono/libgdiplus/issues/345 #if defined(USE_WINDOWS_GDIPLUS) RectF touchingLeftScans[] = {{-20, 20, 60, 40}}; #else RectF touchingLeftScans[] = { rect, touchingLeftRect }; #endif verifyCombineRectWithRect (&rect, &touchingLeftRect, CombineModeXor, -20, 20, 60, 40, FALSE, FALSE, touchingLeftScans, sizeof (touchingLeftScans)); // Rect + Touching Top = Both. // FIXME: combine adjacent regions: https://github.com/mono/libgdiplus/issues/345 #if defined(USE_WINDOWS_GDIPLUS) RectF touchingTopScans[] = {{10, -20, 30, 80}}; #else RectF touchingTopScans[] = { rect, touchingTopRect }; #endif verifyCombineRectWithRect (&rect, &touchingTopRect, CombineModeXor, 10, -20, 30, 80, FALSE, FALSE, touchingTopScans, sizeof (touchingTopScans)); // Rect + Touching Right = Both. // FIXME: combine adjacent regions: https://github.com/mono/libgdiplus/issues/345 #if defined(USE_WINDOWS_GDIPLUS) RectF touchingRightScans[] = {{10, 20, 60, 40}}; #else RectF touchingRightScans[] = { rect, touchingRightRect }; #endif verifyCombineRectWithRect (&rect, &touchingRightRect, CombineModeXor, 10, 20, 60, 40, FALSE, FALSE, touchingRightScans, sizeof (touchingRightScans)); // Rect + Touching Bottom = Both. // FIXME: combine adjacent regions: https://github.com/mono/libgdiplus/issues/345 #if defined(USE_WINDOWS_GDIPLUS) RectF touchingBottomScans[] = {{10, 20, 30, 80}}; #else RectF touchingBottomScans[] = {{10, 20, 30, 40}, {10, 60, 30, 40}}; #endif verifyCombineRectWithRect (&rect, &touchingBottomRect, CombineModeXor, 10, 20, 30, 80, FALSE, FALSE, touchingBottomScans, sizeof (touchingBottomScans)); // Rect + Touching Top Left = Both. // FIXME: different ordering: https://github.com/mono/libgdiplus/issues/346 #if defined(USE_WINDOWS_GDIPLUS) RectF touchingTopLeftScans[] = { touchingTopLeftRect, rect }; #else RectF touchingTopLeftScans[] = { rect, touchingTopLeftRect }; #endif verifyCombineRectWithRect (&rect, &touchingTopLeftRect, CombineModeXor, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Rect + Touching Top Right = Both. // FIXME: different ordering: https://github.com/mono/libgdiplus/issues/346 #if defined(USE_WINDOWS_GDIPLUS) RectF touchingTopRightScans[] = { touchingTopRightRect, rect }; #else RectF touchingTopRightScans[] = { rect, touchingTopRightRect }; #endif verifyCombineRectWithRect (&rect, &touchingTopRightRect, CombineModeXor, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Rect + Touching Bottom Right = Both. RectF touchingBottomRightScans[] = { rect, touchingBottomRightRect }; verifyCombineRectWithRect (&rect, &touchingBottomRightRect, CombineModeXor, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Rect + Touching Bottom Left = Both. RectF touchingBottomLeftScans[] = { rect, touchingBottomLeftRect }; verifyCombineRectWithRect (&rect, &touchingBottomLeftRect, CombineModeXor, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Rect + No Intersect Left = Both. RectF noIntersectLeftScans[] = { #if defined(USE_WINDOWS_GDIPLUS) noIntersectLeftRect, rect #else rect, noIntersectLeftRect #endif }; verifyCombineRectWithRect (&rect, &noIntersectLeftRect, CombineModeXor, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); // Rect + No Intersect Top = Both. RectF noIntersectTopScans[] = { #if defined(USE_WINDOWS_GDIPLUS) noIntersectTopRect, rect #else rect, noIntersectTopRect #endif }; verifyCombineRectWithRect (&rect, &noIntersectTopRect, CombineModeXor, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); // Rect + No Intersect Right = Both. RectF noIntersectRightScans[] = { rect, noIntersectRightRect }; verifyCombineRectWithRect (&rect, &noIntersectRightRect, CombineModeXor, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); // Rect + No Intersect Bottom = Both. RectF noIntersectBottomScans[] = { rect, noIntersectBottomRect }; verifyCombineRectWithRect (&rect, &noIntersectBottomRect, CombineModeXor, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); // Rect + No Intersect Top Left = Both. RectF noIntersectTopLeftScans[] = { #if defined(USE_WINDOWS_GDIPLUS) noIntersectTopLeftRect, rect #else rect, noIntersectTopLeftRect #endif }; verifyCombineRectWithRect (&rect, &noIntersectTopLeftRect, CombineModeXor, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Rect + No Intersect Top Right = Both. RectF noIntersectTopRightScans[] = { #if defined(USE_WINDOWS_GDIPLUS) noIntersectTopRightRect, rect #else rect, noIntersectTopRightRect #endif }; verifyCombineRectWithRect (&rect, &noIntersectTopRightRect, CombineModeXor, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Rect + No Intersect Bottom Right = Both. RectF noIntersectBottomRightScans[] = { rect, noIntersectBottomRightRect }; verifyCombineRectWithRect (&rect, &noIntersectBottomRightRect, CombineModeXor, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Rect + No Intersect Bottom Left = Both. RectF noIntersectBottomLeftScans[] = { rect, noIntersectBottomLeftRect }; verifyCombineRectWithRect (&rect, &noIntersectBottomLeftRect, CombineModeXor, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); // Rect + Infinite Path = Not Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, infinitePath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Rect + Empty Path = Path. verifyCombineRectWithPath (&rect, emptyPath, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Negative Path = Rect. verifyCombineRectWithPath (&rect, emptyPath, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Equal Path = Empty. verifyCombineRectWithPath (&rect, path, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/347. #if defined(USE_WINDOWS_GDIPLUS) // Rect + Super Rect = Not Rect and Super Rect. verifyCombineRectWithPath (&rect, superPath, CombineModeXor, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); // Rect + Sub Rect = Not Sub Rect and Rect. verifyCombineRectWithPath (&rect, subPath, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); // Rect + Intersect Left = Not (Rect and Intersect Left). verifyCombineRectWithPath (&rect, intersectLeftPath, CombineModeXor, 0, 20, 40, 40, FALSE, FALSE, intersectLeftScans, sizeof (intersectLeftScans)); // Rect + Intersect Top = Not (Rect and Intersect Top). verifyCombineRectWithPath (&rect, intersectTopPath, CombineModeXor, 10, 10, 30, 50, FALSE, FALSE, intersectTopScans, sizeof (intersectTopScans)); // Rect + Intersect Right = Not (Rect and Intersect Right). verifyCombineRectWithPath (&rect, intersectRightPath, CombineModeXor, 10, 20, 40, 40, FALSE, FALSE, intersectRightScans, sizeof (intersectRightScans)); // Rect + Intersect Bottom = Not (Rect and Intersect Bottom). verifyCombineRectWithPath (&rect, intersectBottomPath, CombineModeXor, 10, 20, 30, 50, FALSE, FALSE, intersectBottomScans, sizeof (intersectBottomScans)); // Rect + Intersect Top Left = Not (Rect and Intersect Top Left). verifyCombineRectWithPath (&rect, intersectTopLeftPath, CombineModeXor, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Not (Rect and Intersect Top Right). verifyCombineRectWithPath (&rect, intersectTopRightPath, CombineModeXor, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Not (Rect and Intersect Bottom Right). verifyCombineRectWithPath (&rect, intersectBottomRightPath, CombineModeXor, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Not (Rect and Intersect Bottom Left). verifyCombineRectWithPath (&rect, intersectBottomLeftPath, CombineModeXor, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Both. verifyCombineRectWithPath (&rect, touchingLeftPath, CombineModeXor, -20, 20, 60, 40, FALSE, FALSE, touchingLeftScans, sizeof (touchingLeftScans)); // Rect + Touching Top = Both. verifyCombineRectWithPath (&rect, touchingTopPath, CombineModeXor, 10, -20, 30, 80, FALSE, FALSE, touchingTopScans, sizeof (touchingTopScans)); // Rect + Touching Right = Both. verifyCombineRectWithPath (&rect, touchingRightPath, CombineModeXor, 10, 20, 60, 40, FALSE, FALSE, touchingRightScans, sizeof (touchingRightScans)); // Rect + Touching Bottom = Both. verifyCombineRectWithPath (&rect, touchingBottomPath, CombineModeXor, 10, 20, 30, 80, FALSE, FALSE, touchingBottomScans, sizeof (touchingBottomScans)); // Rect + Touching Top Left = Both. verifyCombineRectWithPath (&rect, touchingTopLeftPath, CombineModeXor, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Rect + Touching Top Right = Both. verifyCombineRectWithPath (&rect, touchingTopRightPath, CombineModeXor, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Rect + Touching Bottom Right = Both. verifyCombineRectWithPath (&rect, touchingBottomRightPath, CombineModeXor, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Rect + Touching Bottom Left = Both. verifyCombineRectWithPath (&rect, touchingBottomLeftPath, CombineModeXor, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Rect + No Intersect Left = Both. verifyCombineRectWithPath (&rect, noIntersectLeftPath, CombineModeXor, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); // Rect + No Intersect Top = Both. verifyCombineRectWithPath (&rect, noIntersectTopPath, CombineModeXor, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); // Rect + No Intersect Right = Both. verifyCombineRectWithPath (&rect, noIntersectRightPath, CombineModeXor, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); // Rect + No Intersect Bottom = Both. verifyCombineRectWithPath (&rect, noIntersectBottomPath, CombineModeXor, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); // Rect + No Intersect Top Left = Both. verifyCombineRectWithPath (&rect, noIntersectTopLeftPath, CombineModeXor, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Rect + No Intersect Top Right = Both. verifyCombineRectWithPath (&rect, noIntersectTopRightPath, CombineModeXor, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Rect + No Intersect Bottom Right = Both. verifyCombineRectWithPath (&rect, noIntersectBottomRightPath, CombineModeXor, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Rect + No Intersect Bottom Left = Both. verifyCombineRectWithPath (&rect, noIntersectBottomLeftPath, CombineModeXor, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); #endif // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) // Infinite Path + Infinite = Empty. verifyCombinePathWithRegion (infinitePath, infiniteRegion, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty = Infinite. verifyCombinePathWithRegion (infinitePath, emptyRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Infinite Rect = Empty. verifyCombinePathWithRect (infinitePath, &infiniteRect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty Rect = Infinite. verifyCombinePathWithRect (infinitePath, &emptyRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Rect = Not Path. verifyCombinePathWithRect (infinitePath, &rect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Infinite Path + Infinite Path = Empty. verifyCombinePathWithPath (infinitePath, infinitePath, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty Path = Infinite. verifyCombinePathWithPath (infinitePath, emptyPath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Path = Not Path. verifyCombinePathWithPath (infinitePath, path, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Empty Path + Infinite = Infinite. verifyCombinePathWithRegion (emptyPath, infiniteRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Empty = Empty. verifyCombinePathWithRegion (emptyPath, emptyRegion, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Rect = Infinite. verifyCombinePathWithRect (emptyPath, &infiniteRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Empty Rect = Empty. verifyCombinePathWithRect (emptyPath, &emptyRect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Rect = Rect. verifyCombinePathWithRect (emptyPath, &rect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Path + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/416 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (emptyPath, infinitePath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty Path + Empty Path = Empty. verifyCombinePathWithPath (emptyPath, emptyPath, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Path = Path. verifyCombinePathWithPath (emptyPath, path, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite = Not Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRegion (path, infiniteRegion, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Path + Empty = Rect. verifyCombinePathWithRegion (path, emptyRegion, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite Rect = Not Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &infiniteRect, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Path + Empty Rect = Path. verifyCombinePathWithRect (path, &emptyRect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Negative Rect = Path. { GpRegion *region; GdipCreateRegionPath (path, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); RectF negativeRectScan = {10, 20, 30, 40}; verifyCombineRegionWithRegion (region, region2, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &negativeRectScan, sizeof (negativeRectScan)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF rectWithNegativePathScans[] = { {20, 20, 20, 10}, {10, 30, 30, 30} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeXor); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); verifyRegionScans (clone, rectWithNegativePathScans, sizeof (rectWithNegativePathScans)); GdipDeleteRegion (clone); } // Path + Equal Rect = Empty. // FIXME: should be empty: https://github.com/mono/libgdiplus/issues/348 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &rect, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/347 #if defined(USE_WINDOWS_GDIPLUS) // Path + Super Rect = Not Path and Super Rect. verifyCombinePathWithRect (path, &superRect, CombineModeXor, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); // Path + Sub Rect = Not Sub Rect and Rect. verifyCombinePathWithRect (path, &subRect, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); // Path + Intersect Left = Not (Rect and Intersect Left). verifyCombinePathWithRect (path, &intersectLeftRect, CombineModeXor, 0, 20, 40, 40, FALSE, FALSE, intersectLeftScans, sizeof (intersectLeftScans)); // Path + Intersect Top = Not (Rect and Intersect Top). verifyCombinePathWithRect (path, &intersectTopRect, CombineModeXor, 10, 10, 30, 50, FALSE, FALSE, intersectTopScans, sizeof (intersectTopScans)); // Path + Intersect Right = Not (Rect and Intersect Right). verifyCombinePathWithRect (path, &intersectRightRect, CombineModeXor, 10, 20, 40, 40, FALSE, FALSE, intersectRightScans, sizeof (intersectRightScans)); // Path + Intersect Bottom = Not (Rect and Intersect Bottom). verifyCombinePathWithRect (path, &intersectBottomRect, CombineModeXor, 10, 20, 30, 50, FALSE, FALSE, intersectBottomScans, sizeof (intersectBottomScans)); // Path + Intersect Top Left = Not (Rect and Intersect Left). verifyCombinePathWithRect (path, &intersectTopLeftRect, CombineModeXor, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Calculation. verifyCombinePathWithRect (path, &intersectTopRightRect, CombineModeXor, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Calculation. verifyCombinePathWithRect (path, &intersectBottomRightRect, CombineModeXor, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Calculation. verifyCombinePathWithRect (path, &intersectBottomLeftRect, CombineModeXor, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Both. verifyCombinePathWithRect (path, &touchingLeftRect, CombineModeXor, -20, 20, 60, 40, FALSE, FALSE, touchingLeftScans, sizeof (touchingLeftScans)); // Path + Touching Top = Both. verifyCombinePathWithRect (path, &touchingTopRect, CombineModeXor, 10, -20, 30, 80, FALSE, FALSE, touchingTopScans, sizeof (touchingTopScans)); // Path + Touching Right = Both. verifyCombinePathWithRect (path, &touchingRightRect, CombineModeXor, 10, 20, 60, 40, FALSE, FALSE, touchingRightScans, sizeof (touchingRightScans)); // Path + Touching Bottom = Both. verifyCombinePathWithRect (path, &touchingBottomRect, CombineModeXor, 10, 20, 30, 80, FALSE, FALSE, touchingBottomScans, sizeof (touchingBottomScans)); // Path + Touching Top Left = Both. verifyCombinePathWithRect (path, &touchingTopLeftRect, CombineModeXor, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Path + Touching Top Right = Both. verifyCombinePathWithRect (path, &touchingTopRightRect, CombineModeXor, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Path + Touching Bottom Right = Both. verifyCombinePathWithRect (path, &touchingBottomRightRect, CombineModeXor, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Path + Touching Bottom Left = Both. verifyCombinePathWithRect (path, &touchingBottomLeftRect, CombineModeXor, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Path + No Intersect Left = Both. verifyCombinePathWithRect (path, &noIntersectLeftRect, CombineModeXor, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); // Path + No Intersect Top = Both. verifyCombinePathWithRect (path, &noIntersectTopRect, CombineModeXor, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); // Path + No Intersect Right = Both. verifyCombinePathWithRect (path, &noIntersectRightRect, CombineModeXor, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); // Path + No Intersect Bottom = Both. verifyCombinePathWithRect (path, &noIntersectBottomRect, CombineModeXor, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); // Path + No Intersect Top Left = Both. verifyCombinePathWithRect (path, &noIntersectTopLeftRect, CombineModeXor, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Path + No Intersect Top Right = Both. verifyCombinePathWithRect (path, &noIntersectTopRightRect, CombineModeXor, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Path + No Intersect Bottom Right = Both. verifyCombinePathWithRect (path, &noIntersectBottomRightRect, CombineModeXor, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Path + No Intersect Bottom Left = Both. verifyCombinePathWithRect (path, &noIntersectBottomLeftRect, CombineModeXor, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); #endif // Path + Infinite Path = Not Path. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, infinitePath, CombineModeXor, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Path + Empty Path = Path. verifyCombinePathWithPath (path, emptyPath, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Negative Path = Path. verifyCombinePathWithPath (path, negativePath, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Equal Path = Empty. verifyCombinePathWithPath (path, path, CombineModeXor, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/347. #if defined(USE_WINDOWS_GDIPLUS) // Path + Super Rect = Not Path and Super Rect. verifyCombinePathWithPath (path, superPath, CombineModeXor, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); // Path + Sub Rect = Not Sub Rect and Rect. verifyCombinePathWithPath (path, subPath, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); // Path + Intersect Left = Not (Rect and Intersect Left). verifyCombinePathWithPath (path, intersectLeftPath, CombineModeXor, 0, 20, 40, 40, FALSE, FALSE, intersectLeftScans, sizeof (intersectLeftScans)); // Path + Intersect Top = Not (Rect and Intersect Top). verifyCombinePathWithPath (path, intersectTopPath, CombineModeXor, 10, 10, 30, 50, FALSE, FALSE, intersectTopScans, sizeof (intersectTopScans)); // Path + Intersect Right = Not (Rect and Intersect Right). verifyCombinePathWithPath (path, intersectRightPath, CombineModeXor, 10, 20, 40, 40, FALSE, FALSE, intersectRightScans, sizeof (intersectRightScans)); // Path + Intersect Bottom = Not (Rect and Intersect Bottom). verifyCombinePathWithPath (path, intersectBottomPath, CombineModeXor, 10, 20, 30, 50, FALSE, FALSE, intersectBottomScans, sizeof (intersectBottomScans)); // Path + Intersect Top Left = Not (Rect and Intersect Top Left). verifyCombinePathWithPath (path, intersectTopLeftPath, CombineModeXor, 0, 10, 40, 50, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Not (Rect and Intersect Top Right). verifyCombinePathWithPath (path, intersectTopRightPath, CombineModeXor, 10, 10, 40, 50, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Not (Rect and Intersect Bottom Right). verifyCombinePathWithPath (path, intersectBottomRightPath, CombineModeXor, 10, 20, 40, 50, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Not (Rect and Intersect Bottom Left). verifyCombinePathWithPath (path, intersectBottomLeftPath, CombineModeXor, 0, 20, 40, 50, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Both. verifyCombinePathWithPath (path, touchingLeftPath, CombineModeXor, -20, 20, 60, 40, FALSE, FALSE, touchingLeftScans, sizeof (touchingLeftScans)); // Path + Touching Top = Both. verifyCombinePathWithPath (path, touchingTopPath, CombineModeXor, 10, -20, 30, 80, FALSE, FALSE, touchingTopScans, sizeof (touchingTopScans)); // Path + Touching Right = Both. verifyCombinePathWithPath (path, touchingRightPath, CombineModeXor, 10, 20, 60, 40, FALSE, FALSE, touchingRightScans, sizeof (touchingRightScans)); // Path + Touching Bottom = Both. verifyCombinePathWithPath (path, touchingBottomPath, CombineModeXor, 10, 20, 30, 80, FALSE, FALSE, touchingBottomScans, sizeof (touchingBottomScans)); // Path + Touching Top Left = Both. verifyCombinePathWithPath (path, touchingTopLeftPath, CombineModeXor, -20, -20, 60, 80, FALSE, FALSE, touchingTopLeftScans, sizeof (touchingTopLeftScans)); // Path + Touching Top Right = Both. verifyCombinePathWithPath (path, touchingTopRightPath, CombineModeXor, 10, -20, 60, 80, FALSE, FALSE, touchingTopRightScans, sizeof (touchingTopRightScans)); // Path + Touching Bottom Right = Both. verifyCombinePathWithPath (path, touchingBottomRightPath, CombineModeXor, 10, 20, 60, 80, FALSE, FALSE, touchingBottomRightScans, sizeof (touchingBottomRightScans)); // Path + Touching Bottom Left = Both. verifyCombinePathWithPath (path, touchingBottomLeftPath, CombineModeXor, -20, 20, 60, 80, FALSE, FALSE, touchingBottomLeftScans, sizeof (touchingBottomLeftScans)); // Path + No Intersect Left = Both. verifyCombinePathWithPath (path, noIntersectLeftPath, CombineModeXor, -21, 20, 61, 40, FALSE, FALSE, noIntersectLeftScans, sizeof (noIntersectLeftScans)); // Path + No Intersect Top = Both. verifyCombinePathWithPath (path, noIntersectTopPath, CombineModeXor, 10, -21, 30, 81, FALSE, FALSE, noIntersectTopScans, sizeof (noIntersectTopScans)); // Path + No Intersect Right = Both. verifyCombinePathWithPath (path, noIntersectRightPath, CombineModeXor, 10, 20, 61, 40, FALSE, FALSE, noIntersectRightScans, sizeof (noIntersectRightScans)); // Path + No Intersect Bottom = Both. verifyCombinePathWithPath (path, noIntersectBottomPath, CombineModeXor, 10, 20, 30, 81, FALSE, FALSE, noIntersectBottomScans, sizeof (noIntersectBottomScans)); // Path + No Intersect Top Left = Both. verifyCombinePathWithPath (path, noIntersectTopLeftPath, CombineModeXor, -21, -21, 61, 81, FALSE, FALSE, noIntersectTopLeftScans, sizeof (noIntersectTopLeftScans)); // Path + No Intersect Top Right = Both. verifyCombinePathWithPath (path, noIntersectTopRightPath, CombineModeXor, 10, -21, 61, 81, FALSE, FALSE, noIntersectTopRightScans, sizeof (noIntersectTopRightScans)); // Path + No Intersect Bottom Right = Both. verifyCombinePathWithPath (path, noIntersectBottomRightPath, CombineModeXor, 10, 20, 61, 81, FALSE, FALSE, noIntersectBottomRightScans, sizeof (noIntersectBottomRightScans)); // Path + No Intersect Bottom Left = Both. verifyCombinePathWithPath (path, noIntersectBottomLeftPath, CombineModeXor, -21, 20, 61, 81, FALSE, FALSE, noIntersectBottomLeftScans, sizeof (noIntersectBottomLeftScans)); #endif GdipDeleteRegion (infiniteRegion); GdipDeleteRegion (emptyRegion); GdipDeleteRegion (rectRegion); GdipDeleteRegion (pathRegion); GdipDeletePath (path); GdipDeletePath (superPath); GdipDeletePath (subPath); GdipDeletePath (intersectLeftPath); GdipDeletePath (intersectTopPath); GdipDeletePath (intersectRightPath); GdipDeletePath (intersectBottomPath); GdipDeletePath (intersectTopLeftPath); GdipDeletePath (intersectTopRightPath); GdipDeletePath (intersectBottomRightPath); GdipDeletePath (intersectBottomLeftPath); GdipDeletePath (touchingLeftPath); GdipDeletePath (touchingTopPath); GdipDeletePath (touchingRightPath); GdipDeletePath (touchingBottomPath); GdipDeletePath (touchingTopLeftPath); GdipDeletePath (touchingTopRightPath); GdipDeletePath (touchingBottomRightPath); GdipDeletePath (touchingBottomLeftPath); GdipDeletePath (noIntersectLeftPath); GdipDeletePath (noIntersectTopPath); GdipDeletePath (noIntersectRightPath); GdipDeletePath (noIntersectBottomPath); GdipDeletePath (noIntersectTopLeftPath); GdipDeletePath (noIntersectTopRightPath); GdipDeletePath (noIntersectBottomRightPath); GdipDeletePath (noIntersectBottomLeftPath); GdipDeletePath (emptyPath); GdipDeletePath (infinitePath); GdipDeletePath (negativePath); } static void test_combineExclude () { GpRegion *infiniteRegion; GpRegion *emptyRegion; GpRegion *rectRegion; GpRegion *pathRegion; GdipCreateRegion (&infiniteRegion); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); RectF rect = {10, 20, 30, 40}; RectF superRect = {0, 10, 50, 60}; RectF subRect = {15, 25, 20, 30}; RectF intersectLeftRect = {0, 20, 30, 40}; RectF intersectTopRect = {10, 10, 30, 40}; RectF intersectRightRect = {20, 20, 30, 40}; RectF intersectBottomRect = {10, 30, 30, 40}; RectF intersectTopLeftRect = {0, 10, 30, 40}; RectF intersectTopRightRect = {20, 10, 30, 40}; RectF intersectBottomRightRect = {20, 30, 30, 40}; RectF intersectBottomLeftRect = {0, 30, 30, 40}; RectF touchingLeftRect = {-20, 20, 30, 40}; RectF touchingTopRect = {10, -20, 30, 40}; RectF touchingRightRect = {40, 20, 30, 40}; RectF touchingBottomRect = {10, 60, 30, 40}; RectF touchingTopLeftRect = {-20, -20, 30, 40}; RectF touchingTopRightRect = {40, -20, 30, 40}; RectF touchingBottomRightRect = {40, 60, 30, 40}; RectF touchingBottomLeftRect = {-20, 60, 30, 40}; RectF noIntersectLeftRect = {-21, 20, 30, 40}; RectF noIntersectTopRect = {10, -21, 30, 40}; RectF noIntersectRightRect = {41, 20, 30, 40}; RectF noIntersectBottomRect = {10, 61, 30, 40}; RectF noIntersectTopLeftRect = {-21, -21, 30, 40}; RectF noIntersectTopRightRect = {41, -21, 30, 40}; RectF noIntersectBottomRightRect = {41, 61, 30, 40}; RectF noIntersectBottomLeftRect = {-21, 61, 30, 40}; RectF emptyRect = {0, 0, 0, 0}; RectF infiniteRect = {-4194304, -4194304, 8388608, 8388608}; RectF negativeRect = {20, 30, -10, -10}; GdipCreateRegionRect (&rect, &rectRegion); GpPath *path = createPathFromRect (&rect); GpPath *superPath = createPathFromRect (&superRect); GpPath *subPath = createPathFromRect (&subRect); GpPath *intersectLeftPath = createPathFromRect (&intersectLeftRect); GpPath *intersectTopPath = createPathFromRect (&intersectTopRect); GpPath *intersectRightPath = createPathFromRect (&intersectRightRect); GpPath *intersectBottomPath = createPathFromRect (&intersectBottomRect); GpPath *intersectTopLeftPath = createPathFromRect (&intersectTopLeftRect); GpPath *intersectTopRightPath = createPathFromRect (&intersectTopRightRect); GpPath *intersectBottomRightPath = createPathFromRect (&intersectBottomRightRect); GpPath *intersectBottomLeftPath = createPathFromRect (&intersectBottomLeftRect); GpPath *touchingLeftPath = createPathFromRect (&touchingLeftRect); GpPath *touchingTopPath = createPathFromRect (&touchingTopRect); GpPath *touchingRightPath = createPathFromRect (&touchingRightRect); GpPath *touchingBottomPath = createPathFromRect (&touchingBottomRect); GpPath *touchingTopLeftPath = createPathFromRect (&touchingTopLeftRect); GpPath *touchingTopRightPath = createPathFromRect (&touchingTopRightRect); GpPath *touchingBottomRightPath = createPathFromRect (&touchingBottomRightRect); GpPath *touchingBottomLeftPath = createPathFromRect (&touchingBottomLeftRect); GpPath *noIntersectLeftPath = createPathFromRect (&noIntersectLeftRect); GpPath *noIntersectTopPath = createPathFromRect (&noIntersectTopRect); GpPath *noIntersectRightPath = createPathFromRect (&noIntersectRightRect); GpPath *noIntersectBottomPath = createPathFromRect (&noIntersectBottomRect); GpPath *noIntersectTopLeftPath = createPathFromRect (&noIntersectTopLeftRect); GpPath *noIntersectTopRightPath = createPathFromRect (&noIntersectTopRightRect); GpPath *noIntersectBottomRightPath = createPathFromRect (&noIntersectBottomRightRect); GpPath *noIntersectBottomLeftPath = createPathFromRect (&noIntersectBottomLeftRect); GpPath *emptyPath = createPathFromRect (&emptyRect); GpPath *infinitePath = createPathFromRect (&infiniteRect); GpPath *negativePath = createPathFromRect (&negativeRect); GdipCreateRegionPath (path, &pathRegion); // Infinite + Infinite = Empty verifyCombineInfiniteWithRegion (infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Empty = Infinite. verifyCombineInfiniteWithRegion (emptyRegion, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Infinite Rect = Empty verifyCombineInfiniteWithRect (&infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Empty Rect = Infinite. verifyCombineInfiniteWithRect (&emptyRect, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Rect = Not Rect. RectF infiniteWithRectScans[] = { {-4194304, -4194304, 8388608, 4194324}, {-4194304, 20, 4194314, 40}, {40, 20, 4194264, 40}, {-4194304, 60, 8388608, 4194244} }; verifyCombineInfiniteWithRect (&rect, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Infinite + Negative Rect = Infinite. { GpRegion *region; GdipCreateRegion (®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF infiniteWithNegativeRectScans[] = { {-4194304, -4194304, 8388608, 4194324}, {-4194304, 20, 4194314, 10}, {20, 20, 4194284, 10}, {-4194304, 30, 8388608, 4194274} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeExclude); verifyRegion (clone, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE); verifyRegionScans (clone, infiniteWithNegativeRectScans, sizeof (infiniteWithNegativeRectScans)); GdipDeleteRegion (clone); } // Infinite + Infinite Path = Empty // FIXME: should be empty: https://github.com/mono/libgdiplus/issues/352 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineInfiniteWithPath (infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Infinite + Empty Path = Infinite. verifyCombineInfiniteWithPath (emptyPath, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite + Path = Not Path. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/349 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineInfiniteWithPath (path, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Empty + Infinite = Empty. verifyCombineEmptyWithRegion (infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Empty = Empty. verifyCombineEmptyWithRegion (emptyRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Rect = Empty. verifyCombineEmptyWithRect (&infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Empty Rect = Empty. verifyCombineEmptyWithRect (&emptyRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Rect = Rect. verifyCombineEmptyWithRect (&rect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Path = Empty. verifyCombineEmptyWithPath (infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Empty Path = Empty. verifyCombineEmptyWithPath (emptyPath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Path = Path. verifyCombineEmptyWithPath (path, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Infinite = Empty. verifyCombineRectWithRegion (&infiniteRect, infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Empty = Infinite. verifyCombineRectWithRegion (&infiniteRect, emptyRegion, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Infinite Rect = Empty. verifyCombineRectWithRect (&infiniteRect, &infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Empty Rect = Infinite. verifyCombineRectWithRect (&infiniteRect, &emptyRect, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Rect = Not Rect. verifyCombineRectWithRect (&infiniteRect, &rect, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Infinite Rect + Negative Rect = Infinite. { GpRegion *region; GdipCreateRegionRect (&infiniteRect, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF infiniteWithNegativeRectScans[] = { {-4194304, -4194304, 8388608, 4194324}, {-4194304, 20, 4194314, 10}, {20, 20, 4194284, 10}, {-4194304, 30, 8388608, 4194274} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeExclude); verifyRegion (clone, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE); verifyRegionScans (clone, infiniteWithNegativeRectScans, sizeof (infiniteWithNegativeRectScans)); GdipDeleteRegion (clone); } // Infinite Rect + Infinite Path = Empty. // FIXME: should be empty: https://github.com/mono/libgdiplus/issues/352 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&infiniteRect, infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Infinite Rect + Empty Path = Infinite. verifyCombineRectWithPath (&infiniteRect, emptyPath, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Rect + Path = Not Path. #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&infiniteRect, path, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Empty Rect + Infinite = Empty. verifyCombineRectWithRegion (&emptyRect, infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Empty = Empty. verifyCombineRectWithRegion (&emptyRect, emptyRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Rect = Empty. verifyCombineRectWithRect (&emptyRect, &infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Empty Rect = Empty. verifyCombineRectWithRect (&emptyRect, &emptyRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Rect = Empty. verifyCombineRectWithRect (&emptyRect, &rect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Path = Empty. verifyCombineRectWithPath (&emptyRect, infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Empty Path = Empty. verifyCombineRectWithPath (&emptyRect, emptyPath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Path = Empty. verifyCombineRectWithPath (&emptyRect, path, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Infinite = Empty. verifyCombineRectWithRegion (&rect, infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Empty = Rect. verifyCombineRectWithRegion (&rect, emptyRegion, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite Rect = Empty. verifyCombineRectWithRect (&rect, &infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Empty Rect = Rect. verifyCombineRectWithRect (&rect, &emptyRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Negative Rect = Rect. { GpRegion *region; GdipCreateRegionRect (&rect, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeXor, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF rectWithNegativeRectScans[] = { {20, 20, 20, 10}, {10, 30, 30, 30} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeXor); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); verifyRegionScans (clone, rectWithNegativeRectScans, sizeof (rectWithNegativeRectScans)); GdipDeleteRegion (clone); } // Rect + Equal Rect = Empty. verifyCombineRectWithRect (&rect, &rect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Super Rect = Empty. verifyCombineRectWithRect (&rect, &superRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Sub Rect = Not Sub Rect and Rect. RectF subScans[] = { {10, 20, 30, 5}, {10, 25, 5, 30}, {35, 25, 5, 30}, {10, 55, 30, 5} }; verifyCombineRectWithRect (&rect, &subRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); // Rect + Intersect Left = Rect and Not Intersect Left. RectF intersectLeftScan = {30, 20, 10, 40}; verifyCombineRectWithRect (&rect, &intersectLeftRect, CombineModeExclude, 30, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Rect and Not Intersect Top. RectF intersectTopScan = {10, 50, 30, 10}; verifyCombineRectWithRect (&rect, &intersectTopRect, CombineModeExclude, 10, 50, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Rect and Not Intersect Right. RectF intersectRightScan = {10, 20, 10, 40}; verifyCombineRectWithRect (&rect, &intersectRightRect, CombineModeExclude, 10, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Rect and Not Intersect Bottom. RectF intersectBottomScan = {10, 20, 30, 10}; verifyCombineRectWithRect (&rect, &intersectBottomRect, CombineModeExclude, 10, 20, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Rect and Not Intersect Top Left. RectF intersectTopLeftScans[] = { {30, 20, 10, 30}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Rect and Not Intersect Top Right. RectF intersectTopRightScans[] = { {10, 20, 10, 30}, {10, 50, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectTopRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Rect and Not Intersect Bottom Right. RectF intersectBottomRightScans[] = { {10, 20, 30, 10}, {10, 30, 10, 30} }; verifyCombineRectWithRect (&rect, &intersectBottomRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Rect and Not Intersect Bottom Left. RectF intersectBottomLeftScans[] = { {10, 20, 30, 10}, {30, 30, 10, 30} }; verifyCombineRectWithRect (&rect, &intersectBottomLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Rect. verifyCombineRectWithRect (&rect, &touchingLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Top = Rect. verifyCombineRectWithRect (&rect, &touchingTopRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Right = Rect. verifyCombineRectWithRect (&rect, &touchingRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Bottom = Rect. verifyCombineRectWithRect (&rect, &touchingBottomRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Top Left = Rect. verifyCombineRectWithRect (&rect, &touchingTopLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Top Right = Rect. // FIXME: should not be empty: https://github.com/mono/libgdiplus/issues/351 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithRect (&rect, &touchingTopRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); #endif // Rect + Touching Bottom Right = Rect. verifyCombineRectWithRect (&rect, &touchingBottomRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Bottom Left = Rect. verifyCombineRectWithRect (&rect, &touchingBottomLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Left = Rect. verifyCombineRectWithRect (&rect, &noIntersectLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Top = Rect. verifyCombineRectWithRect (&rect, &noIntersectTopRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Right = Rect. verifyCombineRectWithRect (&rect, &noIntersectRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Bottom = Rect. verifyCombineRectWithRect (&rect, &noIntersectBottomRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Top Left = Rect. verifyCombineRectWithRect (&rect, &noIntersectTopLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Top Right = Rect. // FIXME: incorrectly empty: #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithRect (&rect, &noIntersectTopRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); #endif // Rect + No Intersect Bottom Right = Rect. verifyCombineRectWithRect (&rect, &noIntersectBottomRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Bottom Left = Rect. verifyCombineRectWithRect (&rect, &noIntersectBottomLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite Path = Empty. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Rect + Empty Path = Rect. verifyCombineRectWithPath (&rect, emptyPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Negative Path = Rect. { GpRegion *region; GdipCreateRegionRect (&rect, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a path region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); GdipDeleteRegion (region2); /* Second, test combining with an actual path. */ RectF rectWithNegativePathScans[] = { {20, 20, 20, 10}, {10, 30, 30, 30} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeExclude); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); verifyRegionScans (clone, rectWithNegativePathScans, sizeof (rectWithNegativePathScans)); GdipDeleteRegion (clone); } // Rect + Equal Path = Empty. verifyCombineRectWithPath (&rect, path, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Super Path = Empty. verifyCombineRectWithPath (&rect, superPath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Sub Path = Rect and Not Sub Path. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/354 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, subPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); #endif // Rect + Intersect Left = Rect and Not Intersect Left. verifyCombineRectWithPath (&rect, intersectLeftPath, CombineModeExclude, 30, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Rect and Not Intersect Top. verifyCombineRectWithPath (&rect, intersectTopPath, CombineModeExclude, 10, 50, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Rect and Not Intersect Right. verifyCombineRectWithPath (&rect, intersectRightPath, CombineModeExclude, 10, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Rect and Not Intersect Bottom. verifyCombineRectWithPath (&rect, intersectBottomPath, CombineModeExclude, 10, 20, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Rect and Not Intersect Top Left. verifyCombineRectWithPath (&rect, intersectTopLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Rect and Not Intersect Top Right. verifyCombineRectWithPath (&rect, intersectTopRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Rect and Not Intersect Bottom Right. verifyCombineRectWithPath (&rect, intersectBottomRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Rect and Not Intersect Bottom Left. verifyCombineRectWithPath (&rect, intersectBottomLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Rect. verifyCombineRectWithPath (&rect, touchingLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Top = Rect. verifyCombineRectWithPath (&rect, touchingTopPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Right = Rect. verifyCombineRectWithPath (&rect, touchingRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Bottom = Rect. verifyCombineRectWithPath (&rect, touchingBottomPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Top Left = Rect. verifyCombineRectWithPath (&rect, touchingTopLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Top Right = Rect. verifyCombineRectWithPath (&rect, touchingTopRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Bottom Right = Rect. verifyCombineRectWithPath (&rect, touchingBottomRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Touching Bottom Left = Rect. verifyCombineRectWithPath (&rect, touchingBottomLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Left = Rect. verifyCombineRectWithPath (&rect, noIntersectLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Top = Rect. verifyCombineRectWithPath (&rect, noIntersectTopPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Right = Rect. verifyCombineRectWithPath (&rect, noIntersectRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Bottom = Rect. verifyCombineRectWithPath (&rect, noIntersectBottomPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Top Left = Rect. verifyCombineRectWithPath (&rect, noIntersectTopLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Top Right = Rect. verifyCombineRectWithPath (&rect, noIntersectTopRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Bottom Right = Rect. verifyCombineRectWithPath (&rect, noIntersectBottomRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + No Intersect Bottom Left = Rect. verifyCombineRectWithPath (&rect, noIntersectBottomLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) // Infinite Path + Infinite = Empty. verifyCombinePathWithRegion (infinitePath, infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty = Infinite. verifyCombinePathWithRegion (infinitePath, emptyRegion, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Infinite Rect = Empty. verifyCombinePathWithRect (infinitePath, &infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty Rect = Infinite. verifyCombinePathWithRect (infinitePath, &emptyRect, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Rect = Not Rect. verifyCombinePathWithRect (infinitePath, &rect, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); // Infinite Path + Infinite Path = Empty. verifyCombinePathWithPath (infinitePath, infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty Path = Infinite. verifyCombinePathWithPath (infinitePath, emptyPath, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Infinite Path + Path = Not Path. verifyCombinePathWithPath (infinitePath, path, CombineModeExclude, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, infiniteWithRectScans, sizeof (infiniteWithRectScans)); #endif // Empty Path + Infinite = Empty. verifyCombinePathWithRegion (emptyPath, infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Empty = Empty. verifyCombinePathWithRegion (emptyPath, emptyRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Rect = Empty. verifyCombinePathWithRect (emptyPath, &infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Empty Rect = Empty. verifyCombinePathWithRect (emptyPath, &emptyRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Rect = Empty. verifyCombinePathWithRect (emptyPath, &rect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Path = Empty. verifyCombinePathWithPath (emptyPath, infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Empty Path = Empty. verifyCombinePathWithPath (emptyPath, emptyPath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Path = Empty. verifyCombinePathWithPath (emptyPath, path, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Infinite = Empty. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRegion (path, infiniteRegion, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Path + Empty = Rect. verifyCombinePathWithRegion (path, emptyRegion, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite Rect = Empty. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &infiniteRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Path + Empty Rect = Path. verifyCombinePathWithRect (path, &emptyRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Negative Rect = Path. { GpRegion *region; GdipCreateRegionPath (path, ®ion); GpRegion *clone; GdipCloneRegion (region, &clone); /* First, test combining with a rect region. */ GpRegion *region2; GdipCreateRegionRect (&negativeRect, ®ion2); verifyCombineRegionWithRegion (region, region2, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); GdipDeleteRegion (region2); /* Second, test combining with an actual rect. */ RectF rectWithNegativeRectScans[] = { {20, 20, 20, 10}, {10, 30, 30, 30} }; GdipCombineRegionRect (clone, &negativeRect, CombineModeExclude); verifyRegion (clone, 10, 20, 30, 40, FALSE, FALSE); verifyRegionScans (clone, rectWithNegativeRectScans, sizeof (rectWithNegativeRectScans)); GdipDeleteRegion (clone); } // Path + Equal Rect = Empty. verifyCombinePathWithRect (path, &rect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Super Rect = Empty. verifyCombinePathWithRect (path, &superRect, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Sub Rect = Path and Not Sub Rect. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/354 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &subRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); #endif // Path + Intersect Left = Path and Not Intersect Left. verifyCombinePathWithRect (path, &intersectLeftRect, CombineModeExclude, 30, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Path and Not Intersect Top. verifyCombinePathWithRect (path, &intersectTopRect, CombineModeExclude, 10, 50, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Path and Not Intersect Right. verifyCombinePathWithRect (path, &intersectRightRect, CombineModeExclude, 10, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Path and Not Intersect Bottom. verifyCombinePathWithRect (path, &intersectBottomRect, CombineModeExclude, 10, 20, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Path and Not Intersect Top Left. verifyCombinePathWithRect (path, &intersectTopLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Path and Not Intersect Top Right. verifyCombinePathWithRect (path, &intersectTopRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Path and Not Intersect Bottom Right. verifyCombinePathWithRect (path, &intersectBottomRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Path and Not BottomLeft.. verifyCombinePathWithRect (path, &intersectBottomLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Path. verifyCombinePathWithRect (path, &touchingLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Top = Path. verifyCombinePathWithRect (path, &touchingTopRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Right = Path. verifyCombinePathWithRect (path, &touchingRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Bottom = Path. verifyCombinePathWithRect (path, &touchingBottomRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Top Left = Path. verifyCombinePathWithRect (path, &touchingTopLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Top Right = Path. verifyCombinePathWithRect (path, &touchingTopRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Bottom Right = Path. verifyCombinePathWithRect (path, &touchingBottomRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Bottom Left = Path. verifyCombinePathWithRect (path, &touchingBottomLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Left = Path. verifyCombinePathWithRect (path, &noIntersectLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Top = Path. verifyCombinePathWithRect (path, &noIntersectTopRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Right = Path. verifyCombinePathWithRect (path, &noIntersectRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Bottom = Path. verifyCombinePathWithRect (path, &noIntersectBottomRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Top Left = Path. verifyCombinePathWithRect (path, &noIntersectTopLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Top Right = Path. verifyCombinePathWithRect (path, &noIntersectTopRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Bottom Right = Path. verifyCombinePathWithRect (path, &noIntersectBottomRightRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Bottom Left = Path. verifyCombinePathWithRect (path, &noIntersectBottomLeftRect, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite Path = Empty. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, infinitePath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); #endif // Path + Empty Path = Path. verifyCombinePathWithPath (path, emptyPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Negative Path = Path. verifyCombinePathWithPath (path, negativePath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Equal Path = Empty. verifyCombinePathWithPath (path, path, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Super Path = Empty. verifyCombinePathWithPath (path, superPath, CombineModeExclude, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Sub Path = Path and Not Sub Path. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/354 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, subPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, subScans, sizeof (subScans)); #endif // Path + Intersect Left = Path and Not Intersect Left. verifyCombinePathWithPath (path, intersectLeftPath, CombineModeExclude, 30, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Path and Not Intersect Top. verifyCombinePathWithPath (path, intersectTopPath, CombineModeExclude, 10, 50, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Path and Not Intersect Right. verifyCombinePathWithPath (path, intersectRightPath, CombineModeExclude, 10, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Path and Not Intersect Bottom. verifyCombinePathWithPath (path, intersectBottomPath, CombineModeExclude, 10, 20, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Path and Not Intersect Top Left. verifyCombinePathWithPath (path, intersectTopLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Path and Not Intersect Top Right. verifyCombinePathWithPath (path, intersectTopRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Path and Not Intersect Bottom Right. verifyCombinePathWithPath (path, intersectBottomRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Path and Not Intersect Bottom Left. verifyCombinePathWithPath (path, intersectBottomLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Path. verifyCombinePathWithPath (path, touchingLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Top = Path. verifyCombinePathWithPath (path, touchingTopPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Right = Path. verifyCombinePathWithPath (path, touchingRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Bottom = Path. verifyCombinePathWithPath (path, touchingBottomPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Top Left = Path. verifyCombinePathWithPath (path, touchingTopLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Top Right = Path. verifyCombinePathWithPath (path, touchingTopRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Bottom Right = Path. verifyCombinePathWithPath (path, touchingBottomRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Touching Bottom Left = Path. verifyCombinePathWithPath (path, touchingBottomLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Left = Path. verifyCombinePathWithPath (path, noIntersectLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Top = Path. verifyCombinePathWithPath (path, noIntersectTopPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Right = Path. verifyCombinePathWithPath (path, noIntersectRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Bottom = Path. verifyCombinePathWithPath (path, noIntersectBottomPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Top Left = Path. verifyCombinePathWithPath (path, noIntersectTopLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Top Right = Path. verifyCombinePathWithPath (path, noIntersectTopRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Bottom Right = Path. verifyCombinePathWithPath (path, noIntersectBottomRightPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + No Intersect Bottom Left = Path. verifyCombinePathWithPath (path, noIntersectBottomLeftPath, CombineModeExclude, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); GdipDeleteRegion (infiniteRegion); GdipDeleteRegion (emptyRegion); GdipDeleteRegion (rectRegion); GdipDeleteRegion (pathRegion); GdipDeletePath (path); GdipDeletePath (superPath); GdipDeletePath (subPath); GdipDeletePath (intersectLeftPath); GdipDeletePath (intersectTopPath); GdipDeletePath (intersectRightPath); GdipDeletePath (intersectBottomPath); GdipDeletePath (intersectTopLeftPath); GdipDeletePath (intersectTopRightPath); GdipDeletePath (intersectBottomRightPath); GdipDeletePath (intersectBottomLeftPath); GdipDeletePath (touchingLeftPath); GdipDeletePath (touchingTopPath); GdipDeletePath (touchingRightPath); GdipDeletePath (touchingBottomPath); GdipDeletePath (touchingTopLeftPath); GdipDeletePath (touchingTopRightPath); GdipDeletePath (touchingBottomRightPath); GdipDeletePath (touchingBottomLeftPath); GdipDeletePath (noIntersectLeftPath); GdipDeletePath (noIntersectTopPath); GdipDeletePath (noIntersectRightPath); GdipDeletePath (noIntersectBottomPath); GdipDeletePath (noIntersectTopLeftPath); GdipDeletePath (noIntersectTopRightPath); GdipDeletePath (noIntersectBottomRightPath); GdipDeletePath (noIntersectBottomLeftPath); GdipDeletePath (emptyPath); GdipDeletePath (infinitePath); GdipDeletePath (negativePath); } static void test_combineComplement () { GpRegion *infiniteRegion; GpRegion *emptyRegion; GpRegion *rectRegion; GpRegion *pathRegion; GdipCreateRegion (&infiniteRegion); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); RectF rect = {10, 20, 30, 40}; RectF superRect = {0, 10, 50, 60}; RectF subRect = {15, 25, 20, 30}; RectF intersectLeftRect = {0, 20, 30, 40}; RectF intersectTopRect = {10, 10, 30, 40}; RectF intersectRightRect = {20, 20, 30, 40}; RectF intersectBottomRect = {10, 30, 30, 40}; RectF intersectTopLeftRect = {0, 10, 30, 40}; RectF intersectTopRightRect = {20, 10, 30, 40}; RectF intersectBottomRightRect = {20, 30, 30, 40}; RectF intersectBottomLeftRect = {0, 30, 30, 40}; RectF touchingLeftRect = {-20, 20, 30, 40}; RectF touchingTopRect = {10, -20, 30, 40}; RectF touchingRightRect = {40, 20, 30, 40}; RectF touchingBottomRect = {10, 60, 30, 40}; RectF touchingTopLeftRect = {-20, -20, 30, 40}; RectF touchingTopRightRect = {40, -20, 30, 40}; RectF touchingBottomRightRect = {40, 60, 30, 40}; RectF touchingBottomLeftRect = {-20, 60, 30, 40}; RectF noIntersectLeftRect = {-21, 20, 30, 40}; RectF noIntersectTopRect = {10, -21, 30, 40}; RectF noIntersectRightRect = {41, 20, 30, 40}; RectF noIntersectBottomRect = {10, 61, 30, 40}; RectF noIntersectTopLeftRect = {-21, -21, 30, 40}; RectF noIntersectTopRightRect = {41, -21, 30, 40}; RectF noIntersectBottomRightRect = {41, 61, 30, 40}; RectF noIntersectBottomLeftRect = {-21, 61, 30, 40}; RectF emptyRect = {0, 0, 0, 0}; RectF infiniteRect = {-4194304, -4194304, 8388608, 8388608}; RectF negativeRect = {20, 30, -10, -10}; GdipCreateRegionRect (&rect, &rectRegion); GpPath *path = createPathFromRect (&rect); GpPath *superPath = createPathFromRect (&superRect); GpPath *subPath = createPathFromRect (&subRect); GpPath *intersectLeftPath = createPathFromRect (&intersectLeftRect); GpPath *intersectTopPath = createPathFromRect (&intersectTopRect); GpPath *intersectRightPath = createPathFromRect (&intersectRightRect); GpPath *intersectBottomPath = createPathFromRect (&intersectBottomRect); GpPath *intersectTopLeftPath = createPathFromRect (&intersectTopLeftRect); GpPath *intersectTopRightPath = createPathFromRect (&intersectTopRightRect); GpPath *intersectBottomRightPath = createPathFromRect (&intersectBottomRightRect); GpPath *intersectBottomLeftPath = createPathFromRect (&intersectBottomLeftRect); GpPath *touchingLeftPath = createPathFromRect (&touchingLeftRect); GpPath *touchingTopPath = createPathFromRect (&touchingTopRect); GpPath *touchingRightPath = createPathFromRect (&touchingRightRect); GpPath *touchingBottomPath = createPathFromRect (&touchingBottomRect); GpPath *touchingTopLeftPath = createPathFromRect (&touchingTopLeftRect); GpPath *touchingTopRightPath = createPathFromRect (&touchingTopRightRect); GpPath *touchingBottomRightPath = createPathFromRect (&touchingBottomRightRect); GpPath *touchingBottomLeftPath = createPathFromRect (&touchingBottomLeftRect); GpPath *noIntersectLeftPath = createPathFromRect (&noIntersectLeftRect); GpPath *noIntersectTopPath = createPathFromRect (&noIntersectTopRect); GpPath *noIntersectRightPath = createPathFromRect (&noIntersectRightRect); GpPath *noIntersectBottomPath = createPathFromRect (&noIntersectBottomRect); GpPath *noIntersectTopLeftPath = createPathFromRect (&noIntersectTopLeftRect); GpPath *noIntersectTopRightPath = createPathFromRect (&noIntersectTopRightRect); GpPath *noIntersectBottomRightPath = createPathFromRect (&noIntersectBottomRightRect); GpPath *noIntersectBottomLeftPath = createPathFromRect (&noIntersectBottomLeftRect); GpPath *emptyPath = createPathFromRect (&emptyRect); GpPath *infinitePath = createPathFromRect (&infiniteRect); GpPath *negativePath = createPathFromRect (&negativeRect); GdipCreateRegionPath (path, &pathRegion); // Infinite + Infinite = Empty verifyCombineInfiniteWithRegion (infiniteRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Empty = Empty. verifyCombineInfiniteWithRegion (emptyRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Infinite Rect = Empty verifyCombineInfiniteWithRect (&infiniteRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Empty Rect = Empty. verifyCombineInfiniteWithRect (&emptyRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Rect = Empty. verifyCombineInfiniteWithRect (&rect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Negative Rect = Empty. verifyCombineInfiniteWithRect (&negativeRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Infinite Path = Empty verifyCombineInfiniteWithPath (infinitePath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Empty Path = Empty. verifyCombineInfiniteWithPath (emptyPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite + Path = Empty verifyCombineInfiniteWithPath (path, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite = Empty. verifyCombineEmptyWithRegion (infiniteRegion, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty = Empty. verifyCombineEmptyWithRegion (emptyRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Infinite Rect = Empty. verifyCombineEmptyWithRect (&infiniteRect, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty + Empty Rect = Empty. verifyCombineEmptyWithRect (&emptyRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Rect = Rect. verifyCombineEmptyWithRect (&rect, CombineModeComplement, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty + Infinite Path = Empty. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/414 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineEmptyWithPath (infinitePath, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty + Empty Path = Empty. verifyCombineEmptyWithPath (emptyPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty + Path = Path. verifyCombineEmptyWithPath (path, CombineModeComplement, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Infinite Rect + Infinite = Empty. verifyCombineRectWithRegion (&infiniteRect, infiniteRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Empty = Empty. verifyCombineRectWithRegion (&infiniteRect, emptyRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Infinite Rect = Empty. verifyCombineRectWithRect (&infiniteRect, &infiniteRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Empty Rect = Empty. verifyCombineRectWithRect (&infiniteRect, &emptyRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Rect = Empty. verifyCombineRectWithRect (&infiniteRect, &rect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Infinite Path = Empty. verifyCombineRectWithPath (&infiniteRect, infinitePath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Empty Path = Empty. verifyCombineRectWithPath (&infiniteRect, emptyPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Rect + Path = Empty. verifyCombineRectWithPath (&infiniteRect, path, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite = Infinite. verifyCombineRectWithRegion (&emptyRect, infiniteRegion, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Empty = Empty. verifyCombineRectWithRegion (&emptyRect, emptyRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Infinite Rect = Infinite. verifyCombineRectWithRect (&emptyRect, &infiniteRect, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Rect + Empty Rect = Empty. verifyCombineRectWithRect (&emptyRect, &emptyRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Rect = Rect. verifyCombineRectWithRect (&emptyRect, &rect, CombineModeComplement, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Rect + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/414 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&emptyRect, infinitePath, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty Rect + Empty Path = Empty. verifyCombineRectWithPath (&emptyRect, emptyPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Rect + Path = Path. verifyCombineRectWithPath (&emptyRect, path, CombineModeComplement, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Rect + Infinite = Empty. RectF rectWithInfiniteScans[] = { {-4194304, -4194304, 8388608, 4194324}, {-4194304, 20, 4194314, 40}, {40, 20, 4194264, 40}, {-4194304, 60, 8388608, 4194244} }; verifyCombineRectWithRegion (&rect, infiniteRegion, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, rectWithInfiniteScans, sizeof (rectWithInfiniteScans)); // Rect + Empty = Empty. verifyCombineRectWithRegion (&rect, emptyRegion, CombineModeComplement, 0, 0,0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Infinite Rect = Empty. verifyCombineRectWithRect (&rect, &infiniteRect, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, rectWithInfiniteScans, sizeof (rectWithInfiniteScans)); // Rect + Empty Rect = Empty. verifyCombineRectWithRect (&rect, &emptyRect, CombineModeComplement, 0, 0,0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Negative Rect = Empty. verifyCombineRectWithRect (&rect, &negativeRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Equal Rect = Empty. verifyCombineRectWithRect (&rect, &rect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Super Rect = Not Rect and Super Rect. RectF superScans[] = { {0, 10, 50, 10}, {0, 20, 10, 40}, {40, 20, 10, 40}, {0, 60, 50, 10} }; verifyCombineRectWithRect (&rect, &superRect, CombineModeComplement, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); // Rect + Sub Rect = Empty verifyCombineRectWithRect (&rect, &subRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Intersect Left = Not Rect and Intersect Left. RectF intersectLeftScan = {0, 20, 10, 40}; verifyCombineRectWithRect (&rect, &intersectLeftRect, CombineModeComplement, 0, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Not Rect and Intersect Top. RectF intersectTopScan = {10, 10, 30, 10}; verifyCombineRectWithRect (&rect, &intersectTopRect, CombineModeComplement, 10, 10, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Not Rect and Intersect Right. RectF intersectRightScan = {40, 20, 10, 40}; verifyCombineRectWithRect (&rect, &intersectRightRect, CombineModeComplement, 40, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Not Rect and Intersect Bottom. RectF intersectBottomScan = {10, 60, 30, 10}; verifyCombineRectWithRect (&rect, &intersectBottomRect, CombineModeComplement, 10, 60, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Not Rect and Intersect Top Left. RectF intersectTopLeftScans[] = { {0, 10, 30, 10}, {0, 20, 10, 30} }; verifyCombineRectWithRect (&rect, &intersectTopLeftRect, CombineModeComplement, 0, 10, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Not Rect and Intersect Top Right. RectF intersectTopRightScans[] = { {20, 10, 30, 10}, {40, 20, 10, 30} }; verifyCombineRectWithRect (&rect, &intersectTopRightRect, CombineModeComplement, 20, 10, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Not Rect and Intersect Bottom Right. RectF intersectBottomRightScans[] = { {40, 30, 10, 30}, {20, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomRightRect, CombineModeComplement, 20, 30, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Not Rect and Intersect Bottom Left. RectF intersectBottomLeftScans[] = { {0, 30, 10, 30}, {0, 60, 30, 10} }; verifyCombineRectWithRect (&rect, &intersectBottomLeftRect, CombineModeComplement, 0, 30, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Touching Left. verifyCombineRectWithRect (&rect, &touchingLeftRect, CombineModeComplement, -20, 20, 30, 40, FALSE, FALSE, &touchingLeftRect, sizeof (touchingLeftRect)); // Rect + Touching Top = Touching Top. verifyCombineRectWithRect (&rect, &touchingTopRect, CombineModeComplement, 10, -20, 30, 40, FALSE, FALSE, &touchingTopRect, sizeof (touchingTopRect)); // Rect + Touching Right = Touching Right. verifyCombineRectWithRect (&rect, &touchingRightRect, CombineModeComplement, 40, 20, 30, 40, FALSE, FALSE, &touchingRightRect, sizeof (touchingRightRect)); // Rect + Touching Bottom = Touching Bottom. verifyCombineRectWithRect (&rect, &touchingBottomRect, CombineModeComplement, 10, 60, 30, 40, FALSE, FALSE, &touchingBottomRect, sizeof (touchingBottomRect)); // Rect + Touching Top Left = Touching Top Left. verifyCombineRectWithRect (&rect, &touchingTopLeftRect, CombineModeComplement, -20, -20, 30, 40, FALSE, FALSE, &touchingTopLeftRect, sizeof (touchingTopLeftRect)); // Rect + Touching Top Right = Touching Top Right. verifyCombineRectWithRect (&rect, &touchingTopRightRect, CombineModeComplement, 40, -20, 30, 40, FALSE, FALSE, &touchingTopRightRect, sizeof (touchingTopRightRect)); // Rect + Touching Bottom Right = Touching Bottom Right. verifyCombineRectWithRect (&rect, &touchingBottomRightRect, CombineModeComplement, 40, 60, 30, 40, FALSE, FALSE, &touchingBottomRightRect, sizeof (touchingBottomRightRect)); // Rect + Touching Bottom Left = Touching Bottom Left. // FIXME: should be touchingBottomLeftRect: https://github.com/mono/libgdiplus/issues/357 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithRect (&rect, &touchingBottomLeftRect, CombineModeComplement, -20, 60, 30, 40, FALSE, FALSE, &touchingBottomLeftRect, sizeof (touchingBottomLeftRect)); #endif // Rect + No Intersect Left = No Intersect Left. verifyCombineRectWithRect (&rect, &noIntersectLeftRect, CombineModeComplement, -21, 20, 30, 40, FALSE, FALSE, &noIntersectLeftRect, sizeof (noIntersectLeftRect)); // Rect + No Intersect Top = No Intersect Top. verifyCombineRectWithRect (&rect, &noIntersectTopRect, CombineModeComplement, 10, -21, 30, 40, FALSE, FALSE, &noIntersectTopRect, sizeof (noIntersectTopRect)); // Rect + No Intersect Right = No Intersect Right. verifyCombineRectWithRect (&rect, &noIntersectRightRect, CombineModeComplement, 41, 20, 30, 40, FALSE, FALSE, &noIntersectRightRect, sizeof (noIntersectRightRect)); // Rect + No Intersect Bottom = No Intersect Bottom. verifyCombineRectWithRect (&rect, &noIntersectBottomRect, CombineModeComplement, 10, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRect, sizeof (noIntersectBottomRect)); // Rect + No Intersect Top Left = No Intersect Top Left. verifyCombineRectWithRect (&rect, &noIntersectTopLeftRect, CombineModeComplement, -21, -21, 30, 40, FALSE, FALSE, &noIntersectTopLeftRect, sizeof (noIntersectTopLeftRect)); // Rect + No Intersect Top Right = No Intersect Top Right. verifyCombineRectWithRect (&rect, &noIntersectTopRightRect, CombineModeComplement, 41, -21, 30, 40, FALSE, FALSE, &noIntersectTopRightRect, sizeof (noIntersectTopRightRect)); // Rect + No Intersect Bottom Right = No Intersect Bottom Right. verifyCombineRectWithRect (&rect, &noIntersectBottomRightRect, CombineModeComplement, 41, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRightRect, sizeof (noIntersectBottomRightRect)); // Rect + No Intersect Bottom Left = No Intersect Bottom Left. verifyCombineRectWithRect (&rect, &noIntersectBottomLeftRect, CombineModeComplement, -21, 61, 30, 40, FALSE, FALSE, &noIntersectBottomLeftRect, sizeof (noIntersectBottomLeftRect)); // Rect + Infinite Path = Infinite. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, infinitePath, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, rectWithInfiniteScans, sizeof (rectWithInfiniteScans)); #endif // Rect + Empty Path = Empty. verifyCombineRectWithPath (&rect, emptyPath, CombineModeComplement, 0, 0,0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Negative Path = Empty. verifyCombineRectWithPath (&rect, negativePath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Equal Path = Empty. verifyCombineRectWithPath (&rect, path, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Super Path = Not Rect and Super Path. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/358 #if defined(USE_WINDOWS_GDIPLUS) verifyCombineRectWithPath (&rect, superPath, CombineModeComplement, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); #endif // Rect + Sub Path = Empty verifyCombineRectWithPath (&rect, subPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Rect + Intersect Left = Not Rect and Intersect Left. verifyCombineRectWithPath (&rect, intersectLeftPath, CombineModeComplement, 0, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Rect + Intersect Top = Not Rect and Intersect Top. verifyCombineRectWithPath (&rect, intersectTopPath, CombineModeComplement, 10, 10, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Rect + Intersect Right = Not Rect and Intersect Right. verifyCombineRectWithPath (&rect, intersectRightPath, CombineModeComplement, 40, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Rect + Intersect Bottom = Not Rect and Intersect Bottom. verifyCombineRectWithPath (&rect, intersectBottomPath, CombineModeComplement, 10, 60, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Rect + Intersect Top Left = Not Rect and Intersect Top Left. verifyCombineRectWithPath (&rect, intersectTopLeftPath, CombineModeComplement, 0, 10, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Rect + Intersect Top Right = Not Rect and Intersect Top Right. verifyCombineRectWithPath (&rect, intersectTopRightPath, CombineModeComplement, 20, 10, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Right = Not Rect and Intersect Bottom Right. verifyCombineRectWithPath (&rect, intersectBottomRightPath, CombineModeComplement, 20, 30, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Rect + Intersect Bottom Left = Not Rect and Intersect Bottom Left. verifyCombineRectWithPath (&rect, intersectBottomLeftPath, CombineModeComplement, 0, 30, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Rect + Touching Left = Touching Left. verifyCombineRectWithPath (&rect, touchingLeftPath, CombineModeComplement, -20, 20, 30, 40, FALSE, FALSE, &touchingLeftRect, sizeof (touchingLeftRect)); // Rect + Touching Top = Touching Top. verifyCombineRectWithPath (&rect, touchingTopPath, CombineModeComplement, 10, -20, 30, 40, FALSE, FALSE, &touchingTopRect, sizeof (touchingTopRect)); // Rect + Touching Right = Touching Right. verifyCombineRectWithPath (&rect, touchingRightPath, CombineModeComplement, 40, 20, 30, 40, FALSE, FALSE, &touchingRightRect, sizeof (touchingRightRect)); // Rect + Touching Bottom = Touching Bottom. verifyCombineRectWithPath (&rect, touchingBottomPath, CombineModeComplement, 10, 60, 30, 40, FALSE, FALSE, &touchingBottomRect, sizeof (touchingBottomRect)); // Rect + Touching Top Left = Touching Top Left. verifyCombineRectWithPath (&rect, touchingTopLeftPath, CombineModeComplement, -20, -20, 30, 40, FALSE, FALSE, &touchingTopLeftRect, sizeof (touchingTopLeftRect)); // Rect + Touching Top Right = Touching Top Right. verifyCombineRectWithPath (&rect, touchingTopRightPath, CombineModeComplement, 40, -20, 30, 40, FALSE, FALSE, &touchingTopRightRect, sizeof (touchingTopRightRect)); // Rect + Touching Bottom Right = Touching Bottom Right. verifyCombineRectWithPath (&rect, touchingBottomRightPath, CombineModeComplement, 40, 60, 30, 40, FALSE, FALSE, &touchingBottomRightRect, sizeof (touchingBottomRightRect)); // Rect + Touching Bottom Left = Touching Bottom Left. verifyCombineRectWithPath (&rect, touchingBottomLeftPath, CombineModeComplement, -20, 60, 30, 40, FALSE, FALSE, &touchingBottomLeftRect, sizeof (touchingBottomLeftRect)); // Rect + No Intersect Left = No Intersect Left. verifyCombineRectWithPath (&rect, noIntersectLeftPath, CombineModeComplement, -21, 20, 30, 40, FALSE, FALSE, &noIntersectLeftRect, sizeof (noIntersectLeftRect)); // Rect + No Intersect Top = No Intersect Top. verifyCombineRectWithPath (&rect, noIntersectTopPath, CombineModeComplement, 10, -21, 30, 40, FALSE, FALSE, &noIntersectTopRect, sizeof (noIntersectTopRect)); // Rect + No Intersect Right = No Intersect Right. verifyCombineRectWithPath (&rect, noIntersectRightPath, CombineModeComplement, 41, 20, 30, 40, FALSE, FALSE, &noIntersectRightRect, sizeof (noIntersectRightRect)); // Rect + No Intersect Bottom = No Intersect Bottom. verifyCombineRectWithPath (&rect, noIntersectBottomPath, CombineModeComplement, 10, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRect, sizeof (noIntersectBottomRect)); // Rect + No Intersect Top Left = No Intersect Top Left. verifyCombineRectWithPath (&rect, noIntersectTopLeftPath, CombineModeComplement, -21, -21, 30, 40, FALSE, FALSE, &noIntersectTopLeftRect, sizeof (noIntersectTopLeftRect)); // Rect + No Intersect Top Right = No Intersect Top Right. verifyCombineRectWithPath (&rect, noIntersectTopRightPath, CombineModeComplement, 41, -21, 30, 40, FALSE, FALSE, &noIntersectTopRightRect, sizeof (noIntersectTopRightRect)); // Rect + No Intersect Bottom Right = No Intersect Bottom Right. verifyCombineRectWithPath (&rect, noIntersectBottomRightPath, CombineModeComplement, 41, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRightRect, sizeof (noIntersectBottomRightRect)); // Rect + No Intersect Bottom Left = No Intersect Bottom Left. verifyCombineRectWithPath (&rect, noIntersectBottomLeftPath, CombineModeComplement, -21, 61, 30, 40, FALSE, FALSE, &noIntersectBottomLeftRect, sizeof (noIntersectBottomLeftRect)); // Path + Infinite = Infinite. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRegion (path, infiniteRegion, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, rectWithInfiniteScans, sizeof (rectWithInfiniteScans)); #endif // Path + Empty = Rect. verifyCombinePathWithRegion (path, emptyRegion, CombineModeComplement, 0, 0,0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Infinite = Empty. verifyCombinePathWithRegion (infinitePath, infiniteRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty = Empty. verifyCombinePathWithRegion (infinitePath, emptyRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Infinite Rect = Empty. verifyCombinePathWithRect (infinitePath, &infiniteRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty Rect = Empty. verifyCombinePathWithRect (infinitePath, &emptyRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Rect = Empty. verifyCombinePathWithRect (infinitePath, &rect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Infinite Path = Empty. verifyCombinePathWithPath (infinitePath, infinitePath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Empty Path = Empty. verifyCombinePathWithPath (infinitePath, emptyPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Infinite Path + Path = Empty. verifyCombinePathWithPath (infinitePath, path, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite = Infinite. verifyCombinePathWithRegion (emptyPath, infiniteRegion, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Empty = Empty. verifyCombinePathWithRegion (emptyPath, emptyRegion, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Infinite Rect = Infinite. verifyCombinePathWithRect (emptyPath, &infiniteRect, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); // Empty Path + Empty Rect = Empty. verifyCombinePathWithRect (emptyPath, &emptyRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Rect = Rect. verifyCombinePathWithRect (emptyPath, &rect, CombineModeComplement, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Empty Path + Infinite Path = Infinite. // FIXME: should have scans: https://github.com/mono/libgdiplus/issues/414 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (emptyPath, infinitePath, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE, infiniteScans, sizeof (infiniteScans)); #endif // Empty Path + Empty Path = Empty. verifyCombinePathWithPath (emptyPath, emptyPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Empty Path + Path = Path. verifyCombinePathWithPath (emptyPath, path, CombineModeComplement, 10, 20, 30, 40, FALSE, FALSE, &rect, sizeof (rect)); // Path + Infinite Rect = Empty. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &infiniteRect, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, rectWithInfiniteScans, sizeof (rectWithInfiniteScans)); #endif // Path + Empty Rect = Empty. verifyCombinePathWithRect (path, &emptyRect, CombineModeComplement, 0, 0,0, 0, TRUE, FALSE, emptyScans, 0); // Path + Negative Rect = Empty. verifyCombinePathWithRect (path, &negativeRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Equal Rect = Empty. verifyCombinePathWithRect (path, &rect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Super Rect = Not Rect and Super Rect. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/358 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithRect (path, &superRect, CombineModeComplement, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); #endif // Path + Sub Rect = Empty. verifyCombinePathWithRect (path, &subRect, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Intersect Left = Not Path and Intersect Left. verifyCombinePathWithRect (path, &intersectLeftRect, CombineModeComplement, 0, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Not Path and Intersect Top. verifyCombinePathWithRect (path, &intersectTopRect, CombineModeComplement, 10, 10, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Not Path and Intersect Right. verifyCombinePathWithRect (path, &intersectRightRect, CombineModeComplement, 40, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Not Path and Intersect Bottom. verifyCombinePathWithRect (path, &intersectBottomRect, CombineModeComplement, 10, 60, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Not Path and Intersect Top Left. verifyCombinePathWithRect (path, &intersectTopLeftRect, CombineModeComplement, 0, 10, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Not Path and Intersect Top Right. verifyCombinePathWithRect (path, &intersectTopRightRect, CombineModeComplement, 20, 10, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Not Path and Intersect Bottom Right. verifyCombinePathWithRect (path, &intersectBottomRightRect, CombineModeComplement, 20, 30, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Not Path and Intersect Bottom Left. verifyCombinePathWithRect (path, &intersectBottomLeftRect, CombineModeComplement, 0, 30, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Touching Left. verifyCombinePathWithRect (path, &touchingLeftRect, CombineModeComplement, -20, 20, 30, 40, FALSE, FALSE, &touchingLeftRect, sizeof (touchingLeftRect)); // Path + Touching Top = Touching Top. verifyCombinePathWithRect (path, &touchingTopRect, CombineModeComplement, 10, -20, 30, 40, FALSE, FALSE, &touchingTopRect, sizeof (touchingTopRect)); // Path + Touching Right = Touching Right. verifyCombinePathWithRect (path, &touchingRightRect, CombineModeComplement, 40, 20, 30, 40, FALSE, FALSE, &touchingRightRect, sizeof (touchingRightRect)); // Path + Touching Bottom = Touching Bottom. verifyCombinePathWithRect (path, &touchingBottomRect, CombineModeComplement, 10, 60, 30, 40, FALSE, FALSE, &touchingBottomRect, sizeof (touchingBottomRect)); // Path + Touching Top Left = Touching Top Left. verifyCombinePathWithRect (path, &touchingTopLeftRect, CombineModeComplement, -20, -20, 30, 40, FALSE, FALSE, &touchingTopLeftRect, sizeof (touchingTopLeftRect)); // Path + Touching Top Right = Touching Top Right. verifyCombinePathWithRect (path, &touchingTopRightRect, CombineModeComplement, 40, -20, 30, 40, FALSE, FALSE, &touchingTopRightRect, sizeof (touchingTopRightRect)); // Path + Touching Bottom Right = Touching Bottom Right. verifyCombinePathWithRect (path, &touchingBottomRightRect, CombineModeComplement, 40, 60, 30, 40, FALSE, FALSE, &touchingBottomRightRect, sizeof (touchingBottomRightRect)); // Path + Touching Bottom Left = Touching Bottom Left. verifyCombinePathWithRect (path, &touchingBottomLeftRect, CombineModeComplement, -20, 60, 30, 40, FALSE, FALSE, &touchingBottomLeftRect, sizeof (touchingBottomLeftRect)); // Path + No Intersect Left = No Intersect Left. verifyCombinePathWithRect (path, &noIntersectLeftRect, CombineModeComplement, -21, 20, 30, 40, FALSE, FALSE, &noIntersectLeftRect, sizeof (noIntersectLeftRect)); // Path + No Intersect Top = No Intersect Top. verifyCombinePathWithRect (path, &noIntersectTopRect, CombineModeComplement, 10, -21, 30, 40, FALSE, FALSE, &noIntersectTopRect, sizeof (noIntersectTopRect)); // Path + No Intersect Right = No Intersect Right. verifyCombinePathWithRect (path, &noIntersectRightRect, CombineModeComplement, 41, 20, 30, 40, FALSE, FALSE, &noIntersectRightRect, sizeof (noIntersectRightRect)); // Path + No Intersect Bottom = No Intersect Bottom. verifyCombinePathWithRect (path, &noIntersectBottomRect, CombineModeComplement, 10, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRect, sizeof (noIntersectBottomRect)); // Path + No Intersect Top Left = No Intersect Top Left. verifyCombinePathWithRect (path, &noIntersectTopLeftRect, CombineModeComplement, -21, -21, 30, 40, FALSE, FALSE, &noIntersectTopLeftRect, sizeof (noIntersectTopLeftRect)); // Path + No Intersect Top Right = No Intersect Top Right. verifyCombinePathWithRect (path, &noIntersectTopRightRect, CombineModeComplement, 41, -21, 30, 40, FALSE, FALSE, &noIntersectTopRightRect, sizeof (noIntersectTopRightRect)); // Path + No Intersect Bottom Right = No Intersect Bottom Right. verifyCombinePathWithRect (path, &noIntersectBottomRightRect, CombineModeComplement, 41, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRightRect, sizeof (noIntersectBottomRightRect)); // Path + No Intersect Bottom Left = No Intersect Bottom Left. verifyCombinePathWithRect (path, &noIntersectBottomLeftRect, CombineModeComplement, -21, 61, 30, 40, FALSE, FALSE, &noIntersectBottomLeftRect, sizeof (noIntersectBottomLeftRect)); // Path + Infinite Path = Calculate. // FIXME: this fails with OutOfMemory: https://github.com/mono/libgdiplus/issues/338 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, infinitePath, CombineModeComplement, -4194304, -4194304, 8388608, 8388608, FALSE, FALSE, rectWithInfiniteScans, sizeof (rectWithInfiniteScans)); #endif // Path + Empty Path = Empty. verifyCombinePathWithPath (path, emptyPath, CombineModeComplement, 0, 0,0, 0, TRUE, FALSE, emptyScans, 0); // Path + Negative Path = Empty. verifyCombinePathWithPath (path, negativePath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Equal Path = Empty. verifyCombinePathWithPath (path, path, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Super Path = Not Path and Super Path. // FIXME: incorrect scans: https://github.com/mono/libgdiplus/issues/358 #if defined(USE_WINDOWS_GDIPLUS) verifyCombinePathWithPath (path, superPath, CombineModeComplement, 0, 10, 50, 60, FALSE, FALSE, superScans, sizeof (superScans)); #endif // Path + Sub Path = Empty verifyCombinePathWithPath (path, subPath, CombineModeComplement, 0, 0, 0, 0, TRUE, FALSE, emptyScans, 0); // Path + Intersect Left = Not Path and Intersect Left. verifyCombinePathWithPath (path, intersectLeftPath, CombineModeComplement, 0, 20, 10, 40, FALSE, FALSE, &intersectLeftScan, sizeof (intersectLeftScan)); // Path + Intersect Top = Not Path and Intersect Top. verifyCombinePathWithPath (path, intersectTopPath, CombineModeComplement, 10, 10, 30, 10, FALSE, FALSE, &intersectTopScan, sizeof (intersectTopScan)); // Path + Intersect Right = Not Path and Intersect Right. verifyCombinePathWithPath (path, intersectRightPath, CombineModeComplement, 40, 20, 10, 40, FALSE, FALSE, &intersectRightScan, sizeof (intersectRightScan)); // Path + Intersect Bottom = Not Path and Intersect Bottom. verifyCombinePathWithPath (path, intersectBottomPath, CombineModeComplement, 10, 60, 30, 10, FALSE, FALSE, &intersectBottomScan, sizeof (intersectBottomScan)); // Path + Intersect Top Left = Not Path and Intersect Top Left. verifyCombinePathWithPath (path, intersectTopLeftPath, CombineModeComplement, 0, 10, 30, 40, FALSE, FALSE, intersectTopLeftScans, sizeof (intersectTopLeftScans)); // Path + Intersect Top Right = Not Path and Intersect Top Right. verifyCombinePathWithPath (path, intersectTopRightPath, CombineModeComplement, 20, 10, 30, 40, FALSE, FALSE, intersectTopRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Right = Not Path and Intersect Bottom Right. verifyCombinePathWithPath (path, intersectBottomRightPath, CombineModeComplement, 20, 30, 30, 40, FALSE, FALSE, intersectBottomRightScans, sizeof (intersectTopRightScans)); // Path + Intersect Bottom Left = Not Path and Intersect Bottom Left. verifyCombinePathWithPath (path, intersectBottomLeftPath, CombineModeComplement, 0, 30, 30, 40, FALSE, FALSE, intersectBottomLeftScans, sizeof (intersectBottomLeftScans)); // Path + Touching Left = Touching Left. verifyCombinePathWithPath (path, touchingLeftPath, CombineModeComplement, -20, 20, 30, 40, FALSE, FALSE, &touchingLeftRect, sizeof (touchingLeftRect)); // Path + Touching Top = Touching Top. verifyCombinePathWithPath (path, touchingTopPath, CombineModeComplement, 10, -20, 30, 40, FALSE, FALSE, &touchingTopRect, sizeof (touchingTopRect)); // Path + Touching Right = Touching Right. verifyCombinePathWithPath (path, touchingRightPath, CombineModeComplement, 40, 20, 30, 40, FALSE, FALSE, &touchingRightRect, sizeof (touchingRightRect)); // Path + Touching Bottom = Touching Bottom. verifyCombinePathWithPath (path, touchingBottomPath, CombineModeComplement, 10, 60, 30, 40, FALSE, FALSE, &touchingBottomRect, sizeof (touchingBottomRect)); // Path + Touching Top Left = Touching Top Left. verifyCombinePathWithPath (path, touchingTopLeftPath, CombineModeComplement, -20, -20, 30, 40, FALSE, FALSE, &touchingTopLeftRect, sizeof (touchingTopLeftRect)); // Path + Touching Top Right = Touching Top Right. verifyCombinePathWithPath (path, touchingTopRightPath, CombineModeComplement, 40, -20, 30, 40, FALSE, FALSE, &touchingTopRightRect, sizeof (touchingTopRightRect)); // Path + Touching Bottom Right = Touching Bottom Right. verifyCombinePathWithPath (path, touchingBottomRightPath, CombineModeComplement, 40, 60, 30, 40, FALSE, FALSE, &touchingBottomRightRect, sizeof (touchingBottomRightRect)); // Path + Touching Bottom Left = Touching Bottom Left. verifyCombinePathWithPath (path, touchingBottomLeftPath, CombineModeComplement, -20, 60, 30, 40, FALSE, FALSE, &touchingBottomLeftRect, sizeof (touchingBottomLeftRect)); // Path + No Intersect Left = No Intersect Left. verifyCombinePathWithPath (path, noIntersectLeftPath, CombineModeComplement, -21, 20, 30, 40, FALSE, FALSE, &noIntersectLeftRect, sizeof (noIntersectLeftRect)); // Path + No Intersect Top = No Intersect Top. verifyCombinePathWithPath (path, noIntersectTopPath, CombineModeComplement, 10, -21, 30, 40, FALSE, FALSE, &noIntersectTopRect, sizeof (noIntersectTopRect)); // Path + No Intersect Right = No Intersect Right. verifyCombinePathWithPath (path, noIntersectRightPath, CombineModeComplement, 41, 20, 30, 40, FALSE, FALSE, &noIntersectRightRect, sizeof (noIntersectRightRect)); // Path + No Intersect Bottom = No Intersect Bottom. verifyCombinePathWithPath (path, noIntersectBottomPath, CombineModeComplement, 10, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRect, sizeof (noIntersectBottomRect)); // Path + No Intersect Top Left = No Intersect Top Left. verifyCombinePathWithPath (path, noIntersectTopLeftPath, CombineModeComplement, -21, -21, 30, 40, FALSE, FALSE, &noIntersectTopLeftRect, sizeof (noIntersectTopLeftRect)); // Path + No Intersect Top Right = No Intersect Top Right. verifyCombinePathWithPath (path, noIntersectTopRightPath, CombineModeComplement, 41, -21, 30, 40, FALSE, FALSE, &noIntersectTopRightRect, sizeof (noIntersectTopRightRect)); // Path + No Intersect Bottom Right = No Intersect Bottom Right. verifyCombinePathWithPath (path, noIntersectBottomRightPath, CombineModeComplement, 41, 61, 30, 40, FALSE, FALSE, &noIntersectBottomRightRect, sizeof (noIntersectBottomRightRect)); // Path + No Intersect Bottom Left = No Intersect Bottom Left. verifyCombinePathWithPath (path, noIntersectBottomLeftPath, CombineModeComplement, -21, 61, 30, 40, FALSE, FALSE, &noIntersectBottomLeftRect, sizeof (noIntersectBottomLeftRect)); GdipDeleteRegion (infiniteRegion); GdipDeleteRegion (emptyRegion); GdipDeleteRegion (rectRegion); GdipDeleteRegion (pathRegion); GdipDeletePath (path); GdipDeletePath (superPath); GdipDeletePath (subPath); GdipDeletePath (intersectLeftPath); GdipDeletePath (intersectTopPath); GdipDeletePath (intersectRightPath); GdipDeletePath (intersectBottomPath); GdipDeletePath (intersectTopLeftPath); GdipDeletePath (intersectTopRightPath); GdipDeletePath (intersectBottomRightPath); GdipDeletePath (intersectBottomLeftPath); GdipDeletePath (touchingLeftPath); GdipDeletePath (touchingTopPath); GdipDeletePath (touchingRightPath); GdipDeletePath (touchingBottomPath); GdipDeletePath (touchingTopLeftPath); GdipDeletePath (touchingTopRightPath); GdipDeletePath (touchingBottomRightPath); GdipDeletePath (touchingBottomLeftPath); GdipDeletePath (noIntersectLeftPath); GdipDeletePath (noIntersectTopPath); GdipDeletePath (noIntersectRightPath); GdipDeletePath (noIntersectBottomPath); GdipDeletePath (noIntersectTopLeftPath); GdipDeletePath (noIntersectTopRightPath); GdipDeletePath (noIntersectBottomRightPath); GdipDeletePath (noIntersectBottomLeftPath); GdipDeletePath (emptyPath); GdipDeletePath (infinitePath); GdipDeletePath (negativePath); } static void test_translateRegion () { GpStatus status; GpPath *path; GpRegion *region; GpRectF infiniteRect = {-4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f}; GpRectF emptyRect = {0, 0, 0, 0}; GpRectF rect = {10, 20, 30, 40}; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); // Infinite rect region - zero, zero GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegion (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - positive, zero. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegion (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194294, -4194304, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - zero, positive. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegion (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194304, -4194284, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - positive, positive. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegion (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194294, -4194284, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - negative, negative. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegion (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, -4194324, -4194344, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Empty rect region - zero, zero GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegion (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - positive, zero. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegion (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, 10, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - zero, positive. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegion (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, 0, 20, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - positive, positive. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegion (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - negative, negative. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegion (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, -20, -40, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Rect region. GdipCreateRegionRect (&rect, ®ion); status = GdipTranslateRegion (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); status = GdipTranslateRegion (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, 20, 20, 30, 40, FALSE, FALSE); status = GdipTranslateRegion (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, 20, 40, 30, 40, FALSE, FALSE); status = GdipTranslateRegion (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, 30, 60, 30, 40, FALSE, FALSE); status = GdipTranslateRegion (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region. GdipCreateRegionPath (path, ®ion); status = GdipTranslateRegion (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); status = GdipTranslateRegion (region, 10, 0); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) // FIXME: translating a path region should not affect the bounds. verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); #endif status = GdipTranslateRegion (region, 0, 20); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) // FIXME: translating a path region should not affect the bounds. verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); #endif status = GdipTranslateRegion (region, 10, 20); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) // FIXME: translating a path region should not affect the bounds. verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); #endif status = GdipTranslateRegion (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipTranslateRegion (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegion (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegion (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegion (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegion (region, -10, -20); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipTranslateRegion (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegion (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegion (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegion (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegion (region, -10, -20); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Negative tests. status = GdipTranslateRegion (NULL, 0, 0); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); } static void test_translateRegionI () { GpStatus status; GpPath *path; GpRegion *region; GpRectF infiniteRect = {-4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f}; GpRectF emptyRect = {0, 0, 0, 0}; GpRectF rect = {10, 20, 30, 40}; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); // Infinite rect region - zero, zero GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegionI (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194304, -4194304, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - positive, zero. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegionI (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194294, -4194304, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - zero, positive. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegionI (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194304, -4194284, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - positive, positive. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegionI (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194294, -4194284, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - negative, negative. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTranslateRegionI (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, -4194324, -4194344, 8388608, 8388608, FALSE, TRUE); GdipDeleteRegion (region); // Empty rect region - zero, zero GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegionI (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - positive, zero. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegionI (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, 10, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - zero, positive. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegionI (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, 0, 20, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - positive, positive. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegionI (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - negative, negative. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTranslateRegionI (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, -20, -40, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Rect region. GdipCreateRegionRect (&rect, ®ion); status = GdipTranslateRegionI (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); status = GdipTranslateRegionI (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, 20, 20, 30, 40, FALSE, FALSE); status = GdipTranslateRegionI (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, 20, 40, 30, 40, FALSE, FALSE); status = GdipTranslateRegionI (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, 30, 60, 30, 40, FALSE, FALSE); status = GdipTranslateRegionI (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region. GdipCreateRegionPath (path, ®ion); status = GdipTranslateRegionI (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); status = GdipTranslateRegionI (region, 10, 0); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) // FIXME: translating a path region should not affect the bounds. verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); #endif status = GdipTranslateRegionI (region, 0, 20); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) // FIXME: translating a path region should not affect the bounds. verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); #endif status = GdipTranslateRegionI (region, 10, 20); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) // FIXME: translating a path region should not affect the bounds. verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); #endif status = GdipTranslateRegionI (region, -20, -40); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Empty region. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipTranslateRegionI (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegionI (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegionI (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegionI (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); status = GdipTranslateRegionI (region, -10, -20); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Infinite region. GdipCreateRegion (®ion); status = GdipTranslateRegionI (region, 0, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegionI (region, 10, 0); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegionI (region, 0, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegionI (region, 10, 20); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); status = GdipTranslateRegionI (region, -10, -20); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Negative tests. status = GdipTranslateRegionI (NULL, 0, 0); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); } static void test_transformRegion () { GpStatus status; GpPath *path; GpRegion *region; GpMatrix *emptyMatrix; GpMatrix *translateXMatrix; GpMatrix *translateXScaleXMatrix; GpMatrix *translateXScaleYMatrix; GpMatrix *translateXScaleXYMatrix; GpMatrix *translateYMatrix; GpMatrix *translateYScaleXMatrix; GpMatrix *translateYScaleYMatrix; GpMatrix *translateYScaleXYMatrix; GpMatrix *translateXYMatrix; GpMatrix *translateXYScaleXMatrix; GpMatrix *translateXYScaleYMatrix; GpMatrix *translateXYScaleXYMatrix; GpMatrix *scaleXMatrix; GpMatrix *scaleYMatrix; GpMatrix *scaleXYMatrix; GpMatrix *matrix; GpRectF infiniteRect = {-4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f}; GpRectF emptyRect = {0, 0, 0, 0}; GpRectF negativeWidthAndHeightRect = {10, 20, -30, -40}; GpRectF rect = {10, 20, 30, 40}; GdipCreatePath (FillModeWinding, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); GdipCreateMatrix (&emptyMatrix); GdipCreateMatrix (&translateXMatrix); GdipCreateMatrix (&translateYMatrix); GdipCreateMatrix (&translateXYMatrix); GdipCreateMatrix (&scaleXMatrix); GdipScaleMatrix (scaleXMatrix, 20, 1, MatrixOrderAppend); GdipCreateMatrix (&scaleYMatrix); GdipScaleMatrix (scaleYMatrix, 1, 20, MatrixOrderAppend); GdipCreateMatrix (&scaleXYMatrix); GdipScaleMatrix (scaleXYMatrix, 20, 20, MatrixOrderAppend); GdipTranslateMatrix (translateXMatrix, 10, 0, MatrixOrderAppend); GdipCreateMatrix (&translateXScaleXMatrix); GdipTranslateMatrix (translateXScaleXMatrix, 10, 0, MatrixOrderAppend); GdipScaleMatrix (translateXScaleXMatrix, 20, 1, MatrixOrderAppend); GdipCreateMatrix (&translateXScaleYMatrix); GdipTranslateMatrix (translateXScaleYMatrix, 10, 0, MatrixOrderAppend); GdipScaleMatrix (translateXScaleYMatrix, 1, 20, MatrixOrderAppend); GdipCreateMatrix (&translateXScaleXYMatrix); GdipTranslateMatrix (translateXScaleXYMatrix, 10, 0, MatrixOrderAppend); GdipScaleMatrix (translateXScaleXYMatrix, 20, 20, MatrixOrderAppend); GdipTranslateMatrix (translateYMatrix, 0, 10, MatrixOrderAppend); GdipCreateMatrix (&translateYScaleXMatrix); GdipTranslateMatrix (translateYScaleXMatrix, 0, 10, MatrixOrderAppend); GdipScaleMatrix (translateYScaleXMatrix, 20, 1, MatrixOrderAppend); GdipCreateMatrix (&translateYScaleYMatrix); GdipTranslateMatrix (translateYScaleYMatrix, 0, 10, MatrixOrderAppend); GdipScaleMatrix (translateYScaleYMatrix, 1, 20, MatrixOrderAppend); GdipCreateMatrix (&translateYScaleXYMatrix); GdipTranslateMatrix (translateYScaleXYMatrix, 0, 10, MatrixOrderAppend); GdipScaleMatrix (translateYScaleXYMatrix, 20, 20, MatrixOrderAppend); GdipTranslateMatrix (translateXYMatrix, 10, 10, MatrixOrderAppend); GdipCreateMatrix (&translateXYScaleXMatrix); GdipTranslateMatrix (translateXYScaleXMatrix, 10, 10, MatrixOrderAppend); GdipScaleMatrix (translateXYScaleXMatrix, 20, 1, MatrixOrderAppend); GdipCreateMatrix (&translateXYScaleYMatrix); GdipTranslateMatrix (translateXYScaleYMatrix, 10, 10, MatrixOrderAppend); GdipScaleMatrix (translateXYScaleYMatrix, 1, 20, MatrixOrderAppend); GdipCreateMatrix (&translateXYScaleXYMatrix); GdipTranslateMatrix (translateXYScaleXYMatrix, 10, 10, MatrixOrderAppend); GdipScaleMatrix (translateXYScaleXYMatrix, 20, 20, MatrixOrderAppend); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); // Infinite rect region - empty. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Infinite rect region - translate transform. GdipCreateRegionRect (&infiniteRect, ®ion); status = GdipTransformRegion (region, translateXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, -4194294.0f, -4194294.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Empty rect region - empty. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - translate transform. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTransformRegion (region, translateXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 10, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty rect region - complex transform. GdipCreateRegionRect (&emptyRect, ®ion); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Negative rect region - empty. GdipCreateRegionRect (&negativeWidthAndHeightRect, ®ion); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, -30, -40, TRUE, FALSE); GdipDeleteRegion (region); // Negative rect region - translate transform. GdipCreateRegionRect (&negativeWidthAndHeightRect, ®ion); status = GdipTransformRegion (region, translateXYMatrix); assertEqualInt (status, Ok); // FIXME: libgdiplus doesn't normalize. #if defined(USE_WINDOWS_GDIPLUS) verifyRegion (region, -10, -10, 30, 40, FALSE, FALSE); #endif GdipDeleteRegion (region); // Negative rect region - complex transform. GdipCreateRegionRect (&negativeWidthAndHeightRect, ®ion); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, -75, -114, 150, 220, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - empty transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 30, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x and y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 30, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - scale x transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, scaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 20, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - scale y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, scaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 400, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - scale x and y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, scaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 400, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x, scale x transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXScaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 20, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x, scale y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXScaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 400, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x, scale x and y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXScaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 400, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate y, scale x transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateYScaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 30, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate y, scale y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateYScaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 600, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate y, scale x and y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateYScaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 600, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x and y, scale x transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXYScaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 30, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x and y, scale y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXYScaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 600, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - translate x and y, scale x and y transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, translateXYScaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 600, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Rect region - complex transform. GdipCreateRegionRect (&rect, ®ion); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, 75, 106, 150, 220, FALSE, FALSE); GdipDeleteRegion (region); // Path region - empty transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 20, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 30, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x and y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 30, 30, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - scale x transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, scaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 20, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - scale y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, scaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 400, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - scale x and y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, scaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 400, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x, scale x transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXScaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 20, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x, scale y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXScaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 400, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x, scale x and y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXScaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 400, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate y, scale x transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateYScaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 30, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate y, scale y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateYScaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 10, 600, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate y, scale x and y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateYScaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 200, 600, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x and y, scale x transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXYScaleXMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 30, 600, 40, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x and y, scale y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXYScaleYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 20, 600, 30, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - translate x and y, scale x and y transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, translateXYScaleXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 400, 600, 600, 800, FALSE, FALSE); GdipDeleteRegion (region); // Path region - complex transform. GdipCreateRegionPath (path, ®ion); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, 75, 106, 150, 220, FALSE, FALSE); GdipDeleteRegion (region); // Empty region - empty transform. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty region - translate transform. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipTransformRegion (region, translateXYMatrix); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Empty region - complex transform. GdipCreateRegion (®ion); GdipSetEmpty (region); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, 0, 0, 0, 0, TRUE, FALSE); GdipDeleteRegion (region); // Infinite region - empty transform. GdipCreateRegion (®ion); status = GdipTransformRegion (region, emptyMatrix); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Infinite region - translate transform. GdipCreateRegion (®ion); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Infinite region - complex transform. GdipCreateRegion (®ion); status = GdipTransformRegion (region, matrix); assertEqualInt (status, Ok); verifyRegion (region, -4194304.0f, -4194304.0f, 8388608.0f, 8388608.0f, FALSE, TRUE); GdipDeleteRegion (region); // Negative tests. status = GdipTransformRegion (NULL, matrix); assertEqualInt (status, InvalidParameter); status = GdipTransformRegion (region, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); GdipDeleteMatrix (translateXMatrix); GdipDeleteMatrix (translateYMatrix); GdipDeleteMatrix (translateXYMatrix); GdipDeleteMatrix (scaleXMatrix); GdipDeleteMatrix (scaleYMatrix); GdipDeleteMatrix (scaleXYMatrix); GdipDeleteMatrix (translateXScaleXMatrix); GdipDeleteMatrix (translateXScaleYMatrix); GdipDeleteMatrix (translateXScaleXYMatrix); GdipDeleteMatrix (translateYScaleXMatrix); GdipDeleteMatrix (translateYScaleYMatrix); GdipDeleteMatrix (translateYScaleXYMatrix); GdipDeleteMatrix (translateXYScaleXMatrix); GdipDeleteMatrix (translateXYScaleYMatrix); GdipDeleteMatrix (translateXYScaleXYMatrix); GdipDeleteMatrix (emptyMatrix); GdipDeleteMatrix (matrix); } int main (int argc, char**argv) { STARTUP; GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat32bppRGB, NULL, (GpBitmap **) &image); GdipGetImageGraphicsContext (image, &graphics); test_createRegion (); test_createRegionRect (); test_createRegionRectI (); test_createRegionPath (); test_createRegionRgnData (); test_getRegionData (); test_getRegionDataReplace (); test_getRegionDataUnion (); test_getRegionDataComplement (); test_getRegionDataSize (); test_cloneRegion (); test_deleteRegion (); test_setInfinite (); test_setEmpty (); test_getRegionBounds (); test_isEmptyRegion (); test_isEqualRegion (); test_isInfiniteRegion (); test_isVisibleRegionPoint (); test_isVisibleRegionPointI (); test_isVisibleRegionRect (); test_isVisibleRegionRectI (); test_getRegionScansCount (); test_getRegionScans (); test_getRegionScansI (); test_combineReplace (); test_combineIntersect (); test_combineUnion (); test_combineXor (); test_combineExclude (); test_combineComplement (); test_translateRegion (); test_translateRegionI (); test_transformRegion (); GdipDisposeImage (image); GdipDeleteGraphics (graphics); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testpen.c0000644000175000017500000020007713542674535020332 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static GpImage * getImage () { GpStatus status; GpBitmap *image; status = GdipCreateBitmapFromScan0 (100, 68, 0, PixelFormat32bppRGB, NULL, &image); assertEqualInt (status, Ok); return (GpImage *)image; } static void verifyPen (GpPen *pen, REAL expectedWidth, Unit expectedUnit, PenType expectedType) { assert (pen && "Expected the pen to be initalized."); GpStatus status; REAL width; GpUnit unit; PenType type; LineJoin lineJoin; PenAlignment mode; GpBrush *brush; BrushType brushType; LineCap startCap; LineCap endCap; DashCap dashCap; DashStyle dashStyle; GpCustomLineCap *customStartCap; GpCustomLineCap *customEndCap; REAL miterLimit; GpMatrix *transform; INT dashCount; REAL dashOffset; INT compoundCount; GdipCreateMatrix (&transform); status = GdipGetPenWidth (pen, &width); assertEqualInt (status, Ok); assertEqualFloat (width, expectedWidth); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, expectedUnit); status = GdipGetPenFillType (pen, &type); assertEqualInt (status, Ok); assertEqualInt (type, expectedType); status = GdipGetPenLineJoin (pen, &lineJoin); assertEqualInt (status, Ok); assertEqualInt (lineJoin, LineJoinMiter); status = GdipGetPenMode (pen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, PenAlignmentCenter); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); status = GdipGetBrushType (brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, (BrushType)expectedType); status = GdipGetPenStartCap (pen, &startCap); assertEqualInt (status, Ok); assertEqualInt (startCap, LineCapFlat); status = GdipGetPenEndCap (pen, &endCap); assertEqualInt (status, Ok); assertEqualInt (endCap, LineCapFlat); status = GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (status, Ok); assertEqualInt (dashCap, DashCapFlat); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleSolid); status = GdipGetPenCustomStartCap (pen, &customStartCap); assertEqualInt (status, Ok); assert (!customStartCap); status = GdipGetPenCustomEndCap (pen, &customEndCap); assertEqualInt (status, Ok); assert (!customEndCap); status = GdipGetPenMiterLimit (pen, &miterLimit); assertEqualInt (status, Ok); assertEqualFloat (miterLimit, 10); status = GdipGetPenTransform (pen, transform); assertEqualInt (status, Ok); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 0); status = GdipGetPenDashOffset (pen, &dashOffset); assertEqualInt (status, Ok); assertEqualFloat (dashOffset, 0); status = GdipGetPenCompoundCount (pen, &compoundCount); assertEqualInt (status, Ok); assertEqualInt (compoundCount, 0); GdipDeleteMatrix (transform); GdipDeleteBrush (brush); } static void verifySolidBrushPen (GpPen *pen, ARGB expectedColor, REAL expectedWidth, Unit expectedUnit) { GpStatus status; ARGB color; verifyPen (pen, expectedWidth, expectedUnit, PenTypeSolidColor); status = GdipGetPenColor (pen, &color); assertEqualInt (status, Ok); assertEqualInt (color, expectedColor); } static void verifyNonSolidBrushPen (GpPen *pen, REAL expectedWidth, Unit expectedUnit, PenType expectedType) { GpStatus status; ARGB color; verifyPen (pen, expectedWidth, expectedUnit, expectedType); status = GdipGetPenColor (pen, &color); assertEqualInt (status, InvalidParameter); } static void test_createPen1 () { GpStatus status; GpPen *pen; status = GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 10, UnitWorld); GdipDeletePen (pen); status = GdipCreatePen1 (0x00000001, 0, UnitPixel, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 0, UnitPixel); GdipDeletePen (pen); status = GdipCreatePen1 (0x00000001, -1, UnitPoint, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, -1, UnitPoint); GdipDeletePen (pen); status = GdipCreatePen1 (0x00000001, 10, UnitInch, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 10, UnitInch); GdipDeletePen (pen); status = GdipCreatePen1 (0x00000001, 10, UnitDocument, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 10, UnitDocument); GdipDeletePen (pen); status = GdipCreatePen1 (0x00000001, 10, UnitMillimeter, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 10, UnitMillimeter); GdipDeletePen (pen); #if !defined(USE_WINDOWS_GDIPLUS) status = GdipCreatePen1 (0x00000001, 10, UnitCairoPoint, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 10, UnitCairoPoint); GdipDeletePen (pen); #endif // Negative tests. pen = (GpPen *) 0xCC; status = GdipCreatePen1 (0x00000001, 10, (Unit)(UnitWorld - 1), &pen); assertEqualInt (status, InvalidParameter); assert (pen == (GpPen *) 0xCC); pen = (GpPen *) 0xCC; status = GdipCreatePen1 (0x00000001, 10, UnitDisplay, &pen); assertEqualInt (status, InvalidParameter); assert (pen == (GpPen *) 0xCC); #if defined(USE_WINDOWS_GDIPLUS) pen = (GpPen *) 0xCC; status = GdipCreatePen1 (0x00000001, 10, (Unit)(UnitMillimeter + 1), &pen); assertEqualInt (status, InvalidParameter); assert (pen == (GpPen *) 0xCC); #else pen = (GpPen *) 0xCC; status = GdipCreatePen1 (0x00000001, 10, (Unit)(UnitCairoPoint + 1), &pen); assertEqualInt (status, InvalidParameter); assert (pen == (GpPen *) 0xCC); #endif pen = (GpPen *) 0xCC; status = GdipCreatePen1 (0x00000001, 10, UnitWorld, NULL); assertEqualInt (status, InvalidParameter); assert (pen == (GpPen *) 0xCC); } static GpPointF threePoints[3] = { {3, 13}, {1, 2}, {5, 6} }; static void test_createPen2 () { GpStatus status; GpSolidFill *solidBrush; GpHatch *hatchBrush; GpImage *image; GpTexture *textureBrush; GpPathGradient *pathGradientBrush; GpRectF rect = {1, 2, 3, 4}; GpLineGradient *lineGradientBrush; GpPen *pen; GdipCreateSolidFill (1, &solidBrush); GdipCreateHatchBrush (HatchStyle05Percent, 1, 2, &hatchBrush); image = getImage (); GdipCreateTexture (image, WrapModeTile, &textureBrush); GdipCreatePathGradient (threePoints, 3, WrapModeTileFlipX, &pathGradientBrush); GdipCreateLineBrushFromRect (&rect, 1, 2, LinearGradientModeBackwardDiagonal, WrapModeTileFlipX, &lineGradientBrush); // SolidBrush/UnitWorld. status = GdipCreatePen2 (solidBrush, 10, UnitWorld, &pen); assertEqualInt (status, Ok); verifySolidBrushPen (pen, 1, 10, UnitWorld); GdipDeletePen (pen); // HatchFill/UnitPixel status = GdipCreatePen2 (hatchBrush, 0, UnitPixel, &pen); assertEqualInt (status, Ok); verifyNonSolidBrushPen (pen, 0, UnitPixel, PenTypeHatchFill); GdipDeletePen (pen); // TextureFill/UnitPoint status = GdipCreatePen2 (textureBrush, -1, UnitPoint, &pen); assertEqualInt (status, Ok); verifyNonSolidBrushPen (pen, -1, UnitPoint, PenTypeTextureFill); GdipDeletePen (pen); // PathGradient/UnitInch. status = GdipCreatePen2 (pathGradientBrush, 10, UnitInch, &pen); assertEqualInt (status, Ok); verifyNonSolidBrushPen (pen, 10, UnitInch, PenTypePathGradient); GdipDeletePen (pen); // LineGradient/UnitDocument. status = GdipCreatePen2 (lineGradientBrush, 10, UnitDocument, &pen); assertEqualInt (status, Ok); verifyNonSolidBrushPen (pen, 10, UnitDocument, PenTypeLinearGradient); GdipDeletePen (pen); // LinearGradient/UnitDocument. status = GdipCreatePen2 (lineGradientBrush, 10, UnitMillimeter, &pen); assertEqualInt (status, Ok); verifyNonSolidBrushPen (pen, 10, UnitMillimeter, PenTypeLinearGradient); GdipDeletePen (pen); #if !defined(USE_WINDOWS_GDIPLUS) // LinearGradient/UnitCairoPoint. status = GdipCreatePen2 (lineGradientBrush, 10, UnitCairoPoint, &pen); assertEqualInt (status, Ok); verifyNonSolidBrushPen (pen, 10, UnitCairoPoint, PenTypeLinearGradient); GdipDeletePen (pen); #endif // Negative tests. status = GdipCreatePen2 (NULL, 10, UnitPixel, &pen); assertEqualInt (status, InvalidParameter); status = GdipCreatePen2 (solidBrush, 10, UnitDisplay, &pen); assertEqualInt (status, InvalidParameter); #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreatePen2 (solidBrush, 10, (Unit)(UnitMillimeter + 1), &pen); assertEqualInt (status, InvalidParameter); #else status = GdipCreatePen2 (solidBrush, 10, (Unit)(UnitCairoPoint + 1), &pen); assertEqualInt (status, InvalidParameter); #endif status = GdipCreatePen2 (solidBrush, 10, UnitPixel, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) solidBrush); GdipDeleteBrush ((GpBrush *) hatchBrush); GdipDisposeImage (image); GdipDeleteBrush ((GpBrush *) textureBrush); GdipDeleteBrush ((GpBrush *) pathGradientBrush); GdipDeleteBrush ((GpBrush *) lineGradientBrush); } static void test_clone () { GpStatus status; GpPen *pen; GpPen *clone; GdipCreatePen1 (0x00000001, 10, UnitDocument, &pen); status = GdipClonePen (pen, &clone); assertEqualInt (status, Ok); verifySolidBrushPen (clone, 1, 10, UnitDocument); // Negative tests. status = GdipClonePen (NULL, &clone); assertEqualInt (status, InvalidParameter); status = GdipClonePen (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeletePen (clone); } static void test_getPenWidth () { GpStatus status; GpPen *pen; REAL width; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenWidth (NULL, &width); assertEqualInt (status, InvalidParameter); status = GdipGetPenWidth (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenWidth () { GpStatus status; GpPen *pen; REAL width; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Positive value. status = GdipSetPenWidth (pen, 10); assertEqualInt (status, Ok); status = GdipGetPenWidth (pen, &width); assertEqualInt (status, Ok); assertEqualFloat (width, 10); // Same value. status = GdipSetPenWidth (pen, 10); assertEqualInt (status, Ok); status = GdipGetPenWidth (pen, &width); assertEqualInt (status, Ok); assertEqualFloat (width, 10); // Zero value. status = GdipSetPenWidth (pen, 0); assertEqualInt (status, Ok); status = GdipGetPenWidth (pen, &width); assertEqualInt (status, Ok); assertEqualFloat (width, 0); // Negative value. status = GdipSetPenWidth (pen, -1); assertEqualInt (status, Ok); status = GdipGetPenWidth (pen, &width); assertEqualInt (status, Ok); assertEqualFloat (width, -1); // Negative tests. status = GdipSetPenWidth (NULL, 10); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenUnit () { GpStatus status; GpPen *pen; Unit unit; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenUnit (NULL, &unit); assertEqualInt (status, InvalidParameter); status = GdipGetPenUnit (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenUnit () { GpStatus status; GpPen *pen; Unit unit; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // UnitWorld. status = GdipSetPenUnit (pen, UnitWorld); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitWorld); // Same unit. status = GdipSetPenUnit (pen, UnitWorld); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitWorld); // UnitPixel. status = GdipSetPenUnit (pen, UnitPixel); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitPixel); // UnitPoint. status = GdipSetPenUnit (pen, UnitPoint); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitPoint); // UnitInch. status = GdipSetPenUnit (pen, UnitInch); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitInch); // UnitDocument. status = GdipSetPenUnit (pen, UnitDocument); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitDocument); // UnitMillimeter. status = GdipSetPenUnit (pen, UnitMillimeter); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitMillimeter); #if !defined(USE_WINDOWS_GDIPLUS) // UnitCairoPoint. status = GdipSetPenUnit (pen, UnitCairoPoint); assertEqualInt (status, Ok); status = GdipGetPenUnit (pen, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, UnitCairoPoint); #endif // Negative tests. status = GdipSetPenUnit (NULL, UnitWorld); assertEqualInt (status, InvalidParameter); status = GdipSetPenUnit (pen, (Unit)(UnitWorld -1)); assertEqualInt (status, InvalidParameter); status = GdipSetPenUnit (pen, UnitDisplay); assertEqualInt (status, InvalidParameter); #if defined(USE_WINDOWS_GDIPLUS) status = GdipSetPenUnit (pen, (Unit)(UnitMillimeter + 1)); assertEqualInt (status, InvalidParameter); #else status = GdipSetPenUnit (pen, (Unit)(UnitCairoPoint + 1)); assertEqualInt (status, InvalidParameter); #endif GdipDeletePen (pen); } static void test_setPenLineCap197819 () { GpStatus status; GpPen *pen; LineCap startCap; LineCap endCap; DashCap dashCap; GpPath *path; GpCustomLineCap *penCustomLineCap; GpCustomLineCap *customStartCap; REAL startCapBaseInset; GpCustomLineCap *customEndCap; REAL endCapBaseInset; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePath (FillModeAlternate, &path); GdipCreateCustomLineCap (path, NULL, LineCapDiamondAnchor, 10, &penCustomLineCap); // Valid values. status = GdipSetPenLineCap197819 (pen, LineCapArrowAnchor, LineCapDiamondAnchor, DashCapRound); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, LineCapArrowAnchor); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, LineCapDiamondAnchor); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapRound); // Custom values. status = GdipSetPenLineCap197819 (pen, LineCapCustom, LineCapCustom, DashCapTriangle); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, LineCapCustom); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, LineCapCustom); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapTriangle); // Invalid values - negative. status = GdipSetPenLineCap197819 (pen, (LineCap)(LineCapFlat - 1), (LineCap)(LineCapFlat - 1), (DashCap)(DashCapFlat - 1)); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, (LineCap)(LineCapFlat - 1)); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, (LineCap)(LineCapFlat - 1)); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Invalid values - positive. status = GdipSetPenLineCap197819 (pen, (LineCap)(LineCapCustom + 1), (LineCap)(LineCapCustom + 1), (DashCap)(DashCapTriangle + 1)); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, (LineCap)(LineCapCustom + 1)); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, (LineCap)(LineCapCustom + 1)); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Invalid values - one. status = GdipSetPenLineCap197819 (pen, (LineCap)(LineCapCustom + 1), (LineCap)(LineCapCustom + 1), (DashCap)(1)); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, (LineCap)(LineCapCustom + 1)); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, (LineCap)(LineCapCustom + 1)); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Set when there is already a custom cap. GdipSetPenCustomStartCap (pen, penCustomLineCap); GdipSetPenCustomEndCap (pen, penCustomLineCap); status = GdipSetPenLineCap197819 (pen, LineCapNoAnchor, LineCapFlat, DashCapRound); assertEqualInt (status, Ok); status = GdipGetPenCustomStartCap (pen, &customStartCap); assertEqualInt (status, Ok); status = GdipGetCustomLineCapBaseInset (customStartCap, &startCapBaseInset); assertEqualInt (status, Ok); assertEqualFloat (startCapBaseInset, 10); status = GdipGetPenCustomEndCap (pen, &customEndCap); assertEqualInt (status, Ok); status = GdipGetCustomLineCapBaseInset (customEndCap, &endCapBaseInset); assertEqualInt (status, Ok); assertEqualFloat (startCapBaseInset, 10); // Negative tests. status = GdipSetPenLineCap197819 (NULL, LineCapArrowAnchor, LineCapDiamondAnchor, DashCapFlat); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeletePath (path); GdipDeleteCustomLineCap (penCustomLineCap); GdipDeleteCustomLineCap (customStartCap); GdipDeleteCustomLineCap (customEndCap); } static void test_setPenStartCap () { GpStatus status; GpPen *pen; LineCap startCap; GpPath *path; GpCustomLineCap *penCustomLineCap; GpCustomLineCap *customStartCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePath (FillModeAlternate, &path); GdipCreateCustomLineCap (path, NULL, LineCapDiamondAnchor, 10, &penCustomLineCap); // Valid values. status = GdipSetPenStartCap (pen, LineCapArrowAnchor); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, LineCapArrowAnchor); // Same value. status = GdipSetPenStartCap (pen, LineCapArrowAnchor); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, LineCapArrowAnchor); // Custom values. status = GdipSetPenStartCap (pen, LineCapCustom); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, LineCapCustom); // Set when there is already a custom cap. GdipSetPenCustomStartCap (pen, penCustomLineCap); assertEqualInt (status, Ok); status = GdipSetPenStartCap (pen, LineCapNoAnchor); assertEqualInt (status, Ok); status = GdipGetPenCustomStartCap (pen, &customStartCap); assertEqualInt (status, Ok); assert (!customStartCap && "Expected the pen's custom start cap to be cleared."); // Invalid values - negative. status = GdipSetPenStartCap (pen, (LineCap)(LineCapFlat - 1)); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, (LineCap)(LineCapFlat - 1)); // Invalid values - positive. status = GdipSetPenStartCap (pen, (LineCap)(LineCapCustom + 1)); assertEqualInt (status, Ok); GdipGetPenStartCap (pen, &startCap); assertEqualInt (startCap, (LineCap)(LineCapCustom + 1)); // Negative tests. status = GdipSetPenStartCap (NULL, LineCapArrowAnchor); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteCustomLineCap (penCustomLineCap); GdipDeleteCustomLineCap (customStartCap); } static void test_setPenEndCap () { GpStatus status; GpPen *pen; LineCap endCap; GpPath *path; GpCustomLineCap *penCustomLineCap; GpCustomLineCap *customEndCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePath (FillModeAlternate, &path); GdipCreateCustomLineCap (path, NULL, LineCapDiamondAnchor, 10, &penCustomLineCap); // Valid values. status = GdipSetPenEndCap (pen, LineCapArrowAnchor); assertEqualInt (status, Ok); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, LineCapArrowAnchor); // Same value. status = GdipSetPenEndCap (pen, LineCapArrowAnchor); assertEqualInt (status, Ok); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, LineCapArrowAnchor); // Custom values. status = GdipSetPenEndCap (pen, LineCapCustom); assertEqualInt (status, Ok); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, LineCapCustom); // Set when there is already a custom cap. GdipSetPenCustomEndCap (pen, penCustomLineCap); status = GdipSetPenEndCap (pen, LineCapNoAnchor); assertEqualInt (status, Ok); status = GdipGetPenCustomEndCap (pen, &customEndCap); assertEqualInt (status, Ok); assert (!customEndCap && "Expected the pen's custom end cap to be cleared."); // Invalid values - negative. status = GdipSetPenEndCap (pen, (LineCap)(LineCapFlat - 1)); assertEqualInt (status, Ok); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, (LineCap)(LineCapFlat - 1)); // Invalid values - positive. status = GdipSetPenEndCap (pen, (LineCap)(LineCapCustom + 1)); assertEqualInt (status, Ok); GdipGetPenEndCap (pen, &endCap); assertEqualInt (endCap, (LineCap)(LineCapCustom + 1)); // Negative tests. status = GdipSetPenEndCap (NULL, LineCapArrowAnchor); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteCustomLineCap (penCustomLineCap); GdipDeleteCustomLineCap (customEndCap); } static void test_setPenDashCap197819 () { GpStatus status; GpPen *pen; DashCap dashCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Round. status = GdipSetPenDashCap197819 (pen, DashCapRound); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapRound); // Same value. status = GdipSetPenDashCap197819 (pen, DashCapRound); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapRound); // Triangle. status = GdipSetPenDashCap197819 (pen, DashCapTriangle); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapTriangle); // Flat. status = GdipSetPenDashCap197819 (pen, DashCapFlat); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Invalid values - negative. status = GdipSetPenDashCap197819 (pen, (DashCap)(DashCapFlat - 1)); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Invalid values - positive. status = GdipSetPenDashCap197819 (pen, (DashCap)(DashCapTriangle + 1)); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Invalid values - one. status = GdipSetPenDashCap197819 (pen, (DashCap)(1)); assertEqualInt (status, Ok); GdipGetPenDashCap197819 (pen, &dashCap); assertEqualInt (dashCap, DashCapFlat); // Negative tests. status = GdipSetPenDashCap197819 (NULL, DashCapFlat); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenStartCap () { GpStatus status; GpPen *pen; LineCap startCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenStartCap (NULL, &startCap); assertEqualInt (status, InvalidParameter); status = GdipGetPenStartCap (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenEndCap () { GpStatus status; GpPen *pen; LineCap endCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenEndCap (NULL, &endCap); assertEqualInt (status, InvalidParameter); status = GdipGetPenEndCap (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenDashCap197819 () { GpStatus status; GpPen *pen; DashCap dashCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenDashCap197819 (NULL, &dashCap); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashCap197819 (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenLineJoin () { GpStatus status; GpPen *pen; LineJoin lineJoin; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // LineJoinBevel. status = GdipSetPenLineJoin (pen, LineJoinBevel); assertEqualInt (status, Ok); status = GdipGetPenLineJoin (pen, &lineJoin); assertEqualInt (status, Ok); assertEqualInt (lineJoin, LineJoinBevel); // Same value. status = GdipSetPenLineJoin (pen, LineJoinBevel); assertEqualInt (status, Ok); status = GdipGetPenLineJoin (pen, &lineJoin); assertEqualInt (status, Ok); assertEqualInt (lineJoin, LineJoinBevel); // Invalid value - negative. status = GdipSetPenLineJoin (pen, (LineJoin)(LineJoinMiter - 1)); assertEqualInt (status, Ok); status = GdipGetPenLineJoin (pen, &lineJoin); assertEqualInt (status, Ok); assertEqualInt (lineJoin, (LineJoin)(LineJoinMiter - 1)); // Invalid value - positive. status = GdipSetPenLineJoin (pen, (LineJoin)(LineJoinMiterClipped + 1)); assertEqualInt (status, Ok); status = GdipGetPenLineJoin (pen, &lineJoin); assertEqualInt (status, Ok); assertEqualInt (lineJoin, (LineJoin)(LineJoinMiterClipped + 1)); // Negative tests. status = GdipSetPenLineJoin (NULL, LineJoinBevel); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenLineJoin () { GpStatus status; GpPen *pen; LineJoin lineJoin; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenLineJoin (NULL, &lineJoin); assertEqualInt (status, InvalidParameter); status = GdipGetPenLineJoin (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenCustomStartCap () { GpStatus status; GpPen *pen; GpPath *path; GpCustomLineCap *penCustomLineCap; GpCustomLineCap *customStartCap; REAL baseInset; LineCap startCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePath (FillModeAlternate, &path); GdipCreateCustomLineCap (path, NULL, LineCapDiamondAnchor, 10, &penCustomLineCap); status = GdipSetPenCustomStartCap (pen, penCustomLineCap); assertEqualInt (status, Ok); status = GdipGetPenStartCap (pen, &startCap); assertEqualInt (status, Ok); assertEqualInt (startCap, LineCapCustom); status = GdipGetPenCustomStartCap (pen, &customStartCap); assertEqualInt (status, Ok); assert (customStartCap && customStartCap != penCustomLineCap); status = GdipGetCustomLineCapBaseInset (customStartCap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 10); // Negative tests. status = GdipSetPenCustomStartCap (NULL, penCustomLineCap); assertEqualInt (status, InvalidParameter); status = GdipSetPenCustomStartCap (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteCustomLineCap (penCustomLineCap); GdipDeleteCustomLineCap (customStartCap); } static void test_getPenCustomStartCap () { GpStatus status; GpPen *pen; GpCustomLineCap *customStartCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenCustomStartCap (NULL, &customStartCap); assertEqualInt (status, InvalidParameter); status = GdipGetPenCustomStartCap (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenCustomEndCap () { GpStatus status; GpPen *pen; GpPath *path; GpCustomLineCap *penCustomLineCap; GpCustomLineCap *customEndCap; REAL baseInset; LineCap endCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePath (FillModeAlternate, &path); GdipCreateCustomLineCap (path, NULL, LineCapDiamondAnchor, 10, &penCustomLineCap); status = GdipSetPenCustomEndCap (pen, penCustomLineCap); assertEqualInt (status, Ok); status = GdipGetPenEndCap (pen, &endCap); assertEqualInt (status, Ok); assertEqualInt (endCap, LineCapCustom); status = GdipGetPenCustomEndCap (pen, &customEndCap); assertEqualInt (status, Ok); assert (customEndCap && customEndCap != penCustomLineCap); status = GdipGetCustomLineCapBaseInset (customEndCap, &baseInset); assertEqualInt (status, Ok); assertEqualFloat (baseInset, 10); // Negative tests. status = GdipSetPenCustomEndCap (NULL, penCustomLineCap); assertEqualInt (status, InvalidParameter); status = GdipSetPenCustomEndCap (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteCustomLineCap (penCustomLineCap); GdipDeleteCustomLineCap (customEndCap); } static void test_getPenCustomEndCap () { GpStatus status; GpPen *pen; GpCustomLineCap *customEndCap; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenCustomEndCap (NULL, &customEndCap); assertEqualInt (status, InvalidParameter); status = GdipGetPenCustomEndCap (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenMiterLimit () { GpStatus status; GpPen *pen; REAL miterLimit; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Positive. status = GdipSetPenMiterLimit (pen, 100); assertEqualInt (status, Ok); status = GdipGetPenMiterLimit (pen, &miterLimit); assertEqualInt (status, Ok); assertEqualFloat (miterLimit, 100); // Same value. status = GdipSetPenMiterLimit (pen, 100); assertEqualInt (status, Ok); status = GdipGetPenMiterLimit (pen, &miterLimit); assertEqualInt (status, Ok); assertEqualFloat (miterLimit, 100); // Zero. status = GdipSetPenMiterLimit (pen, 0); assertEqualInt (status, Ok); status = GdipGetPenMiterLimit (pen, &miterLimit); assertEqualInt (status, Ok); assertEqualFloat (miterLimit, 1); // Negative. status = GdipSetPenMiterLimit (pen, -100); assertEqualInt (status, Ok); status = GdipGetPenMiterLimit (pen, &miterLimit); assertEqualInt (status, Ok); assertEqualFloat (miterLimit, 1); // Negative tests. status = GdipSetPenMiterLimit (NULL, 10); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenMiterLimit () { GpStatus status; GpPen *pen; REAL miterLimit; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenMiterLimit (NULL, &miterLimit); assertEqualInt (status, InvalidParameter); status = GdipGetPenMiterLimit (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenTransform () { GpStatus status; GpPen *pen; GpMatrix *transform; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateMatrix (&transform); // Negative tests. status = GdipGetPenTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipGetPenTransform (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteMatrix (transform); } static void test_setPenTransform () { GpStatus status; GpPen *pen; GpMatrix *matrix; GpMatrix *transform; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix (&transform); status = GdipSetPenTransform (pen, matrix); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Changing the original transform should not modify the pen's transform. GdipSetMatrixElements (matrix, 2, 3, 4, 5, 6, 7); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Negative tests. status = GdipSetPenTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipSetPenTransform (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteMatrix (matrix); GdipDeleteMatrix (transform); } static void test_multiplyPenTransform () { GpStatus status; GpPen *pen; GpMatrix *originalTransform; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix2 (2, 3, 4, 5, 6, 7, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPenTransform (pen, originalTransform); status = GdipMultiplyPenTransform (pen, matrix, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // MatrixOrderPrepend. GdipSetPenTransform (pen, originalTransform); status = GdipMultiplyPenTransform (pen, matrix, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Null matrix. status = GdipMultiplyPenTransform (pen, NULL, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Invalid MatrixOrder - negative. GdipSetPenTransform (pen, originalTransform); status = GdipMultiplyPenTransform (pen, matrix, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Invalid MatrixOrder - positive. GdipSetPenTransform (pen, originalTransform); status = GdipMultiplyPenTransform (pen, matrix, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Negative tests. status = GdipMultiplyPenTransform (NULL, matrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipMultiplyPenTransform (pen, nonInvertibleMatrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDeleteMatrix (transform); } static void test_translatePenTransform () { GpStatus status; GpPen *pen; GpMatrix *originalTransform; GpMatrix *transform; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPenTransform (pen, originalTransform); status = GdipTranslatePenTransform (pen, 5, 6, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 1, 2, 3, 4, 10, 12); // MatrixOrderPrepend. GdipSetPenTransform (pen, originalTransform); status = GdipTranslatePenTransform (pen, 5, 6, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 1, 2, 3, 4, 28, 40); // Negative tests. status = GdipTranslatePenTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipTranslatePenTransform (pen, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipTranslatePenTransform (pen, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_scalePenTransform () { GpStatus status; GpPen *pen; GpMatrix *originalTransform; GpMatrix *transform; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPenTransform (pen, originalTransform); status = GdipScalePenTransform (pen, 0.5, 0.75, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 0.5, 1.5, 1.5, 3, 2.5, 4.5); // MatrixOrderPrepend. GdipSetPenTransform (pen, originalTransform); status = GdipScalePenTransform (pen, 0.5, 0.75, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 0.5, 1, 2.25, 3, 5, 6); // Negative tests. status = GdipScalePenTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipScalePenTransform (pen, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipScalePenTransform (pen, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_rotatePenTransform () { GpStatus status; GpPen *pen; GpMatrix *originalTransform; GpMatrix *transform; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetPenTransform (pen, originalTransform); status = GdipRotatePenTransform (pen, 90, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, -2, 1, -4, 3, -6, 5); // MatrixOrderPrepend. GdipSetPenTransform (pen, originalTransform); status = GdipRotatePenTransform (pen, 90, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetPenTransform (pen, transform); verifyMatrix (transform, 3, 4, -1, -2, 5, 6); // Negative tests. status = GdipRotatePenTransform (NULL, 90, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipRotatePenTransform (pen, 90, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipRotatePenTransform (pen, 90, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_setPenMode () { GpStatus status; GpPen *pen; GpPen *compoundArrayPen; REAL twoCompounds[2] = {1, 1}; PenAlignment mode; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePen1 (0x00000001, 10, UnitWorld, &compoundArrayPen); GdipSetPenCompoundArray (compoundArrayPen, twoCompounds, 2); // Normal pen - PenAlignmentInset. status = GdipSetPenMode (pen, PenAlignmentInset); assertEqualInt (status, Ok); status = GdipGetPenMode (pen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, PenAlignmentInset); // Normal pen - same mode. status = GdipSetPenMode (pen, PenAlignmentInset); assertEqualInt (status, Ok); status = GdipGetPenMode (pen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, PenAlignmentInset); // Normal pen - PenAlignmentCenter. status = GdipSetPenMode (pen, PenAlignmentCenter); assertEqualInt (status, Ok); status = GdipGetPenMode (pen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, PenAlignmentCenter); // Normal pen - negative. status = GdipSetPenMode (pen, (PenAlignment)(PenAlignmentCenter - 1)); assertEqualInt (status, Ok); status = GdipGetPenMode (pen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, (PenAlignment)(PenAlignmentCenter - 1)); // Normal pen - positive. status = GdipSetPenMode (pen, (PenAlignment)(PenAlignmentInset + 1)); assertEqualInt (status, Ok); status = GdipGetPenMode (pen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, (PenAlignment)(PenAlignmentInset + 1)); // Compound array pen - PenAlignmentCenter. status = GdipSetPenMode (compoundArrayPen, PenAlignmentCenter); assertEqualInt (status, Ok); status = GdipGetPenMode (compoundArrayPen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, PenAlignmentCenter); // Compound array pen - same mode. status = GdipSetPenMode (compoundArrayPen, PenAlignmentCenter); assertEqualInt (status, Ok); status = GdipGetPenMode (compoundArrayPen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, PenAlignmentCenter); // Compound array pen - negative. status = GdipSetPenMode (compoundArrayPen, (PenAlignment)(PenAlignmentCenter - 1)); assertEqualInt (status, Ok); status = GdipGetPenMode (compoundArrayPen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, (PenAlignment)(PenAlignmentCenter - 1)); // Compound array pen - positive. status = GdipSetPenMode (compoundArrayPen, (PenAlignment)(PenAlignmentInset + 1)); assertEqualInt (status, Ok); status = GdipGetPenMode (compoundArrayPen, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, (PenAlignment)(PenAlignmentInset + 1)); // Negative tests. status = GdipSetPenMode (NULL, PenAlignmentCenter); assertEqualInt (status, InvalidParameter); status = GdipSetPenMode (compoundArrayPen, PenAlignmentInset); assertEqualInt (status, NotImplemented); GdipDeletePen (pen); GdipDeletePen (compoundArrayPen); } static void test_getPenMode () { GpStatus status; GpPen *pen; PenAlignment mode; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenMode (NULL, &mode); assertEqualInt (status, InvalidParameter); status = GdipGetPenMode (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenColor () { GpStatus status; GpPen *pen; ARGB color; GpBrush *brush; GpBrushType brushType; GpBrush *hatchBrush; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateHatchBrush (HatchStyle05Percent, 0x00000011, 0x00000022, (GpHatch **) &hatchBrush); // Solid fill. status = GdipSetPenColor (pen, 0x01020304); assertEqualInt (status, Ok); status = GdipGetPenColor (pen, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x01020304); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); status = GdipGetBrushType (brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor ((GpSolidFill *) brush, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x01020304); GdipDeleteBrush (brush); // Same color. status = GdipSetPenColor (pen, 0x01020304); assertEqualInt (status, Ok); status = GdipGetPenColor (pen, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x01020304); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); status = GdipGetBrushType (brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor ((GpSolidFill *) brush, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x01020304); GdipDeleteBrush (brush); // Different color. status = GdipSetPenColor (pen, 0x12345678); assertEqualInt (status, Ok); status = GdipGetPenColor (pen, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x12345678); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); status = GdipGetBrushType (brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor ((GpSolidFill *) brush, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x12345678); GdipDeleteBrush (brush); // Custom brush - different color. status = GdipSetPenBrushFill (pen, hatchBrush); assertEqualInt (status, Ok); status = GdipSetPenColor (pen, 0x12345678); assertEqualInt (status, Ok); status = GdipGetPenColor (pen, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x12345678); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); status = GdipGetBrushType (brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor ((GpSolidFill *) brush, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x12345678); GdipDeleteBrush (brush); // Custom brush - same color. status = GdipSetPenBrushFill (pen, hatchBrush); assertEqualInt (status, Ok); status = GdipSetPenColor (pen, 0x00000011); assertEqualInt (status, Ok); status = GdipGetPenColor (pen, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x00000011); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); status = GdipGetBrushType (brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor ((GpSolidFill *) brush, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x00000011); GdipDeleteBrush (brush); // Negative tests. status = GdipSetPenColor (NULL, 0x01020304); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteBrush ((GpBrush *) hatchBrush); } static void test_getPenColor () { GpStatus status; GpPen *pen; ARGB color; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenColor (NULL, &color); assertEqualInt (status, InvalidParameter); status = GdipGetPenColor (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenFillType () { GpStatus status; GpPen *pen; PenType type; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenFillType (NULL, &type); assertEqualInt (status, InvalidParameter); status = GdipGetPenFillType (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenBrushFill () { GpStatus status; GpPen *pen; GpSolidFill *solidBrush; GpImage *image; GpTexture *textureBrush; GpBrush *brush; ARGB penColor; ARGB brushColor; WrapMode brushWrapMode; image = getImage (); GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreateSolidFill (100, &solidBrush); GdipCreateTexture (image, WrapModeTileFlipX, &textureBrush); // SolidFill. status = GdipSetPenBrushFill (pen, solidBrush); assertEqualInt (status, Ok); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); assert (brush && brush != solidBrush && "Expected new brush to be a clone."); status = GdipGetPenColor (pen, &penColor); assertEqualInt (status, Ok); assertEqualInt (penColor, 100); status = GdipGetSolidFillColor ((GpSolidFill *) brush, &brushColor); assertEqualInt (status, Ok); assertEqualInt (brushColor, 100); GdipDeleteBrush (brush); // Non SolidFill. status = GdipSetPenBrushFill (pen, textureBrush); assertEqualInt (status, Ok); status = GdipGetPenBrushFill (pen, &brush); assertEqualInt (status, Ok); assert (brush && brush != textureBrush && "Expected new brush to be a clone."); status = GdipGetTextureWrapMode ((GpTexture *) brush, &brushWrapMode); assertEqualInt (status, Ok); assertEqualInt (brushWrapMode, WrapModeTileFlipX); // Negative tests. status = GdipSetPenBrushFill (NULL, solidBrush); assertEqualInt (status, InvalidParameter); status = GdipSetPenBrushFill (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeleteBrush ((GpBrush *) solidBrush); GdipDisposeImage (image); GdipDeleteBrush ((GpBrush *) textureBrush); } static void test_getPenBrushFill () { GpStatus status; GpPen *pen; GpBrush *brush; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenBrushFill (NULL, &brush); assertEqualInt (status, InvalidParameter); status = GdipGetPenBrushFill (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenDashStyle () { GpStatus status; GpPen *pen; DashStyle dashStyle; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenDashStyle (NULL, &dashStyle); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashStyle (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenDashStyle () { GpStatus status; GpPen *pen; DashStyle dashStyle; REAL dashArray[6]; INT dashCount; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // DashStyleDashDot. status = GdipSetPenDashStyle (pen, DashStyleDashDot); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleDashDot); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 4); status = GdipGetPenDashArray (pen, dashArray, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashArray[0], 3); assertEqualFloat (dashArray[1], 1); assertEqualFloat (dashArray[2], 1); assertEqualFloat (dashArray[3], 1); // DashStyleSolid. status = GdipSetPenDashStyle (pen, DashStyleSolid); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleSolid); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 0); // DashStyleDashDotDot. status = GdipSetPenDashStyle (pen, DashStyleDashDotDot); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleDashDotDot); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 6); status = GdipGetPenDashArray (pen, dashArray, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashArray[0], 3); assertEqualFloat (dashArray[1], 1); assertEqualFloat (dashArray[2], 1); assertEqualFloat (dashArray[3], 1); assertEqualFloat (dashArray[4], 1); assertEqualFloat (dashArray[5], 1); // DashStyleDot. status = GdipSetPenDashStyle (pen, DashStyleDot); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleDot); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 2); status = GdipGetPenDashArray (pen, dashArray, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashArray[0], 1); assertEqualFloat (dashArray[1], 1); // DashStyleDash. status = GdipSetPenDashStyle (pen, DashStyleDash); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleDash); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 2); status = GdipGetPenDashArray (pen, dashArray, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashArray[0], 3); assertEqualFloat (dashArray[1], 1); // DashStyleCustom. status = GdipSetPenDashStyle (pen, DashStyleCustom); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleCustom); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 2); status = GdipGetPenDashArray (pen, dashArray, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashArray[0], 3); assertEqualFloat (dashArray[1], 1); // Invalid value - negative. status = GdipSetPenDashStyle (pen, (DashStyle)(DashStyleSolid - 1)); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleCustom); // Invalid value - positive. status = GdipSetPenDashStyle (pen, (DashStyle)(DashStyleCustom + 1)); assertEqualInt (status, Ok); status = GdipGetPenDashStyle (pen, &dashStyle); assertEqualInt (status, Ok); assertEqualInt (dashStyle, DashStyleCustom); // Negative tests. status = GdipSetPenDashStyle (NULL, DashStyleDash); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenDashOffset () { GpStatus status; GpPen *pen; REAL dashOffset; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenDashOffset (NULL, &dashOffset); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashOffset (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenDashOffset () { GpStatus status; GpPen *pen; REAL dashOffset; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Positive. status = GdipSetPenDashOffset (pen, 100); assertEqualInt (status, Ok); status = GdipGetPenDashOffset (pen, &dashOffset); assertEqualInt (status, Ok); assertEqualFloat (dashOffset, 100); // Same value. status = GdipSetPenDashOffset (pen, 100); assertEqualInt (status, Ok); status = GdipGetPenDashOffset (pen, &dashOffset); assertEqualInt (status, Ok); assertEqualFloat (dashOffset, 100); // Zero. status = GdipSetPenDashOffset (pen, 0); assertEqualInt (status, Ok); status = GdipGetPenDashOffset (pen, &dashOffset); assertEqualInt (status, Ok); assertEqualFloat (dashOffset, 0); // Negative. status = GdipSetPenDashOffset (pen, -100); assertEqualInt (status, Ok); status = GdipGetPenDashOffset (pen, &dashOffset); assertEqualInt (status, Ok); assertEqualFloat (dashOffset, -100); // Negative tests. status = GdipSetPenDashOffset (NULL, 100); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenDashCount () { GpStatus status; GpPen *pen; INT dashCount; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenDashCount (NULL, &dashCount); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashCount (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenDashArray () { GpStatus status; GpPen *pen; REAL twoDashes[2] = {1, 2}; REAL allZero[2] = {0, 0}; REAL negative[2] = {2, -1}; INT dashCount; REAL dashes[3]; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // One dash. status = GdipSetPenDashArray (pen, twoDashes, 1); assertEqualInt (status, Ok); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 1); status = GdipGetPenDashArray (pen, dashes, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashes[0], 1); // Two dashes. status = GdipSetPenDashArray (pen, twoDashes, 2); assertEqualInt (status, Ok); status = GdipGetPenDashCount (pen, &dashCount); assertEqualInt (status, Ok); assertEqualInt (dashCount, 2); status = GdipGetPenDashArray (pen, dashes, dashCount); assertEqualInt (status, Ok); assertEqualFloat (dashes[0], 1); assertEqualFloat (dashes[1], 2); // Negative tests. status = GdipSetPenDashArray (NULL, twoDashes, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenDashArray (pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenDashArray (pen, allZero, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenDashArray (pen, negative, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenDashArray (pen, dashes, 0); assertEqualInt (status, InvalidParameter); status = GdipSetPenDashArray (pen, dashes, -1); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_getPenDashArray () { GpStatus status; GpPen *penWithNoDashes; GpPen *penWithDashes; REAL dashes[3] = {0, -1, -2}; REAL penDashes[2] = {1, 2}; GdipCreatePen1 (0x00000001, 10, UnitWorld, &penWithNoDashes); GdipCreatePen1 (0x00000001, 10, UnitWorld, &penWithDashes); GdipSetPenDashArray (penWithDashes, penDashes, 2); // Zero count. status = GdipGetPenDashArray (penWithDashes, dashes, 0); assertEqualInt (status, Ok); // Small count. status = GdipGetPenDashArray (penWithDashes, dashes, 1); assertEqualInt (status, Ok); assertEqualFloat (dashes[0], 1); assertEqualFloat (dashes[1], -1); assertEqualFloat (dashes[2], -2); // Negative tests. status = GdipGetPenDashArray (NULL, dashes, 2); assertEqualInt (status, InvalidParameter); // Negative tests - no dashes. status = GdipGetPenDashArray (penWithNoDashes, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashArray (penWithNoDashes, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashArray (penWithNoDashes, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashArray (penWithNoDashes, dashes, 0); assertEqualInt (status, OutOfMemory); status = GdipGetPenDashArray (penWithNoDashes, dashes, -1); assertEqualInt (status, OutOfMemory); status = GdipGetPenDashArray (penWithNoDashes, dashes, 1); assertEqualInt (status, InvalidParameter); // Negative tests - has dashes. status = GdipGetPenDashArray (NULL, dashes, 2); assertEqualInt (status, InvalidParameter); status = GdipGetPenDashArray (penWithDashes, dashes, 3); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetPenDashArray (penWithDashes, dashes, -1); assertEqualInt (status, OutOfMemory); #endif GdipDeletePen (penWithNoDashes); GdipDeletePen (penWithDashes); } static void test_getPenCompoundCount () { GpStatus status; GpPen *pen; INT compoundCount; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Negative tests. status = GdipGetPenCompoundCount (NULL, &compoundCount); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundCount (pen, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); } static void test_setPenCompoundArray () { GpStatus status; GpPen *pen; GpPen *insetPen; REAL fourCompounds[4] = {1, 1, 1, 1}; REAL allZero[2] = {0, 0}; INT compoundCount; REAL compounds[6] = {0, 0, 0, 0}; REAL ascendingOrderZeroToOne[6] = {0, 0.2f, 0.2f, 0.4f, 0.5f, 1}; REAL ascendingOrderGreaterThanZeroToLessThanOne[4] = {0.2f, 0.2f, 0.4f, 0.5f}; REAL firstLessThanZero[2] = {-0.01f, 0}; REAL firstGreaterThanOne[2] = {1.01f, 0}; REAL secondLessThanZero[2] = {0, -0.01f}; REAL secondGreaterThanOne[2] = {0, 1.01f}; REAL secondLessThanFirst[2] = {0.5f, 0.4f}; REAL thirdLessThanSecond[4] = {0.5f, 0.6f, 0.5f, 0.7f}; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); GdipCreatePen1 (0x00000001, 10, UnitWorld, &insetPen); GdipSetPenMode (insetPen, PenAlignmentInset); // Two compounds - all 1. status = GdipSetPenCompoundArray (pen, fourCompounds, 2); assertEqualInt (status, Ok); status = GdipGetPenCompoundCount (pen, &compoundCount); assertEqualInt (status, Ok); assertEqualInt (compoundCount, 2); status = GdipGetPenCompoundArray (pen, compounds, compoundCount - 1); assertEqualInt (status, Ok); assertEqualFloat (compounds[0], 1); assertEqualFloat (compounds[1], 0); status = GdipGetPenCompoundArray (pen, compounds, compoundCount); assertEqualInt (status, Ok); assertEqualFloat (compounds[0], 1); assertEqualFloat (compounds[1], 1); // Two compounds - all 0. status = GdipSetPenCompoundArray (pen, allZero, 2); assertEqualInt (status, Ok); status = GdipGetPenCompoundCount (pen, &compoundCount); assertEqualInt (status, Ok); assertEqualInt (compoundCount, 2); status = GdipGetPenCompoundArray (pen, compounds, compoundCount); assertEqualInt (status, Ok); assertEqualFloat (compounds[0], 0); assertEqualFloat (compounds[1], 0); // Four compounds - all one. status = GdipSetPenCompoundArray (pen, fourCompounds, 4); assertEqualInt (status, Ok); status = GdipGetPenCompoundCount (pen, &compoundCount); assertEqualInt (status, Ok); assertEqualInt (compoundCount, 4); status = GdipGetPenCompoundArray (pen, compounds, compoundCount); assertEqualInt (status, Ok); assertEqualFloat (compounds[0], 1); assertEqualFloat (compounds[1], 1); assertEqualFloat (compounds[2], 1); assertEqualFloat (compounds[3], 1); // Ascending order from 0 to 1. status = GdipSetPenCompoundArray (pen, ascendingOrderZeroToOne, 6); assertEqualInt (status, Ok); status = GdipGetPenCompoundCount (pen, &compoundCount); assertEqualInt (status, Ok); assertEqualInt (compoundCount, 6); status = GdipGetPenCompoundArray (pen, compounds, compoundCount); assertEqualInt (status, Ok); assertEqualFloat (compounds[0], 0); assertEqualFloat (compounds[1], 0.2f); assertEqualFloat (compounds[2], 0.2f); assertEqualFloat (compounds[3], 0.4f); assertEqualFloat (compounds[4], 0.5f); assertEqualFloat (compounds[5], 1); // Ascending order from greater than 0 to less than 1. status = GdipSetPenCompoundArray (pen, ascendingOrderGreaterThanZeroToLessThanOne, 4); assertEqualInt (status, Ok); status = GdipGetPenCompoundCount (pen, &compoundCount); assertEqualInt (status, Ok); assertEqualInt (compoundCount, 4); status = GdipGetPenCompoundArray (pen, compounds, compoundCount); assertEqualInt (status, Ok); assertEqualFloat (compounds[0], 0.2f); assertEqualFloat (compounds[1], 0.2f); assertEqualFloat (compounds[2], 0.4f); assertEqualFloat (compounds[3], 0.5f); // Negative tests. status = GdipSetPenCompoundArray (NULL, fourCompounds, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, fourCompounds, 3); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, fourCompounds, 1); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, fourCompounds, 0); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, fourCompounds, -1); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, firstLessThanZero, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, firstGreaterThanOne, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, secondLessThanZero, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, secondGreaterThanOne, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, secondLessThanFirst, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (pen, thirdLessThanSecond, 4); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (insetPen, fourCompounds, 2); assertEqualInt (status, NotImplemented); status = GdipSetPenCompoundArray (insetPen, firstLessThanZero, 2); assertEqualInt (status, NotImplemented); status = GdipSetPenCompoundArray (insetPen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (insetPen, fourCompounds, 0); assertEqualInt (status, InvalidParameter); status = GdipSetPenCompoundArray (insetPen, fourCompounds, 1); assertEqualInt (status, InvalidParameter); GdipDeletePen (pen); GdipDeletePen (insetPen); } static void test_getPenCompoundArray () { GpStatus status; GpPen *pen; REAL compounds[3]; REAL twoCompounds[2] = {1, 1}; GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); // Empty compounds. status = GdipGetPenCompoundArray (pen, compounds, 1); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundArray (pen, compounds, 0); assertEqualInt (status, Ok); status = GdipGetPenCompoundArray (pen, compounds, -1); assertEqualInt (status, Ok); // Non-empty compounds. status = GdipSetPenCompoundArray (pen, twoCompounds, 2); assertEqualInt (status, Ok); status = GdipGetPenCompoundArray (pen, compounds, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundArray (pen, compounds, 0); assertEqualInt (status, Ok); status = GdipGetPenCompoundArray (pen, compounds, -1); assertEqualInt (status, Ok); GdipDeletePen (pen); // Negative tests. GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); status = GdipGetPenCompoundArray (NULL, compounds, 2); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundArray (NULL, compounds, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundArray (pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundArray (pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPenCompoundArray (pen, compounds, 1); assertEqualInt (status, InvalidParameter); } static void test_deletePen () { GpStatus status; GpPen *pen; status = GdipCreatePen1 (0x00000001, 10, UnitWorld, &pen); assertEqualInt (status, Ok); status = GdipDeletePen (pen); assertEqualInt (status, Ok); assert (pen); // Negative tests. status = GdipDeletePen (NULL); assertEqualInt (status, InvalidParameter); } int main (int argc, char**argv) { STARTUP; test_createPen1 (); test_createPen2 (); test_clone (); test_getPenWidth (); test_setPenWidth (); test_setPenUnit (); test_getPenUnit (); test_setPenLineCap197819 (); test_setPenStartCap (); test_setPenEndCap (); test_setPenDashCap197819 (); test_getPenStartCap (); test_getPenEndCap (); test_getPenDashCap197819 (); test_setPenLineJoin (); test_getPenLineJoin (); test_setPenCustomStartCap (); test_getPenCustomStartCap (); test_setPenCustomEndCap (); test_getPenCustomEndCap (); test_setPenMiterLimit (); test_getPenMiterLimit (); test_setPenMode (); test_getPenMode (); test_getPenTransform (); test_setPenTransform (); test_multiplyPenTransform (); test_translatePenTransform (); test_scalePenTransform (); test_rotatePenTransform (); test_setPenColor (); test_getPenColor (); test_getPenFillType (); test_setPenBrushFill (); test_getPenBrushFill (); test_getPenDashStyle (); test_setPenDashStyle (); test_getPenDashOffset (); test_setPenDashOffset (); test_getPenDashCount (); test_setPenDashArray (); test_getPenDashArray (); test_getPenCompoundCount (); test_setPenCompoundArray (); test_getPenCompoundArray (); test_deletePen (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testicocodec.c0000644000175000017500000000752013545154626021313 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include "testhelpers.h" static const char *file = "temp_asset.ico"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'i', 'c', 'o', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } static void test_invalidHeader () { BYTE noCount[] = {0, 0, 1, 0}; BYTE zeroCount[] = {0, 0, 1, 0, 0, 0}; createFile (noCount, OutOfMemory); createFile (zeroCount, OutOfMemory); } static void test_invalidEntry () { BYTE noEntries[] = {0, 0, 1, 0, 1, 0}; createFile (noEntries, OutOfMemory); } static void test_invalidImage () { BYTE noBitmapHeader[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0}; BYTE invalidPalette[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 4, 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, 2, 3, 4}; BYTE noRGBEntries[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE fewRGBEntries[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; BYTE noXorData[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 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}; BYTE noAndData[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 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, 2, 3, 4}; #if defined(USE_WINDOWS_GDIPLUS) BYTE invalidData[] = {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 128, 0, 0, 0, 0, 0, 0, 0}; #endif createFile (noBitmapHeader, OutOfMemory); createFile (invalidPalette, OutOfMemory); createFile (noRGBEntries, OutOfMemory); createFile (fewRGBEntries, OutOfMemory); createFile (noXorData, OutOfMemory); createFile (noAndData, OutOfMemory); // FIXME: this returns Ok with libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) createFile (invalidData, OutOfMemory); #endif } static void test_getPixel () { WCHAR *unis; GpBitmap *bitmap; GpStatus status; PixelFormat pixel_format; ARGB color; unis = createWchar ("test3.ico"); status = GdipCreateBitmapFromFile (unis, &bitmap); assertEqualInt (status, Ok); freeWchar (unis); status = GdipGetImagePixelFormat (bitmap, &pixel_format); assertEqualInt (status, Ok); assertEqualInt (pixel_format, PixelFormat32bppARGB); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualInt (color, 0x879EE532u); GdipDisposeImage (bitmap); } int main (int argc, char**argv) { STARTUP; test_invalidHeader (); test_invalidEntry (); test_invalidImage (); test_getPixel (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testtiffcodec.c0000644000175000017500000016472113545154623021475 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #if !defined(USE_WINDOWS_GDIPLUS) #include #endif #include "testhelpers.h" static const char *file = "temp_asset.tif"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 't', 'i', 'f', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccess(buffer, width, height, flags, propertyCount) \ { \ createFile (buffer, Ok); \ verifyBitmap (image, tifRawFormat, PixelFormat24bppRGB, width, height, flags, propertyCount, TRUE); \ GdipDisposeImage (image); \ } static void test_valid () { BYTE validData24bpp[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE missingRequiredTagsAccordingToSpec[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x05, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, }; BYTE invalidNextIFDOffset[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0xFF, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; createFileSuccess (validData24bpp, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); // Version not 0x2A. validData24bpp[3] = 0x00; createFileSuccess (validData24bpp, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); createFileSuccess (missingRequiredTagsAccordingToSpec, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 5); createFileSuccess (invalidNextIFDOffset, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); } static void test_units () { BYTE invalidXResolutionOffset[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE invalidYResolutionOffset[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE zeroXResolution[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE zeroYResolution[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noXResolution[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* YResolution Data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noYResolution[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0E, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; createFileSuccess (invalidXResolutionOffset, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 14); createFileSuccess (invalidYResolutionOffset, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 14); createFileSuccess (zeroXResolution, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); createFileSuccess (zeroYResolution, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); createFileSuccess (noXResolution, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 13); createFileSuccess (noYResolution, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 13); } static void test_validGdiplus () { BYTE missingBitsPerSampleTag[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0E, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE missingSamplesPerPixelTag[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0E, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE invalidBitsPerSampleR[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE invalidBitsPerSampleG[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x07, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE invalidBitsPerSampleB[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x07, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; // There isn't much we can do about these differences as we let libtiff handle tiff decoding. #if defined(USE_WINDOWS_GDIPLUS) createFileSuccess (missingBitsPerSampleTag, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 14); createFileSuccess (missingSamplesPerPixelTag, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 14); createFileSuccess (invalidBitsPerSampleR, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); createFileSuccess (invalidBitsPerSampleG, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); createFileSuccess (invalidBitsPerSampleB, 1, 1, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 15); #else createFile (missingBitsPerSampleTag, OutOfMemory); createFile (missingSamplesPerPixelTag, OutOfMemory); createFile (invalidBitsPerSampleR, OutOfMemory); createFile (invalidBitsPerSampleG, OutOfMemory); createFile (invalidBitsPerSampleB, OutOfMemory); #endif } static void test_invalidHeader () { BYTE noVersionNumberLE[] = {0x49, 0x49}; BYTE noVersionNumberBE[] = {0x4D, 0x4D}; BYTE shortVersionNumberLE[] = {0x49, 0x49, 0x2A}; BYTE shortVersionNumberBE[] = {0x4D, 0x4D, 0x2A}; BYTE noOffsetLE[] = {0x49, 0x49, 0x2A, 0x00}; BYTE noOffsetBE[] = {0x4D, 0x4D, 0x00, 0x2A}; BYTE shortOffsetLE[] = {0x49, 0x49, 0x2A, 0x00, 0x08}; BYTE shortOffsetBE[] = {0x4D, 0x4D, 0x00, 0x2A, 0x00}; BYTE zeroOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE overlappingOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x07, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE invalidOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; createFile (noVersionNumberLE, OutOfMemory); createFile (noVersionNumberBE, OutOfMemory); createFile (shortVersionNumberLE, OutOfMemory); createFile (shortVersionNumberBE, OutOfMemory); createFile (noOffsetLE, OutOfMemory); createFile (noOffsetBE, OutOfMemory); createFile (shortOffsetLE, OutOfMemory); createFile (shortOffsetBE, OutOfMemory); createFile (zeroOffsetLE, OutOfMemory); createFile (overlappingOffsetLE, OutOfMemory); createFile (invalidOffsetLE, OutOfMemory); } static void test_invalidFileDirectory () { BYTE noNumberOfEntriesLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x80, 0x00, 0x00, 0x00 }; BYTE noNumberOfEntriesBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08 }; BYTE shortNumberOfEntriesLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01 }; BYTE shortNumberOfEntriesBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00 }; BYTE noNextIFDOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noNextIFDOffsetBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 }; BYTE shortNextIFDOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* IFD 1 */ 0x00, 0x00, 0x00 }; BYTE shortNextIFDOffsetBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* IFD 1 */ 0x00, 0x00, 0x00 }; BYTE zeroNumberOfEntries[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x00, /* IFD 1 */ 0x00, 0x00, 0x00, 0x00 }; #if TIFFLIB_VERSION >= 20150621 BYTE recursiveNextIFDOffset[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x0E, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; #endif createFile (noNumberOfEntriesLE, OutOfMemory); createFile (noNumberOfEntriesBE, OutOfMemory); createFile (shortNumberOfEntriesLE, OutOfMemory); createFile (shortNumberOfEntriesBE, OutOfMemory); createFile (noNextIFDOffsetLE, OutOfMemory); createFile (noNextIFDOffsetBE, OutOfMemory); createFile (shortNextIFDOffsetLE, OutOfMemory); createFile (shortNextIFDOffsetBE, OutOfMemory); createFile (zeroNumberOfEntries, OutOfMemory); // Libtiff 4.0.4, released on June 21st 2015, fixed this bug. However, outdated platforms may not have this fix. #if TIFFLIB_VERSION >= 20150621 createFile (recursiveNextIFDOffset, OutOfMemory); #endif } static void test_invalidTag () { BYTE noTagIdLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00 }; BYTE noTagIdBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01 }; BYTE shortTagIdLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE }; BYTE shortTagIdBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00 }; BYTE noTagDataTypeLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00 }; BYTE noTagDataTypeBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE }; BYTE shortTagDataTypeLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04 }; BYTE shortTagDataTypeBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00 }; BYTE noTagDataCountLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00 }; BYTE noTagDataCountBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00, 0x04 }; BYTE shortTagDataCountLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 }; BYTE shortTagDataCountBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00, 0x04, 0x00, 0x00, 0x00 }; BYTE noTagDataOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00 }; BYTE noTagDataOffsetBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01 }; BYTE shortTagDataOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, /* IFD 1 */ 0x01, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE shortTagDataOffsetBE[] = { /* Header */ 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x08, /* IFD 1 */ 0x00, 0x01, /* NewSubFileType */ 0x00, 0xFE, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; BYTE invalidDataOffsetLE[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; createFile (noTagIdLE, OutOfMemory); createFile (noTagIdBE, OutOfMemory); createFile (shortTagIdLE, OutOfMemory); createFile (shortTagIdBE, OutOfMemory); createFile (noTagDataTypeLE, OutOfMemory); createFile (noTagDataTypeBE, OutOfMemory); createFile (shortTagDataTypeLE, OutOfMemory); createFile (shortTagDataTypeBE, OutOfMemory); createFile (noTagDataCountLE, OutOfMemory); createFile (noTagDataCountBE, OutOfMemory); createFile (shortTagDataCountLE, OutOfMemory); createFile (shortTagDataCountBE, OutOfMemory); createFile (noTagDataOffsetLE, OutOfMemory); createFile (noTagDataOffsetBE, OutOfMemory); createFile (shortTagDataOffsetLE, OutOfMemory); createFile (shortTagDataOffsetBE, OutOfMemory); createFile (invalidDataOffsetLE, OutOfMemory); } static void test_missingTag () { BYTE missingImageWidthTag[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0E, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE missingImageHeightTag[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0E, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE missingStripOffsetsTag[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0E, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; createFile (missingImageWidthTag, OutOfMemory); createFile (missingImageHeightTag, OutOfMemory); createFile (missingStripOffsetsTag, OutOfMemory); } static void test_invalidSpecificTag () { BYTE zeroImageWidth[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; BYTE zeroImageHeight[] = { /* Header */ 0x49, 0x49, 0x2A, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x80, 0x3F, 0xE0, 0x50, 0x10, 0x00, /* Number of Tags */ 0x0F, 0x00, /* NewSubFileType */ 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ImageWidth */ 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ImageHeight */ 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* BitsPerSample */ 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, /* Compression */ 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* PhotometricInterpretation */ 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* StripOffsets */ 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, /* SamplesPerPixel */ 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, /* RowsPerStrip */ 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* StripByteCounts */ 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, /* XResolution */ 0x1A, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* YResolution */ 0x1B, 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, /* PlanarConfiguration */ 0x1C, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* ResolutionUnit */ 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Predictor */ 0x3D, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, /* Next IFD Offset */ 0x00, 0x00, 0x00, 0x00, /* BitsPerSample Data */ 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, /* XResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00, /* YResolution Data */ 0x00, 0x77, 0x01, 0x00, 0xE8, 0x03, 0x00, 0x00 }; createFile (zeroImageWidth, OutOfMemory); createFile (zeroImageHeight, OutOfMemory); } int main (int argc, char**argv) { STARTUP; test_valid (); test_units (); test_validGdiplus (); test_invalidHeader (); test_invalidFileDirectory (); test_invalidTag (); test_missingTag (); test_invalidSpecificTag (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testfont.c0000644000175000017500000010024713542674535020514 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include #include "testhelpers.h" static HDC getEmptyHDC () { #if defined(USE_WINDOWS_GDIPLUS) return CreateCompatibleDC (NULL); #else return (HDC)1; #endif } static void *readFile (const char *fileName, int *memoryLength) { void *buffer = NULL; size_t length; size_t read_length; FILE *f = fopen (fileName, "rb"); assert (f && "Expected file to exist."); fseek (f, 0, SEEK_END); length = ftell (f); fseek (f, 0, SEEK_SET); buffer = malloc (length); assert (buffer && "Expected successful allocation of buffer."); read_length = fread (buffer, 1, length, f); assert (read_length && "Expected successful read."); fclose (f); *memoryLength = (int) length; return buffer; } static void verifyFont (GpFont *font, GpFontFamily *originalFamily, INT expectedStyle, Unit expectedUnit) { GpStatus status; GpFontFamily *family; WCHAR originalFamilyName[LF_FACESIZE]; WCHAR familyName[LF_FACESIZE]; Unit unit; INT style; assert (font && "Expected font to be initialized."); status = GdipGetFamily (font, &family); assertEqualInt (status, Ok); assert (family && family != originalFamily); status = GdipGetFamilyName (originalFamily, originalFamilyName, 0); assertEqualInt (status, Ok); status = GdipGetFamilyName (family, familyName, 0); assertEqualInt (status, Ok); assert (!strcmp ((char *) originalFamilyName, (char *) familyName)); status = GdipGetFontUnit (font, &unit); assertEqualInt (status, Ok); assertEqualInt (unit, expectedUnit); status = GdipGetFontStyle(font, &style); assertEqualInt (status, Ok); assertEqualInt (style, expectedStyle); GdipDeleteFontFamily (family); } static void test_newPrivateFontCollection () { GpStatus status; GpFontCollection *collection; INT count; status = GdipNewPrivateFontCollection (&collection); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Negative tests. status = GdipNewPrivateFontCollection (NULL); assertEqualInt (status, InvalidParameter); GdipDeletePrivateFontCollection (&collection); } static void test_deletePrivateFontCollection () { GpStatus status; GpFontCollection *collection; GdipNewPrivateFontCollection(&collection); status = GdipDeletePrivateFontCollection (&collection); assertEqualInt (status, Ok); assert (!collection && "Expected the pointer to be set to NULL."); // Negative tests. status = GdipDeletePrivateFontCollection (NULL); assertEqualInt (status, InvalidParameter); } static void test_getFontCollectionFamilyCount () { GpStatus status; GpFontCollection *collection; INT count; GdipNewPrivateFontCollection(&collection); // Negative tests. status = GdipGetFontCollectionFamilyCount (NULL, &count); assertEqualInt (status, InvalidParameter); status = GdipGetFontCollectionFamilyCount (collection, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePrivateFontCollection (&collection); } static void test_getFontCollectionFamilyList () { GpStatus status; WCHAR *fontFile; GpFontCollection *collection; GpFontFamily *families[2] = {NULL, NULL}; INT numFound; fontFile = createWchar ("test.ttf"); GdipNewPrivateFontCollection(&collection); //Empty list. status = GdipGetFontCollectionFamilyList (collection, 10, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 0); status = GdipGetFontCollectionFamilyList (collection, 0, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 0); status = GdipGetFontCollectionFamilyList (collection, -1, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 0); // Non empty list. GdipPrivateAddFontFile (collection, fontFile); status = GdipGetFontCollectionFamilyList (collection, 0, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 0); assert (families[0] == NULL); assert (families[1] == NULL); // Negative tests. status = GdipGetFontCollectionFamilyList (NULL, 10, families, &numFound); assertEqualInt (status, InvalidParameter); status = GdipGetFontCollectionFamilyList (collection, 10, NULL, &numFound); assertEqualInt (status, InvalidParameter); status = GdipGetFontCollectionFamilyList (collection, 10, families, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePrivateFontCollection (&collection); freeWchar (fontFile); } static void test_privateAddFontFile () { GpStatus status; GpFontCollection *collection; WCHAR *ttfFile; WCHAR *otfFile; WCHAR *invalidFile; WCHAR *noSuchFile; INT count; GpFontFamily *families[1]; INT numFound; WCHAR name[LF_FACESIZE]; GdipNewPrivateFontCollection (&collection); ttfFile = createWchar ("test.ttf"); otfFile = createWchar ("test.otf"); invalidFile = createWchar ("test.bmp"); noSuchFile = createWchar ("noSuchFile.ttf"); // Valid TTF file. status = GdipPrivateAddFontFile (collection, ttfFile); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); status = GdipGetFontCollectionFamilyList (collection, 2, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 1); status = GdipGetFamilyName (families[0], name, 0); assertEqualInt (status, Ok); assert (stringsEqual (name, "Code New Roman")); GdipDeletePrivateFontCollection (&collection); // Valid OTF file. GdipNewPrivateFontCollection (&collection); status = GdipPrivateAddFontFile (collection, otfFile); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); status = GdipGetFontCollectionFamilyList (collection, 2, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 1); status = GdipGetFamilyName (families[0], name, 0); assertEqualInt (status, Ok); assert (stringsEqual (name, "Code New Roman")); GdipDeletePrivateFontCollection (&collection); // Invalid file. GdipNewPrivateFontCollection (&collection); status = GdipPrivateAddFontFile (collection, invalidFile); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Negative tests. status = GdipPrivateAddFontFile (NULL, ttfFile); assertEqualInt (status, InvalidParameter); status = GdipPrivateAddFontFile (collection, NULL); assertEqualInt (status, InvalidParameter); status = GdipPrivateAddFontFile (collection, noSuchFile); assertEqualInt (status, FileNotFound); GdipDeletePrivateFontCollection (&collection); freeWchar (ttfFile); freeWchar (otfFile); freeWchar (invalidFile); freeWchar (noSuchFile); } static void test_privateAddMemoryFont () { GpStatus status; GpFontCollection *collection; void *memory; INT memoryLength; long invalidMemory = 1; INT count; GpFontFamily *families[1]; INT numFound; WCHAR name[LF_FACESIZE]; GdipNewPrivateFontCollection (&collection); memory = readFile ("test.ttf", &memoryLength); // Valid TTF file. status = GdipPrivateAddMemoryFont (collection, memory, memoryLength); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); status = GdipGetFontCollectionFamilyList (collection, 2, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 1); status = GdipGetFamilyName (families[0], name, 0); assertEqualInt (status, Ok); assert (stringsEqual (name, "Code New Roman")); free (memory); GdipDeletePrivateFontCollection (&collection); // Valid OTF file. GdipNewPrivateFontCollection (&collection); memory = readFile ("test.otf", &memoryLength); status = GdipPrivateAddMemoryFont (collection, memory, memoryLength); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); status = GdipGetFontCollectionFamilyList (collection, 2, families, &numFound); assertEqualInt (status, Ok); assertEqualInt (numFound, 1); status = GdipGetFamilyName (families[0], name, 0); assertEqualInt (status, Ok); assert (stringsEqual (name, "Code New Roman")); free (memory); GdipDeletePrivateFontCollection (&collection); // Invalid memory is ignored. GdipNewPrivateFontCollection (&collection); status = GdipPrivateAddMemoryFont (collection, &invalidMemory, 1); assertEqualInt (status, Ok); status = GdipGetFontCollectionFamilyCount (collection, &count); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Negative tests. status = GdipPrivateAddMemoryFont (NULL, &invalidMemory, 1); assertEqualInt (status, InvalidParameter); status = GdipPrivateAddMemoryFont (collection, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipPrivateAddMemoryFont (collection, &invalidMemory, -1); assertEqualInt (status, InvalidParameter); status = GdipPrivateAddMemoryFont (collection, &invalidMemory, 0); assertEqualInt (status, InvalidParameter); GdipDeletePrivateFontCollection (&collection); } static void test_newInstalledFontCollection () { GpStatus status; GpFontCollection *collection1; GpFontCollection *collection2; INT count1; INT count2; status = GdipNewInstalledFontCollection (&collection1); assertEqualInt (status, Ok); assert (collection1 && "Expected collection to be initialized."); status = GdipGetFontCollectionFamilyCount (collection1, &count1); assertEqualInt (status, Ok); assert (count1 >= 0); status = GdipNewInstalledFontCollection (&collection2); assertEqualInt (status, Ok); assert (collection1 == collection2 && "Expected the FontCollecion to be a singleton."); status = GdipGetFontCollectionFamilyCount (collection2, &count2); assertEqualInt (status, Ok); assert (count1 == count2 && "Expected the FontCollection count to remain constant over multiple calls."); } static void test_createFontFromDC () { GpStatus status; GpFont *font; HDC hdc; hdc = getEmptyHDC (); // Negative tests. status = GdipCreateFontFromDC (NULL, &font); assertEqualInt (status, InvalidParameter); // This causes a null pointer dereference in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipCreateFontFromDC (hdc, NULL); assertEqualInt (status, InvalidParameter); #endif } static void test_createFontFromLogfontA () { GpStatus status; GpFont *font; LOGFONTA logfont; HDC hdc; GpFontFamily *nativeFamily; WCHAR nativeFamilyNameW[LF_FACESIZE]; char *nativeFamilyNameA; INT style; Unit unit; GpFontFamily *family; WCHAR familyName[LF_FACESIZE]; hdc = getEmptyHDC (); GdipGetGenericFontFamilySansSerif (&nativeFamily); GdipGetFamilyName (nativeFamily, nativeFamilyNameW, 0); nativeFamilyNameA = charFromWchar (nativeFamilyNameW); logfont.lfHeight = 10; logfont.lfWidth = 11; logfont.lfEscapement = 0; logfont.lfOrientation = 1; logfont.lfWeight = 700; logfont.lfItalic = TRUE; logfont.lfUnderline = TRUE; logfont.lfStrikeOut = TRUE; logfont.lfCharSet = 0; logfont.lfOutPrecision = 1; logfont.lfClipPrecision = 2; logfont.lfQuality = 4; logfont.lfPitchAndFamily = 0x50; strcpy (logfont.lfFaceName, nativeFamilyNameA); status = GdipCreateFontFromLogfontA (hdc, &logfont, &font); assertEqualInt (status, Ok); GdipGetFontStyle (font, &style); assertEqualInt (style, 15); GdipGetFontUnit(font, &unit); assertEqualInt (unit, UnitWorld); status = GdipGetFamily (font, &family); assertEqualInt (status, Ok); GdipGetFamilyName (family, familyName, 0); assert (stringsEqual (familyName, nativeFamilyNameA)); // Negative tests. status = GdipCreateFontFromLogfontA (NULL, &logfont, &font); assertEqualInt (status, InvalidParameter); status = GdipCreateFontFromLogfontA (hdc, NULL, &font); assertEqualInt (status, InvalidParameter); // This causes a null pointer dereference in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipCreateFontFromLogfontA (hdc, &logfont, NULL); assertEqualInt (status, InvalidParameter); #endif GdipDeleteFont (font); GdipDeleteFontFamily (family); GdipDeleteFontFamily (nativeFamily); freeChar (nativeFamilyNameA); } static void test_createFontFromLogfontW () { GpStatus status; GpFont *font; LOGFONTW logfont; HDC hdc; GpFontFamily *nativeFamily; WCHAR nativeFamilyNameW[LF_FACESIZE]; char *nativeFamilyNameA; INT style; Unit unit; GpFontFamily *family; WCHAR familyName[LF_FACESIZE]; hdc = getEmptyHDC (); GdipGetGenericFontFamilySansSerif (&nativeFamily); GdipGetFamilyName (nativeFamily, nativeFamilyNameW, 0); nativeFamilyNameA = charFromWchar (nativeFamilyNameW); logfont.lfHeight = 10; logfont.lfWidth = 11; logfont.lfEscapement = 0; logfont.lfOrientation = 1; logfont.lfWeight = 700; logfont.lfItalic = TRUE; logfont.lfUnderline = TRUE; logfont.lfStrikeOut = TRUE; logfont.lfCharSet = 0; logfont.lfOutPrecision = 1; logfont.lfClipPrecision = 2; logfont.lfQuality = 4; logfont.lfPitchAndFamily = 0x50; memcpy ((void *) logfont.lfFaceName, (void *) nativeFamilyNameW, LF_FACESIZE * sizeof (WCHAR)); status = GdipCreateFontFromLogfontW (hdc, &logfont, &font); assertEqualInt (status, Ok); GdipGetFontStyle (font, &style); assertEqualInt (style, 15); GdipGetFontUnit(font, &unit); assertEqualInt (unit, UnitWorld); status = GdipGetFamily (font, &family); assertEqualInt (status, Ok); GdipGetFamilyName (family, familyName, 0); assertEqualString (familyName, nativeFamilyNameA); // Negative tests. status = GdipCreateFontFromLogfontW (NULL, &logfont, &font); assertEqualInt (status, InvalidParameter); status = GdipCreateFontFromLogfontW (hdc, NULL, &font); assertEqualInt (status, InvalidParameter); // This causes a null pointer dereference in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipCreateFontFromLogfontW (hdc, &logfont, NULL); assertEqualInt (status, InvalidParameter); #endif GdipDeleteFont (font); GdipDeleteFontFamily (family); GdipDeleteFontFamily (nativeFamily); freeChar (nativeFamilyNameA); } static void test_createFont () { GpStatus status; GpFont *font; GpFontFamily *family; GdipGetGenericFontFamilySansSerif (&family); // UnitPixel. status = GdipCreateFont (family, 10, 10, UnitPixel, &font); assertEqualInt (status, Ok); verifyFont (font, family, 10, UnitPixel); // Negative tests. status = GdipCreateFont (NULL, 10, 10, UnitPixel, &font); assertEqualInt (status, InvalidParameter); status = GdipCreateFont (family, 10, 10, UnitPixel, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateFont (family, -1, 10, UnitPixel, &font); assertEqualInt (status, InvalidParameter); status = GdipCreateFont (family, 0, 10, UnitPixel, &font); assertEqualInt (status, InvalidParameter); status = GdipCreateFont (family, 10, 10, UnitDisplay, &font); assertEqualInt (status, InvalidParameter); status = GdipCreateFont (family, 10, 10, (Unit)(UnitWorld - 1), &font); assertEqualInt (status, InvalidParameter); #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreateFont (family, 10, 10, (Unit)(UnitMillimeter + 1), &font); assertEqualInt (status, InvalidParameter); #else status = GdipCreateFont (family, 10, 10, (Unit)(UnitCairoPoint + 1), &font); assertEqualInt (status, InvalidParameter); #endif GdipDeleteFont (font); GdipDeleteFontFamily (family); } static void test_cloneFont () { GpStatus status; GpFontFamily *family; GpFont *font; GpFont *clonedFont; GdipGetGenericFontFamilySansSerif (&family); GdipCreateFont (family, 10, 10, UnitPixel, &font); status = GdipCloneFont (font, &clonedFont); assertEqualInt (status, Ok); assert (clonedFont && font != clonedFont); verifyFont (clonedFont, family, 10, UnitPixel); // Negative tests. status = GdipCloneFont (NULL, &clonedFont); assertEqualInt (status, InvalidParameter); status = GdipCloneFont (font, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFont (clonedFont); } static void test_deleteFont () { GpStatus status; GpFontFamily *family; GpFont *font; GdipGetGenericFontFamilySansSerif (&family); GdipCreateFont (family, 10, 10, UnitPixel, &font); status = GdipDeleteFont (font); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteFont (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_getFamily () { GpStatus status; GpFontFamily *originalFamily; GpFont *font; GpFontFamily *family; GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); // Negative tests. status = GdipGetFamily (NULL, &family); assertEqualInt (status, InvalidParameter); status = GdipGetFamily (font, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); } static void test_getFontStyle () { GpStatus status; GpFontFamily *originalFamily; GpFont *font; INT style; GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); // Negative tests. status = GdipGetFontStyle (NULL, &style); assertEqualInt (status, InvalidParameter); status = GdipGetFontStyle (font, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); } static void test_getFontSize () { GpStatus status; GpFontFamily *originalFamily; GpFont *font; REAL size; GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); status = GdipGetFontSize (font, &size); assertEqualInt (status, Ok); // Negative tests. status = GdipGetFontSize (NULL, &size); assertEqualInt (status, InvalidParameter); status = GdipGetFontSize (font, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); } static void test_getFontUnit () { GpStatus status; GpFontFamily *originalFamily; GpFont *font; Unit unit; GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); // Negative tests. status = GdipGetFontUnit (NULL, &unit); assertEqualInt (status, InvalidParameter); status = GdipGetFontUnit (font, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); } static void test_getFontHeight () { GpStatus status; GpFontFamily *originalFamily; GpFont *font; REAL height; GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); status = GdipGetFontHeight (font, NULL, &height); assertEqualInt (status, Ok); // FIXME: this returns a different value with libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (height, 11.3183594f); #endif // Negative tests. status = GdipGetFontHeight (NULL, NULL, &height); assertEqualInt (status, InvalidParameter); status = GdipGetFontHeight (font, NULL, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); } static void test_getFontHeightGivenDPI () { GpStatus status; GpFontFamily *originalFamily; GpFont *font; REAL height; GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); status = GdipGetFontHeightGivenDPI (font, 10, &height); assertEqualInt (status, Ok); // FIXME: this returns a different value with libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (height, 11.3183594f); #endif // Negative tests. status = GdipGetFontHeightGivenDPI (NULL, 10, &height); assertEqualInt (status, InvalidParameter); status = GdipGetFontHeightGivenDPI (font, 10, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); } static void test_getLogfontA () { GpStatus status; GpBitmap *image; GpGraphics *graphics; GpFontFamily *originalFamily; WCHAR originalFamilyName[32]; GpFont *font; LOGFONTA logfont; GdipCreateBitmapFromScan0 (100, 68, 0, PixelFormat32bppRGB, NULL, &image); GdipGetImageGraphicsContext (image, &graphics); GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); GdipGetFamilyName (originalFamily, originalFamilyName, 0); status = GdipGetLogFontA (font, graphics, &logfont); assertEqualInt (status, Ok); assertEqualInt (logfont.lfHeight, -10); assertEqualInt (logfont.lfWidth, 0); assertEqualInt (logfont.lfEscapement, 0); assertEqualInt (logfont.lfOrientation, 0); assertEqualInt (logfont.lfWeight, 400); assertEqualInt (logfont.lfCharSet, 0); assertEqualInt (logfont.lfOutPrecision, 0); assertEqualInt (logfont.lfClipPrecision, 0); assertEqualInt (logfont.lfQuality, 0); assertEqualInt (logfont.lfPitchAndFamily, 0); assert (stringsEqual (originalFamilyName, logfont.lfFaceName)); // Negative tests. status = GdipGetLogFontA (NULL, graphics, &logfont); assertEqualInt (status, InvalidParameter); status = GdipGetLogFontA (font, NULL, &logfont); assertEqualInt (status, InvalidParameter); status = GdipGetLogFontA (font, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); GdipDisposeImage ((GpImage *) image); } static void test_getLogfontW () { GpStatus status; GpBitmap *image; GpGraphics *graphics; GpFontFamily *originalFamily; WCHAR originalFamilyName[32]; GpFont *font; LOGFONTW logfont; GdipCreateBitmapFromScan0 (100, 68, 0, PixelFormat32bppRGB, NULL, &image); GdipGetImageGraphicsContext (image, &graphics); GdipGetGenericFontFamilySansSerif (&originalFamily); GdipCreateFont (originalFamily, 10, 10, UnitPixel, &font); GdipGetFamilyName (originalFamily, originalFamilyName, 0); status = GdipGetLogFontW (font, graphics, &logfont); assertEqualInt (status, Ok); assertEqualInt (logfont.lfHeight, -10); assertEqualInt (logfont.lfWidth, 0); assertEqualInt (logfont.lfEscapement, 0); assertEqualInt (logfont.lfOrientation, 0); assertEqualInt (logfont.lfWeight, 400); assertEqualInt (logfont.lfCharSet, 0); assertEqualInt (logfont.lfOutPrecision, 0); assertEqualInt (logfont.lfClipPrecision, 0); assertEqualInt (logfont.lfQuality, 0); assertEqualInt (logfont.lfPitchAndFamily, 0); assert (!strcmp ((char *) originalFamilyName, (char *) logfont.lfFaceName)); // Negative tests. status = GdipGetLogFontW (NULL, graphics, &logfont); assertEqualInt (status, InvalidParameter); status = GdipGetLogFontW (font, NULL, &logfont); assertEqualInt (status, InvalidParameter); status = GdipGetLogFontW (font, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFont (font); GdipDeleteFontFamily (originalFamily); GdipDisposeImage ((GpImage *) image); } static const WCHAR Tahoma[] = {'T', 'a', 'h', 'o', 'm', 'a', 0}; static const WCHAR CodeNewRoman[] = {'C', 'o', 'd', 'e', ' ', 'N', 'e', 'w', ' ', 'R', 'o', 'm', 'a', 'n', 0}; static const WCHAR NoSuchFont[] = {'A', 'B', 'C', 0}; static void verifyFontFamily (GpFontFamily *family, const char *expectedName, UINT16 expectedCellAscent, UINT16 expectedCellDescent, UINT16 expectedLineSpacing, const char *alternateExpectedName, UINT16 alternateCellAscent, UINT16 alternateCellDescent, UINT16 alternateLineSpacing) { GpStatus status; WCHAR name[LF_FACESIZE]; UINT16 emHeight; UINT16 cellAscent; UINT16 cellDescent; UINT16 lineSpacing; status = GdipGetFamilyName (family, name, 1); assertEqualInt (status, Ok); assert (stringsEqual (name, expectedName) || stringsEqual (name, alternateExpectedName)); status = GdipGetEmHeight (family, FontStyleRegular, &emHeight); assertEqualInt (status, Ok); assertEqualInt (emHeight, 2048); status = GdipGetCellAscent (family, FontStyleRegular, &cellAscent); assertEqualInt (status, Ok); assert (cellAscent == expectedCellAscent || cellAscent == alternateCellAscent); status = GdipGetCellDescent (family, FontStyleRegular, &cellDescent); assertEqualInt (status, Ok); assert (cellDescent == expectedCellDescent || cellDescent == alternateCellDescent); status = GdipGetLineSpacing (family, FontStyleRegular, &lineSpacing); assertEqualInt (status, Ok); assert (lineSpacing == expectedLineSpacing || lineSpacing == alternateLineSpacing); GdipDeleteFontFamily (family); } static void test_createFontFamilyFromName () { GpStatus status; GpFontFamily *family; GpFontCollection *collection; WCHAR *fontName; GdipNewPrivateFontCollection (&collection); fontName = createWchar ("test.ttf"); GdipPrivateAddFontFile (collection, fontName); status = GdipCreateFontFamilyFromName (Tahoma, NULL, &family); assertEqualInt (status, Ok); verifyFontFamily (family, "Tahoma", 2049, 423, 2472, "DejaVu Sans", 1901, 483, 2384); status = GdipCreateFontFamilyFromName (CodeNewRoman, collection, &family); assertEqualInt (status, Ok); verifyFontFamily (family, "Code New Roman", 1884, 514, 2398, "Code New Roman", 1884, 514, 2398); // Negative tests. status = GdipCreateFontFamilyFromName (NULL, collection, &family); assertEqualInt (status, InvalidParameter); status = GdipCreateFontFamilyFromName (CodeNewRoman, collection, NULL); assertEqualInt (status, InvalidParameter); // FIXME: Libgdiplus does not validate that the font family exists // if the collection is NULL. #if defined(USE_WINDOWS_GDIPLUS) status = GdipCreateFontFamilyFromName (NoSuchFont, NULL, &family); assertEqualInt (status, FontFamilyNotFound); #endif status = GdipCreateFontFamilyFromName (Tahoma, collection, &family); assertEqualInt (status, FontFamilyNotFound); status = GdipCreateFontFamilyFromName (NoSuchFont, collection, &family); assertEqualInt (status, FontFamilyNotFound); GdipDeletePrivateFontCollection (&collection); freeWchar (fontName); } static void test_cloneFontFamily () { GpStatus status; GpFontFamily *family; GpFontFamily *clonedFamily; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); status = GdipCloneFontFamily (family, &clonedFamily); assertEqualInt (status, Ok); verifyFontFamily (clonedFamily, "Tahoma", 2049, 423, 2472, "DejaVu Sans", 1901, 483, 2384); // Negative tests. status = GdipCloneFontFamily (NULL, &clonedFamily); assertEqualInt (status, InvalidParameter); status = GdipCloneFontFamily (family, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_deleteFontFamily () { GpStatus status; GpFontFamily *family; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); status = GdipDeleteFontFamily (family); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteFontFamily (NULL); assertEqualInt (status, InvalidParameter); } static void test_getGenericFontFamilySansSerif () { GpStatus status; GpFontFamily *family1; GpFontFamily *family2; status = GdipGetGenericFontFamilySansSerif (&family1); assertEqualInt (status, Ok); assert (family1); status = GdipGetGenericFontFamilySansSerif (&family2); assertEqualInt (status, Ok); assert (family2 && family1 == family2); // Negative tests. status = GdipGetGenericFontFamilySansSerif (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family1); GdipDeleteFontFamily (family2); } static void test_getGenericFontFamilySerif () { GpStatus status; GpFontFamily *family1; GpFontFamily *family2; status = GdipGetGenericFontFamilySerif (&family1); assertEqualInt (status, Ok); assert (family1); status = GdipGetGenericFontFamilySerif (&family2); assertEqualInt (status, Ok); assert (family2 && family1 == family2); // Negative tests. status = GdipGetGenericFontFamilySerif (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family1); GdipDeleteFontFamily (family2); } static void test_getGenericFontFamilyMonospace () { GpStatus status; GpFontFamily *family1; GpFontFamily *family2; status = GdipGetGenericFontFamilyMonospace (&family1); assertEqualInt (status, Ok); assert (family1); status = GdipGetGenericFontFamilyMonospace (&family2); assertEqualInt (status, Ok); assert (family2 && family1 == family2); // Negative tests. status = GdipGetGenericFontFamilyMonospace (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family1); GdipDeleteFontFamily (family2); } static void test_getFamilyName () { GpStatus status; GpFontFamily *family; WCHAR name[LF_FACESIZE]; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); status = GdipGetFamilyName (family, name, 57920); assertEqualInt (status, Ok); assert (stringsEqual(name, "Tahoma") || stringsEqual (name, "DejaVu Sans")); // Negative tests. status = GdipGetFamilyName (NULL, name, 1); assertEqualInt (status, InvalidParameter); status = GdipGetFamilyName (family, NULL, 1); assertEqualInt (status, Ok); status = GdipGetFamilyName (NULL, NULL, 1); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_isStyleAvailable () { GpStatus status; GpFontFamily *family; BOOL isStyleAvailable; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); status = GdipIsStyleAvailable (family, FontStyleBold, &isStyleAvailable); assertEqualInt (status, Ok); assert (isStyleAvailable); status = GdipIsStyleAvailable (family, -1, &isStyleAvailable); assertEqualInt (status, Ok); assert (isStyleAvailable); status = GdipIsStyleAvailable (family, FontStyleStrikeout + 1, &isStyleAvailable); assertEqualInt (status, Ok); assert (isStyleAvailable); // Negative tests. status = GdipIsStyleAvailable (NULL, FontStyleBold, &isStyleAvailable); assertEqualInt (status, InvalidParameter); status = GdipIsStyleAvailable (family, FontStyleBold, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_getEmHeight () { GpStatus status; GpFontFamily *family; UINT16 emHeight; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); // Negative tests. status = GdipGetEmHeight (NULL, FontStyleBold, &emHeight); assertEqualInt (status, InvalidParameter); status = GdipGetEmHeight (family, FontStyleBold, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_getCellAscent () { GpStatus status; GpFontFamily *family; UINT16 cellAscent; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); // Negative tests. status = GdipGetCellAscent (NULL, FontStyleBold, &cellAscent); assertEqualInt (status, InvalidParameter); status = GdipGetCellAscent (family, FontStyleBold, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_getCellDescent () { GpStatus status; GpFontFamily *family; UINT16 cellDescent; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); // Negative tests. status = GdipGetCellDescent (NULL, FontStyleBold, &cellDescent); assertEqualInt (status, InvalidParameter); status = GdipGetCellDescent (family, FontStyleBold, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } static void test_getLineSpacing () { GpStatus status; GpFontFamily *family; UINT16 lineSpacing; GdipCreateFontFamilyFromName (Tahoma, NULL, &family); // Negative tests. status = GdipGetLineSpacing (NULL, FontStyleBold, &lineSpacing); assertEqualInt (status, InvalidParameter); status = GdipGetLineSpacing (family, FontStyleBold, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteFontFamily (family); } int main(int argc, char**argv) { STARTUP; test_newPrivateFontCollection (); test_deletePrivateFontCollection (); test_getFontCollectionFamilyCount (); test_getFontCollectionFamilyList (); test_privateAddMemoryFont (); test_privateAddFontFile (); test_newInstalledFontCollection (); test_createFontFromDC (); test_createFontFromLogfontA (); test_createFontFromLogfontW (); test_createFont (); test_cloneFont (); test_deleteFont (); test_getFamily (); test_getFontStyle (); test_getFontSize (); test_getFontUnit (); test_getFontHeight (); test_getFontHeightGivenDPI (); test_getLogfontA (); test_getLogfontW (); test_createFontFamilyFromName (); test_cloneFontFamily (); test_deleteFontFamily (); test_getGenericFontFamilySansSerif (); test_getGenericFontFamilySerif (); test_getGenericFontFamilyMonospace (); test_getFamilyName (); test_isStyleAvailable (); test_getEmHeight (); test_getCellAscent (); test_getCellDescent (); test_getLineSpacing (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.emf0000644000175000017500000007311413542672033020143 0ustar directhexdirecthexlccN EMFLvE+cc QuccddP(x0u dd(dd``libgdiplus-6.0.4+dfsg/tests/testcodecs.c0000644000175000017500000002452013542672230020773 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" #define verifyImageCodecInfo(codec, expectedClsid, expectedFormatID, expectedCodecName, expectedFormatDescription, expectedFilenameExtension, expectedMimeType, expectedFlags, expectedVersion, expectedSigCount, expectedSigPattern, expectedSigMask) \ { \ assertEqualGuid (codec.Clsid, expectedClsid); \ assertEqualGuid (codec.FormatID, expectedFormatID); \ assertEqualString (codec.CodecName, expectedCodecName); \ assert (codec.DllName == NULL); \ assertEqualString (codec.FormatDescription, expectedFormatDescription); \ assertEqualString (codec.FilenameExtension, expectedFilenameExtension); \ assertEqualString (codec.MimeType, expectedMimeType); \ assertEqualInt (codec.Flags, expectedFlags); \ assertEqualInt (codec.Version, expectedVersion); \ assertEqualInt (codec.SigCount, expectedSigCount); \ assertEqualInt (codec.SigSize, sizeof (expectedSigPattern) / expectedSigCount); \ assertEqualBytes (codec.SigPattern, expectedSigPattern, codec.SigSize); \ assertEqualBytes (codec.SigMask, expectedSigMask, codec.SigSize); \ } static void test_getImageDecodersSize () { GpStatus status; UINT numDecoders; UINT size; status = GdipGetImageDecodersSize (&numDecoders, &size); assertEqualInt (status, Ok); assertEqualInt (numDecoders, 8); //assertEqualInt (size, 8 * sizeof (ImageCodecInfo)); // Negative tests. // FIXME: this causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetImageDecodersSize (&numDecoders, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetImageDecodersSize (NULL, &size); assertEqualInt (status, InvalidParameter); #endif } static void test_getImageDecoders () { GpStatus status; UINT numDecoders; UINT size; ImageCodecInfo *codecs; GdipGetImageDecodersSize (&numDecoders, &size); codecs = (ImageCodecInfo *) malloc (size); status = GdipGetImageDecoders (numDecoders, size, codecs); assertEqualInt (status, Ok); BYTE bmpSigPattern[] = {0x42, 0x4D}; BYTE bmpSigMask[] = {0xFF, 0xFF}; verifyImageCodecInfo (codecs[0], bmpEncoderClsid, bmpRawFormat, "Built-in BMP Codec", "BMP", "*.BMP;*.DIB;*.RLE", "image/bmp", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, bmpSigPattern, bmpSigMask); BYTE jpegSigPattern[] = {0xFF, 0xD8}; BYTE jpegSigMask[] = {0xFF, 0xFF}; verifyImageCodecInfo (codecs[1], jpegEncoderClsid, jpegRawFormat, "Built-in JPEG Codec", "JPEG", "*.JPG;*.JPEG;*.JPE;*.JFIF", "image/jpeg", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, jpegSigPattern, jpegSigMask); BYTE gifSigPattern[] = {0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x47, 0x49, 0x46, 0x38, 0x37, 0x61}; BYTE gifSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[2], gifEncoderClsid, gifRawFormat, "Built-in GIF Codec", "GIF", "*.GIF", "image/gif", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 2, gifSigPattern, gifSigMask); BYTE emfSigPattern[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x45, 0x4D, 0x46}; BYTE emfSigMask[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[3], emfEncoderClsid, emfRawFormat, "Built-in EMF Codec", "EMF", "*.EMF", "image/x-emf", ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, emfSigPattern, emfSigMask); BYTE wmfSigPattern[] = {0xD7, 0xCD, 0xC6, 0x9A}; BYTE wmfSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[4], wmfEncoderClsid, wmfRawFormat, "Built-in WMF Codec", "WMF", "*.WMF", "image/x-wmf", ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, wmfSigPattern, wmfSigMask); BYTE tiffSigPattern[] = {0x49, 0x49, 0x4D, 0x4D}; BYTE tiffSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[5], tifEncoderClsid, tifRawFormat, "Built-in TIFF Codec", "TIFF", "*.TIF;*.TIFF", "image/tiff", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 2, tiffSigPattern, tiffSigMask); BYTE pngSigPattern[] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}; BYTE pngSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[6], pngEncoderClsid, pngRawFormat, "Built-in PNG Codec", "PNG", "*.PNG", "image/png", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, pngSigPattern, pngSigMask); BYTE icoSigPattern[] = {0x00, 0x00, 0x01, 0x00}; BYTE icoSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[7], icoEncoderClsid, icoRawFormat, "Built-in ICO Codec", "ICO", "*.ICO", "image/x-icon", ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, icoSigPattern, icoSigMask); // Negative tests. status = GdipGetImageDecoders (0, size, codecs); assertEqualInt (status, GenericError); status = GdipGetImageDecoders (numDecoders - 1, size, codecs); assertEqualInt (status, GenericError); status = GdipGetImageDecoders (numDecoders + 1, size, codecs); assertEqualInt (status, GenericError); status = GdipGetImageDecoders (numDecoders, 0, codecs); assertEqualInt (status, GenericError); status = GdipGetImageDecoders (numDecoders, size - 1, codecs); assertEqualInt (status, GenericError); status = GdipGetImageDecoders (numDecoders, size + 1, codecs); assertEqualInt (status, GenericError); status = GdipGetImageDecoders (numDecoders, size, NULL); assertEqualInt (status, GenericError); free (codecs); } static void test_getImageEncodersSize () { GpStatus status; UINT numEncoders; UINT size; status = GdipGetImageEncodersSize (&numEncoders, &size); assertEqualInt (status, Ok); assertEqualInt (numEncoders, 5); //assertEqualInt (size, 5 * sizeof (ImageCodecInfo)); // Negative tests. // FIXME: this causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetImageEncodersSize (&numEncoders, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetImageEncodersSize (NULL, &size); assertEqualInt (status, InvalidParameter); #endif } static void test_getImageEncoders () { GpStatus status; UINT numEncoders; UINT size; ImageCodecInfo *codecs; GdipGetImageEncodersSize (&numEncoders, &size); codecs = (ImageCodecInfo *) malloc (size); status = GdipGetImageEncoders (numEncoders, size, codecs); assertEqualInt (status, Ok); BYTE bmpSigPattern[] = {0x42, 0x4D}; BYTE bmpSigMask[] = {0xFF, 0xFF}; verifyImageCodecInfo (codecs[0], bmpEncoderClsid, bmpRawFormat, "Built-in BMP Codec", "BMP", "*.BMP;*.DIB;*.RLE", "image/bmp", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, bmpSigPattern, bmpSigMask); BYTE jpegSigPattern[] = {0xFF, 0xD8}; BYTE jpegSigMask[] = {0xFF, 0xFF}; verifyImageCodecInfo (codecs[1], jpegEncoderClsid, jpegRawFormat, "Built-in JPEG Codec", "JPEG", "*.JPG;*.JPEG;*.JPE;*.JFIF", "image/jpeg", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, jpegSigPattern, jpegSigMask); BYTE gifSigPattern[] = {0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x47, 0x49, 0x46, 0x38, 0x37, 0x61}; BYTE gifSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[2], gifEncoderClsid, gifRawFormat, "Built-in GIF Codec", "GIF", "*.GIF", "image/gif", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 2, gifSigPattern, gifSigMask); BYTE tiffSigPattern[] = {0x49, 0x49, 0x4D, 0x4D}; BYTE tiffSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[3], tifEncoderClsid, tifRawFormat, "Built-in TIFF Codec", "TIFF", "*.TIF;*.TIFF", "image/tiff", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 2, tiffSigPattern, tiffSigMask); BYTE pngSigPattern[] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}; BYTE pngSigMask[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; verifyImageCodecInfo (codecs[4], pngEncoderClsid, pngRawFormat, "Built-in PNG Codec", "PNG", "*.PNG", "image/png", ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, 1, 1, pngSigPattern, pngSigMask); // Negative tests. status = GdipGetImageEncoders (0, size, codecs); assertEqualInt (status, GenericError); status = GdipGetImageEncoders (numEncoders - 1, size, codecs); assertEqualInt (status, GenericError); status = GdipGetImageEncoders (numEncoders + 1, size, codecs); assertEqualInt (status, GenericError); status = GdipGetImageEncoders (numEncoders, 0, codecs); assertEqualInt (status, GenericError); status = GdipGetImageEncoders (numEncoders, size - 1, codecs); assertEqualInt (status, GenericError); status = GdipGetImageEncoders (numEncoders, size + 1, codecs); assertEqualInt (status, GenericError); status = GdipGetImageEncoders (numEncoders, size, NULL); assertEqualInt (status, GenericError); free (codecs); } int main (int argc, char**argv) { STARTUP; test_getImageDecodersSize (); test_getImageDecoders (); test_getImageEncodersSize (); test_getImageEncoders (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test-trns.png0000644000175000017500000000035513233636545021146 0ustar directhexdirecthexPNG  IHDRY *PLTESI tRNS 0@`p(eIDATx^c ( q/ qj8w8w $޽SIp  = 0B8@ԭ)= )D an! H@0R؇/IENDB`libgdiplus-6.0.4+dfsg/tests/testhatchbrush.c0000644000175000017500000001166513542674535021706 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void test_clone () { GpStatus status; GpBrush *brush; GpBrushType brushType; GpBrush *clone; GpHatchStyle hatchStyle; ARGB foregroundColor; ARGB backgroundColor; GdipCreateHatchBrush (HatchStyle10Percent, 0x00000001, 0x00000002, (GpHatch **)&brush); status = GdipCloneBrush (brush, &clone); assertEqualInt (status, Ok); assert (clone && brush != clone); GdipGetBrushType (clone, &brushType); assertEqualInt (brushType, BrushTypeHatchFill); GdipGetHatchStyle ((GpHatch *) clone, &hatchStyle); assertEqualInt (hatchStyle, HatchStyle10Percent); GdipGetHatchForegroundColor ((GpHatch *) clone, &foregroundColor); assertEqualInt (foregroundColor, 0x00000001); GdipGetHatchBackgroundColor ((GpHatch *) clone, &backgroundColor); assertEqualInt (backgroundColor, 0x00000002); GdipDeleteBrush (brush); GdipDeleteBrush (clone); } static void test_delete () { GpStatus status; GpHatch *brush; GdipCreateHatchBrush (HatchStyle05Percent, 0x00000001, 0x00000002, &brush); status = GdipDeleteBrush ((GpBrush *) brush); assertEqualInt (status, Ok); } static void test_createHatchBrush () { GpStatus status; GpHatch *brush; GpBrushType brushType; status = GdipCreateHatchBrush (HatchStyleMin, 0x00000001, 0x00000002, &brush); assertEqualInt (status, Ok); assert (brush != NULL && "Expected the brush to be initialized."); status = GdipGetBrushType ((GpBrush *) brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeHatchFill); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateHatchBrush (HatchStyleMax, 0x00000001, 0x00000002, &brush); assertEqualInt (status, Ok); assert (brush != NULL && "Expected the brush to be initialized."); GdipDeleteBrush ((GpBrush *)brush); // Negative tests. brush = (GpHatch *) 0xCC; status = GdipCreateHatchBrush (HatchStyle05Percent, 0x00000001, 0x00000002, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpHatch *) 0xCC); brush = (GpHatch *) 0xCC; status = GdipCreateHatchBrush ((HatchStyle)(HatchStyleMin - 1), 0x00000001, 0x00000002, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpHatch *) 0xCC); brush = (GpHatch *) 0xCC; status = GdipCreateHatchBrush ((HatchStyle)(HatchStyleMax + 1), 0x00000001, 0x00000002, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpHatch *) 0xCC); } static void test_getHatchStyle () { GpStatus status; GpHatch *brush; GpHatchStyle hatchStyle; GdipCreateHatchBrush (HatchStyle05Percent, 0x00000001, 0x00000002, &brush); status = GdipGetHatchStyle (brush, &hatchStyle); assertEqualInt (status, Ok); assertEqualInt (hatchStyle, HatchStyle05Percent); // Negative tests. status = GdipGetHatchStyle (NULL, &hatchStyle); assertEqualInt (status, InvalidParameter); status = GdipGetHatchStyle (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getForegroundColor () { GpStatus status; GpHatch *brush; ARGB foregroundColor; GdipCreateHatchBrush (HatchStyle05Percent, 0x00000001, 0x00000002, &brush); status = GdipGetHatchForegroundColor (brush, &foregroundColor); assertEqualInt (status, Ok); assertEqualInt (foregroundColor, 0x00000001); // Negative tests. status = GdipGetHatchForegroundColor (NULL, &foregroundColor); assertEqualInt (status, InvalidParameter); status = GdipGetHatchForegroundColor (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getBackgroundColor () { GpStatus status; GpHatch *brush; ARGB backgroundColor; GdipCreateHatchBrush (HatchStyle05Percent, 0x00000001, 0x00000002, &brush); status = GdipGetHatchBackgroundColor (brush, &backgroundColor); assertEqualInt (status, Ok); assertEqualInt (backgroundColor, 0x00000002); // Negative tests. status = GdipGetHatchBackgroundColor (NULL, &backgroundColor); assertEqualInt (status, InvalidParameter); status = GdipGetHatchBackgroundColor (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } int main (int argc, char**argv) { STARTUP; test_clone (); test_delete (); test_createHatchBrush (); test_getHatchStyle (); test_getForegroundColor (); test_getBackgroundColor (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testbrush.c0000644000175000017500000000322213542674535020664 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void test_getBrushType () { GpStatus status; GpSolidFill *brush; GpBrushType brushType; GdipCreateSolidFill (1, &brush); // Negative tests. status = GdipGetBrushType (NULL, &brushType); assertEqualInt (status, InvalidParameter); status = GdipGetBrushType ((GpBrush *) brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_clone () { GpStatus status; GpSolidFill *brush; GpBrush *clone; GdipCreateSolidFill (1, &brush); // Negative tests. status = GdipCloneBrush (NULL, &clone); assertEqualInt (status, InvalidParameter); status = GdipCloneBrush ((GpBrush *) brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_delete () { GpStatus status; GpSolidFill *brush; GdipCreateSolidFill (1, &brush); status = GdipDeleteBrush ((GpBrush *) brush); assertEqualInt (status, Ok); // Negative tests. status = GdipDeleteBrush (NULL); assertEqualInt (status, InvalidParameter); } int main (int argc, char**argv) { STARTUP; test_getBrushType (); test_clone (); test_delete (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.bmp0000644000175000017500000004774612377405421020166 0ustar directhexdirecthexBMO6(dDO  ÿyurnyZYc@>Q&igzcco87@oqTUq'vw $BCXtyGKgNPr;=`DEkNNr8()EhjrptORq,1R46Y;<^@Ba$%A=>RЍ* #%-%)F %D?Y.Y[e iltls18S#*E(*H;>Z=?W&8:D24?햚ƪơv~-4M!=/:=R/1C57A z~JMUy}tv~adrSUgPShW[t16OCHa린KThGKc"&>SWjlo~#%/ $/  47?PS[wy\bg㬰:=Rhl15NHNe?FYNVgX`qY^s*/DSWi]`e) "-(pr|QT\ 49B mq|uxbezEIaVZrzAHWKRaPWhEL]@ET" *,6()3%|fmp5;By~LQ`]bqNUd@GV39Fsv{ !*+5"!+~}~ '(6"*#x{,/>"1]`oIN]3;H.4?sx(*4$%%67E')4 $GGW7=J#,6.5>:@Gmpu #$&. *"$/GFVȃ& * -$-%.#GJOOQY)+3()3 -+?0.B$$!1%31 &V[^25:'*/ 68@&)#: $0-=_^h !&  "HMP  -05%"1#2'0, !(+_cd0/1 ! ,/4%xw" "$%"$%///+++###&&&A@By}~')* ///tttnnnHHH999 gfh`de"'("'(PRSZ\]  555{{{NNNUTV"!#+*,tsucgh  $)*uwx <<@Alno㪬MOP GGGVUW! ">=?879%$&NPQptu`efejk<>? "#!"GIJݜmop79:(*+!!!FFFnmo@?A102768w|}PUVgijSUV>@A467<>?!"  ! <<<:::[Z\*)+vxyX]^VXYsuv<>?IKLacd "$%   !"[[[111qst=?@8:;WYZcef')*    #%&*,- !:::ZZZ:::srtegh !JLMEGH;=>#%& !   689,./cccKKKQQQ@?A σBFG     +-.9;<   )+,PRSDFG?ABPPPIII"!# npqTVW-/0 ,./,./    +-.)+,Z\]WWW102      BDE/12     (*+EDF    /12MOP467  -/0.0179:DFG/.0$#%     )+,@BCCEF 8:;=?@ACD467      ACD*,-[]^;=>EGH 799KMNWYY;;;체 &((     =AB?ABSUV=??:::ab````Z[YVTSZ[Y !##  "&EIJPTU.01!";== ""%&$WXVVWURPOjhg]\X<;7UUUPRS  "$%+-.  !&() -/0GIJ^`adfg^^^FFFccc$$$ 20/dbaa`\^[Wolh]ZV=<8GIJ *,- "#  245EGH"$% ,./FHIikluwxxzzbbbJJJddd"#! 643hgclieliezwsgd`QPLIJH(** >@@ttt%&*#$(!!KLPghl;<@"#'IKLa`bzzzpppxxxRPPQONYWV  MJFxuqd_\kgbwsnTQMBCA )+++--RTTգy}~fgkbdeDDDttt999 !&'+ !%-.2 $*+/`ae_`dLMQhim{z|iiiOOOddd^\[~|{ged&$#)&"XUQytqkfcsoj{ie`ROKcdbJLLDFFRTTBDD=??紷knrILP#&* &()111{}}   #($#ADI1498;@]`ex{sv{ilqoptZY[PNNjhhommca`usrc_^=98>96`[Xzurtol{v}x`ZUQLIWWW>@ARTUbdePRSXZ[SUV&()RTUsuvcgl9=B $)##  "'(,1$&*/bfk "#&)-!&!&"/27KNS=@E;eee79:689SUVXZ[WYZVXYKMN<>?:<=+-.     !##"$(-"&+,05NRW'*/ -08.19!)PS[^aiFIQ(+3GJRqt|ehpSV^SV[UTXrqsnkm|zzqoo532510xts|y{vs~b]ZPLKiii[]^OQRFHI@BC=?@BDEJLM?ABBDEEGHEGH;=>-/0')*&*+"%* $)#',&*/!%*#(.27BFKpty$&& "&' !$,>AI:=EBEM]`h[^fWZb\_gadlORZX[c_bjLOW\^fcdhvuypoqa`droqlikA??TRRsno~}ojiLHGihjcef]_`XZ[SUVKMNACD9;<-/0.01134356.01(*+)+,./3:=A15:)-2*.3=AFhlq^^dEDMJON  !&%&*+ !#-13=^`jegqfhrrt~@BLHJTRT^wy^`j^`jpr|PR\ehpkmuvv|ssycdh^^djimdcgPOQPOQdacmkk_Z[LIK\[]`aebcgbcgefjdeiVW[DEIEFJEFJFGKEFJ<=A126,-1-.2.15SVZ*HHZ&+* 387"&'!$,Z\f_ak]_i^`jOQ[UWabdnTV`@BLUWaZ\flnxwy]_ilnxbdnoqymowegogfocciZZ`WW]hflnmqyx|yuza]bFEILMQUVZVW[NOSPQUWX\PQUABF@AE;<@;<@EFJWX\rswghrYZhCEW04G, 9',+  !&%*./CFNNR]NR]<@KNR][_jPT_imxcgrNR]BFQMQ\VZeY]haepfjuTXcdfphjtceo]^hPRZJLTQS[TTZppvdbhVTZDEI9:>HIMPQUMNRSTXcdhlmqijnӍw{gk,2O (>:?X񄉈  165BGJLQZ04?]alԑW[fQU`Z^iX\gY]hIMXFJU]alW[fPT_W[f]`nXZeFHS;=G@BMJKU|}dfnxzfenJJP98Aܨșx[d-6[ 176tzy=CB$*)>DC  "! %+*:@?OTWHMV|񧪸Y\jKN\Z]k`cqUXfUXfUXfRUcNTaKQ^TYhQTb9I?;G]YdhflnmqQPT>=AVUYonr䢦qt]`?Cs#$V-+YLHqUTvIJd&+$7 '2$)>@FY_fuQYfɈ}ehFYXprptX_rPYg1:H*1@4;L &#8%+>MTcAIVٞnt?GB58d06Y08U09M8BS)3D9AR:AT1'*1BHN[39DoyNZf&9&=%6Q*:WN[{~FKl7 0 9D4 3 '1CIPdAH\0HL_CHWfkt&/<%3F(C0Cd9Lo6HmVfO['I-2SEGf!D5@9&J'E ,D/4V[tfkCG`Z]rXZl񒖡&8FSm>OpH[Qd|҂QY~?Ac=<\22V',]\dnx_kAKmP\xMUrHOjPSrikllSRlsrU\uALlfuevgyÊR[6;bIImC@`/.UbfeoDPzAJo5@`AHiDIh@Bejkmlusw|?HiakВ_eADjHIk:8V&$Hmr]eM;DovCLn4;\SXyGGkOMqd`䌑~ah}hk>?a33Q+'D+*JKNzKS3=e};Ca-2Q.1PKJl㨫ʥ˨̞bd&'C) #5/3V 1,5Vjt5:SW[tﵵŤ_i)2F:DU ΁vlibgdiplus-6.0.4+dfsg/tests/testsolidbrush.c0000644000175000017500000004216113545154626021721 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void test_clone () { GpStatus status; GpSolidFill *brush; GpBrushType brushType; GpBrush *clone; ARGB solidColor; status = GdipCreateSolidFill (0x010203040, &brush); assertEqualInt (status, Ok); status = GdipCloneBrush ((GpBrush *) brush, &clone); assertEqualInt (status, Ok); assert (clone && brush != clone); status = GdipGetBrushType (clone, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor ((GpSolidFill *) clone, &solidColor); assertEqualInt (status, Ok); assertEqualARGB (solidColor, 0x010203040); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteBrush (clone); } static void test_delete () { GpStatus status; GpSolidFill *brush; status = GdipCreateSolidFill (0x010203040, &brush); assertEqualInt (status, Ok); status = GdipDeleteBrush ((GpBrush *) brush); assertEqualInt (status, Ok); } static void test_createSolidFill () { GpStatus status; GpSolidFill *brush; GpBrushType brushType; ARGB color; status = GdipCreateSolidFill (0x010203040, &brush); assertEqualInt (status, Ok); assert (brush && "Expected the brush to be initialized."); status = GdipGetBrushType ((GpBrush *) brush, &brushType); assertEqualInt (status, Ok); assertEqualInt (brushType, BrushTypeSolidColor); status = GdipGetSolidFillColor (brush, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x010203040); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. status = GdipCreateSolidFill (0x010203040, NULL); assertEqualInt (status, InvalidParameter); } static void test_getSolidFillColor () { GpStatus status; GpSolidFill *brush; ARGB color; status = GdipCreateSolidFill (0xFF000000, &brush); assertEqualInt (status, Ok); // Negative tests. status = GdipGetSolidFillColor (NULL, &color); assertEqualInt (status, InvalidParameter); status = GdipGetSolidFillColor (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setSolidFillColor () { GpStatus status; GpSolidFill *brush; ARGB color; status = GdipCreateSolidFill (0xFF000000, &brush); assertEqualInt (status, Ok); // Set new. status = GdipSetSolidFillColor (brush, 0x010203040); assertEqualInt (status, Ok); status = GdipGetSolidFillColor (brush, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x010203040); // Set same. status = GdipSetSolidFillColor (brush, 0x010203040); assertEqualInt (status, Ok); status = GdipGetSolidFillColor (brush, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x010203040); // Negative tests. status = GdipSetSolidFillColor (NULL, 0x010203040); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_fill () { GpStatus status; GpSolidFill *brush; GpBitmap *bitmap; GpGraphics *graphics; ARGB color; status = GdipCreateSolidFill (0xDDA03040, &brush); assertEqualInt (status, Ok); // PixelFormat32bppARGB. status = GdipCreateBitmapFromScan0 (256, 256, 0, PixelFormat32bppARGB, NULL, &bitmap); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext ((GpImage *) bitmap, &graphics); assertEqualInt (status, Ok); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - CompositingModeSourceOver. status = GdipSetCompositingMode (graphics, CompositingModeSourceOver); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - unchanged, CompositingModeSourceOver. status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - changed, CompositingModeSourceOver. status = GdipSetSolidFillColor (brush, 0xAABBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xAABBCCDC); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - zero alpha, CompositingModeSourceOver. status = GdipSetSolidFillColor (brush, 0x00BBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x00000000); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0xDDA03040); assertEqualInt (status, Ok); status = GdipSetCompositingMode (graphics, CompositingModeSourceCopy); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - unchanged, CompositingModeSourceCopy. status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - changed, CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0xAABBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xAABBCCDC); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - zero alpha, CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0x00BBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x00000000); GdipDeleteGraphics (graphics); GdipDisposeImage ((GpImage *) bitmap); // PixelFormat32bppPARGB. status = GdipCreateBitmapFromScan0 (256, 256, 0, PixelFormat32bppPARGB, NULL, &bitmap); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext ((GpImage *) bitmap, &graphics); assertEqualInt (status, Ok); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); status = GdipSetSolidFillColor (brush, 0xDDA03040); assertEqualInt (status, Ok); // Fill with brush - CompositingModeSourceOver. status = GdipSetCompositingMode (graphics, CompositingModeSourceOver); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - unchanged, CompositingModeSourceOver. status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - changed, CompositingModeSourceOver. status = GdipSetSolidFillColor (brush, 0xAABBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xAABBCCDC); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - zero alpha, CompositingModeSourceOver. status = GdipSetSolidFillColor (brush, 0x00BBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x00000000); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0xDDA03040); assertEqualInt (status, Ok); status = GdipSetCompositingMode (graphics, CompositingModeSourceCopy); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - unchanged, CompositingModeSourceCopy. status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xDDA0303F); #else assertEqualARGB (color, 0xDDA02F3F); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - changed, CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0xAABBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xAABBCCDC); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - zero alpha, CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0x00BBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0x00000000); GdipDeleteGraphics (graphics); GdipDisposeImage ((GpImage *) bitmap); // PixelFormat32bppRGB. status = GdipCreateBitmapFromScan0 (256, 256, 0, PixelFormat32bppRGB, NULL, &bitmap); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext ((GpImage *) bitmap, &graphics); assertEqualInt (status, Ok); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); status = GdipSetSolidFillColor (brush, 0xDDA03040); assertEqualInt (status, Ok); // Fill with brush - CompositingModeSourceOver. status = GdipSetCompositingMode (graphics, CompositingModeSourceOver); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xFF8B2A37); #else assertEqualARGB (color, 0xFF8B2937); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - unchanged, CompositingModeSourceOver. status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xFF8B2A37); #else assertEqualARGB (color, 0xFF8B2937); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - changed, CompositingModeSourceOver. status = GdipSetSolidFillColor (brush, 0xAABBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xFF7D8893); #else assertEqualARGB (color, 0xFF7D8893); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - zero alpha, CompositingModeSourceOver. status = GdipSetSolidFillColor (brush, 0x00BBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xFF000000); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0xDDA03040); assertEqualInt (status, Ok); status = GdipSetCompositingMode (graphics, CompositingModeSourceCopy); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xFF8B2A37); #else assertEqualARGB (color, 0xFF8B2937); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - unchanged, CompositingModeSourceCopy. status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) assertEqualARGB (color, 0xFF8B2A37); #else assertEqualARGB (color, 0xFF8B2937); #endif status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - changed, CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0xAABBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xFF7D8893); status = GdipBitmapSetPixel (bitmap, 0, 0, 0x00000000); assertEqualInt (status, Ok); // Fill with brush - zero alpha, CompositingModeSourceCopy. status = GdipSetSolidFillColor (brush, 0x00BBCCDD); assertEqualInt (status, Ok); status = GdipFillRectangle (graphics, brush, 0, 0, 1, 1); assertEqualInt (status, Ok); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt (status, Ok); assertEqualARGB (color, 0xFF000000); GdipDeleteGraphics (graphics); GdipDisposeImage ((GpImage *) bitmap); // Negative tests. status = GdipSetSolidFillColor (NULL, 0x010203040); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } int main (int argc, char**argv) { STARTUP; test_clone (); test_delete (); test_createSolidFill (); test_getSolidFillColor (); test_setSolidFillColor (); test_fill (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.png0000644000175000017500000002452412377405421020161 0ustar directhexdirecthexPNG  IHDRdD+7gAMA abKGD pHYs  ~tIME , [ IDATx|y՝_}~^dGh(Dh41QcnINBDF'3!FF!QQ ;44;~kUմ@9w^yU]{w2Ł$ɀ&E~&~U`]F=ƌy e9~}qcE"ws  0 #ƍmjl֝gΘkM֎=j͆M#q+RhDUduO#Ÿ/ESF嘦i3mk7,1C$u'5FѴ ?;oc1Fc~z % 0pљM5N/2S^k @ #;aE< ~漩0J%1vc  ,xWKSUue{*n YfU*BAys/l6`1d2EQ\bE2Zդ+]ukƻ6t㗇Q8 *;cٶmPz|47YU7ԄV:t K}rNX[[K)% FthoQﺮ ||>?~xP.~ {{g̘eYA5.rl8ænDBkJPPU&M"^[./GeYi^s7{=c$zC~Яk",'=-ݳ[n:ʒkA0bǽVn[ ~ø̜2_|:=ZŜM<˜빞c#F}[L&<"Fpy[wok{ěG9J,^dqǼb{wa^#//uX8"<EhᣏQ!cl!J$ 麹,z@ي3N30 e9ecdPql6{5|͔R/9=Ā!@@H@5mmm`  +W~pZﯨEöm'r|7 ž{Ϛy<0L <1Ei+l޼5yZ3  tu0FPkkk\6!FPo}?M`䉧KϚ쒧W_]z$HgjQxp(w-1|絥Ϥᱍc&oŦb:ฺ _͛m0W^x%aA5h(P.B00J PCaM^twyowsrkTԲ/q @l׿iqcU?O?}ܹSOgOac 1{ζ͛Vxu_}bG#FT`08{x4vrիWKT,} {9k.|nd}0Rb۶mp4MQ)cFiʲl(xxf ;88k׮ .0̺ʠd2Gv'iZ,UY[[~IQ{zkkbD__ajar !b!L&o/\PKx(h,XP]]JƚVZ%¹;o޼@(O'@Kx{# kӋ_ܸUsa5ɓ 3o]zXr%>ElV&L0cƌ?{~(B!(c% cQ.B!p=k[*@ggxX,F#B_)Sxd2rF=$*,ソ3֣$kuut]AuY%msι馛Ǝ ~⤿-yZMM ]vifV8 aQc?o9@x_d5岾}{[{{e4<ӷ@G,Ed*wީ(``8"D2׋Ï<ק:!nutuf߿5k~.)SpwC-R.%I B(B!̞=;;g;w۵_GYR>}:0r$Y(rXB`i+SEqS 5M0R[oX,jv ز˲㸭[[4M_F"AN:?aƌs`uUi^_jE.0M3NcC+W|T[lVUչeb1M`pĉϿywy_} Dbg`ѣn[[BҥK)VK***e=SJ׮]TUhFxyRcǎq555Mݰ x~tMʥc˹,c"H%d:~>!Oze_v,]QV,v)ceK'4f2SFۅb6 ̱+J:A]MV.{q-sgyf(#v=`PKH(( d4" BJD Ҕ,K T+ a A8 irmmb~D&ܳlV'xjΜ ARX5 4 ︔"\놷G1F'Q #G/#Ϫ(=7P4i޽[6ˆH2ٖw}`INu ı$.C!o_-50Dzu-xcUQ-#F@zzHʅZH H6#tE |vpKs ޞ;\Y3)B cr Y88~D¶m:3\vB"dPfZ8@crmu`gG]UMmOg=Y\5jN]@TbG1{Y][їF44;.e%od}c ߔ05ME?y !۲\U18<S_Tx_rPֽ}m[]@OgGg{'ҵuBP[JE!Je˫ kkjWTqrVe 3RÞm}Ϳ7Tg ήo}֫^)9᰿ oXM7޽[Q+JҙHP\.CL/?4MUUEQ8eY\. Gyw]׶VvG3gn㆚#Fl۶e{u=ȲLE1*Bd2Dbȑ ,#c ߄c羃=f܅3V1 E2m4@ ~e+?/ t:-ˇ`40a$I`0{ɲ{zz 8p YQRTBHXWQ 9lٲE(t4޸as!?Ge-.__14u]cM6qѣGiY jc!rЇam3 !$"#!q( ģm˲C<}c̲,I~?MR\*" ”)SpoooGGG]]رc5MrP\][[___.{zBo0gΜP(l8ٳύZI44/o|aY0J81zQ뺔H$L&'N8uԆ@(S2@H>j9ܑ)=3G>ٶM)/~?Q[mj:0*4x{3Wv9c4Lzz0(H JBH4! $I&Mٶm[OOOit*c,mm(c,[.+:gq,92߷W+ݣ*Ƹwqnj3LTU՟E?< 2 < :g[>?oɓ'ϝ;wɇg=Wi{KH !~%Mϟ?ʕVWW+rYy?/r.4-RJQM}7{LR$r׮[nH$W# 40?""4S tH GVcE}މ,<,nݤ"::;0BD"!69\`p0+**8۸qcXL\N :PAx/ˋ--T/}&|,C:Țᦡ?!y~ҤI㎎I¡! kUFpxƍ]='N4 C$EQL8cS~ *+V(J5-{/첚ji> ÖeE`p޽1Bؗ,#F4i,[lڲmҥiӦٶctb )v$%e^xk6LY(kyC0ܹ7/|% ;]]]BAu%Iuh*$IӴLUM}}T*iZ(rGOmC u)lRd\׹;n:~xQ;::B"`(s]Wŷ|sܹsر+V˲8c Pů  (cZ" QJV)Wj@f[o`W?ALL+냡V.q>T(fs'N曧ON) Ȼ:;7nOZ*Lh|ΝSLMNոHކ,ZE]4suxcF_*!ؖƨ-RH< DbׯEy'T]qt"AiiIG֏QC3ʨDz}KcSJ#lߡrw֪DPMXS{Y&c$8Keo2U3* cƆQ /1Nՠ>B'^P7ꖥ(<dzeErl:8PrN?\.eF 4F* $`SK[|@ pxw|*|GH\>'+J85k־}***_gAUVQ Ȣ(^yۧȒaM9m_555mkȤU M-9f[PX1mp2J$b˾:$JJptr=7ږ9NEH' g;;ӕq(ZA0b Iԟ.K_;mOܯܐNW^pv]="ۖ9A{3Lm]0yt,_p :Î4?f$Q;N0 Tx(<^vur9EzŋQ(a芢`he%wu >~iYӚXvTK//{ʅ.ƣy襥Kco`/=znJ=E颋? #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static GpImage* getImage (const char* fileName) { GpStatus status; WCHAR *wFileName = wcharFromChar (fileName); GpImage *image; status = GdipLoadImageFromFile (wFileName, &image); assertEqualInt (status, Ok); freeWchar (wFileName); return image; } static void test_loadImageFromStream () { GpStatus status; GpImage *image; // Negative tests. status = GdipLoadImageFromStream (NULL, &image); assertEqualInt (status, InvalidParameter); #if !defined(USE_WINDOWS_GDIPLUS) int temp = 0; status = GdipLoadImageFromStream (&temp, NULL); assertEqualInt (status, InvalidParameter); status = GdipLoadImageFromStream (&temp, &image); assertEqualInt (status, NotImplemented); #endif } static void test_loadImageFromFile () { GpStatus status; GpImage *image; WCHAR *noSuchFile = createWchar ("noSuchFile.bmp"); WCHAR *invalidFile = createWchar ("test.ttf"); // Negative tests. status = GdipLoadImageFromFile (NULL, &image); assertEqualInt (status, InvalidParameter); status = GdipLoadImageFromFile (noSuchFile, &image); assertEqualInt (status, OutOfMemory); status = GdipLoadImageFromFile (invalidFile, &image); assertEqualInt (status, OutOfMemory); status = GdipLoadImageFromFile (noSuchFile, NULL); assertEqualInt (status, InvalidParameter); freeWchar (noSuchFile); freeWchar (invalidFile); } static void test_loadImageFromStreamICM () { GpStatus status; GpImage *image; // Negative tests. status = GdipLoadImageFromStreamICM (NULL, &image); assertEqualInt (status, InvalidParameter); #if !defined(USE_WINDOWS_GDIPLUS) int temp = 0; status = GdipLoadImageFromStreamICM (&temp, NULL); assertEqualInt (status, InvalidParameter); status = GdipLoadImageFromStreamICM (&temp, &image); assertEqualInt (status, NotImplemented); #endif } static void test_loadImageFromFileICM () { GpStatus status; GpImage *image; WCHAR *noSuchFile = createWchar ("noSuchFile.bmp"); WCHAR *invalidFile = createWchar ("test.ttf"); // Negative tests. status = GdipLoadImageFromFileICM (NULL, &image); assertEqualInt (status, InvalidParameter); status = GdipLoadImageFromFileICM (noSuchFile, &image); assertEqualInt (status, OutOfMemory); status = GdipLoadImageFromFileICM (invalidFile, &image); assertEqualInt (status, OutOfMemory); status = GdipLoadImageFromFileICM (noSuchFile, NULL); assertEqualInt (status, InvalidParameter); freeWchar (noSuchFile); freeWchar (invalidFile); } static void test_loadImageFromFileTif () { GpImage *image = getImage ("test.tif"); verifyBitmap (image, tifRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 19, TRUE); GdipDisposeImage (image); } static void test_loadImageFromFileGif () { GpImage *image = getImage ("test.gif"); verifyBitmap (image, gifRawFormat, PixelFormat8bppIndexed, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 4, TRUE); GdipDisposeImage (image); } static void test_loadImageFromFilePng () { GpImage *image = getImage ("test.png"); verifyBitmap (image, pngRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 5, TRUE); GdipDisposeImage (image); } static void test_loadImageFromFileJpg () { GpImage *image = getImage ("test.jpg"); verifyBitmap (image, jpegRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2, TRUE); GdipDisposeImage (image); } static void test_loadImageFromFileIcon () { GpImage *image = getImage ("test.ico"); verifyBitmap (image, icoRawFormat, PixelFormat32bppARGB, 48, 48, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsHasAlpha | ImageFlagsReadOnly, 0, TRUE); GdipDisposeImage (image); } static void test_loadImageFromFileWmf () { GpImage *image = getImage ("test.wmf"); verifyMetafile (image, wmfRawFormat, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); GdipDisposeImage (image); } static void test_loadImageFromFileEmf () { GpImage *image = getImage ("test.emf"); verifyMetafile (image, emfRawFormat, 0, 0, 100, 100, 1944.444336f, 1888.888794f); GdipDisposeImage (image); } static void test_cloneImage () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *jpgImage = getImage ("test.jpg"); GpImage *metafileImage = getImage ("test.wmf"); GpImage *clonedImage; // ImageTypeBitmap - bmp. status = GdipCloneImage (bitmapImage, &clonedImage); assertEqualInt (status, Ok); assert (clonedImage && clonedImage != bitmapImage); verifyBitmap (clonedImage, bmpRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 0, TRUE); GdipDisposeImage (clonedImage); // ImageTypeBitmap - jpg. status = GdipCloneImage (jpgImage, &clonedImage); assertEqualInt (status, Ok); assert (clonedImage && clonedImage != jpgImage); verifyBitmap (clonedImage, jpegRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 2, TRUE); GdipDisposeImage (clonedImage); // ImageTypeMetafile. status = GdipCloneImage (metafileImage, &clonedImage); assertEqualInt (status, Ok); assert (clonedImage && clonedImage != metafileImage); verifyMetafile (clonedImage, wmfRawFormat, -4008, -3378, 8016, 6756, 20360.638672f, 17160.238281f); GdipDisposeImage (clonedImage); // Negative tests. status = GdipCloneImage (NULL, &clonedImage); assertEqualInt (status, InvalidParameter); status = GdipCloneImage (bitmapImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (jpgImage); GdipDisposeImage (metafileImage); } static void test_disposeImage () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); // ImageTypeBitmap. status = GdipDisposeImage (bitmapImage); assertEqualInt (status, Ok); // ImageTypeMetafile. status = GdipDisposeImage (metafileImage); assertEqualInt (status, Ok); // Negative tests. status = GdipDisposeImage (NULL); assertEqualInt (status, InvalidParameter); } static void test_getImageGraphicsContext () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *gifImage = getImage ("test.gif"); GpImage *metafileImage = getImage ("test.wmf"); GpGraphics *graphics; // ImageTypeBitmap - PixelFormat24Bpp. status = GdipGetImageGraphicsContext (bitmapImage, &graphics); assertEqualInt (status, Ok); assert (graphics); GdipDeleteGraphics (graphics); // FIXME: libgdiplus doesn't support PixelFormat8bppIndexed. #if defined(USE_WINDOWS_GDIPLUS) // ImageTypeBitmap - PixelFormat8bppIndexed. status = GdipGetImageGraphicsContext (gifImage, &graphics); assertEqualInt (status, Ok); assert (graphics); GdipDeleteGraphics (graphics); #endif // ImageTypeMetafile - not recording. status = GdipGetImageGraphicsContext (metafileImage, &graphics); assertEqualInt (status, OutOfMemory); // Negative tests. status = GdipGetImageGraphicsContext (NULL, &graphics); assertEqualInt (status, InvalidParameter); status = GdipGetImageGraphicsContext (bitmapImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (gifImage); GdipDisposeImage (metafileImage); } static void test_getImageBounds () { GpStatus status; GpImage *image = getImage ("test.bmp"); GpRectF bounds; Unit unit; // Negative tests. status = GdipGetImageBounds (NULL, &bounds, &unit); assertEqualInt (status, InvalidParameter); status = GdipGetImageBounds (image, NULL, &unit); assertEqualInt (status, InvalidParameter); status = GdipGetImageBounds (image, &bounds, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageDimension () { GpStatus status; GpImage *image = getImage ("test.bmp"); REAL dimensionWidth; REAL dimensionHeight; // Negative tests. status = GdipGetImageDimension (NULL, &dimensionWidth, &dimensionHeight); assertEqualInt (status, InvalidParameter); status = GdipGetImageDimension (image, NULL, &dimensionHeight); assertEqualInt (status, InvalidParameter); status = GdipGetImageDimension (image, &dimensionWidth, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageType () { GpStatus status; GpImage *image = getImage ("test.bmp"); ImageType type; // Negative tests. status = GdipGetImageType (NULL, &type); assertEqualInt (status, InvalidParameter); status = GdipGetImageType (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageWidth () { GpStatus status; GpImage *image = getImage ("test.bmp"); UINT width; // Negative tests. status = GdipGetImageWidth (NULL, &width); assertEqualInt (status, InvalidParameter); status = GdipGetImageWidth (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageHeight () { GpStatus status; GpImage *image = getImage ("test.bmp"); UINT height; // Negative tests. status = GdipGetImageHeight (NULL, &height); assertEqualInt (status, InvalidParameter); status = GdipGetImageHeight (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageHorizontalResolution () { GpStatus status; GpImage *image = getImage ("test.bmp"); REAL horizontalResolution; // Negative tests. status = GdipGetImageHorizontalResolution (NULL, &horizontalResolution); assertEqualInt (status, InvalidParameter); status = GdipGetImageHorizontalResolution (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageVerticalResolution () { GpStatus status; GpImage *image = getImage ("test.bmp"); REAL verticalResolution; // Negative tests. status = GdipGetImageVerticalResolution (NULL, &verticalResolution); assertEqualInt (status, InvalidParameter); status = GdipGetImageVerticalResolution (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageFlags () { GpStatus status; GpImage *image = getImage ("test.bmp"); UINT flags; // Negative tests. status = GdipGetImageFlags (NULL, &flags); assertEqualInt (status, InvalidParameter); status = GdipGetImageFlags (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImageRawFormat () { GpStatus status; GpImage *image = getImage ("test.bmp"); GUID rawFormat; // Negative tests. status = GdipGetImageRawFormat (NULL, &rawFormat); assertEqualInt (status, InvalidParameter); status = GdipGetImageRawFormat (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getImagePixelFormat () { GpStatus status; GpImage *image = getImage ("test.bmp"); PixelFormat pixelFormat; // Negative tests. status = GdipGetImagePixelFormat (NULL, &pixelFormat); assertEqualInt (status, InvalidParameter); status = GdipGetImagePixelFormat (image, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static BOOL callback (void *callbackData) { return TRUE; } static void test_getImageThumbnail () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *wmfImage = getImage ("test.wmf"); GpImage *emfImage = getImage ("test.emf"); GpImage *thumbImage; // ImageTypeBitmap - non zero width and height. status = GdipGetImageThumbnail (bitmapImage, 10, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppPARGB, 10, 10, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeBitmap - width > height. status = GdipGetImageThumbnail (bitmapImage, 20, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppPARGB, 20, 10, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeBitmap - height > width. status = GdipGetImageThumbnail (bitmapImage, 10, 20, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppPARGB, 10, 20, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeBitmap - zero width and height. status = GdipGetImageThumbnail (bitmapImage, 0, 0, &thumbImage, NULL, NULL); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppPARGB, 120, 120, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeMetafile - non zero width and height. status = GdipGetImageThumbnail (wmfImage, 10, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppARGB, 10, 10, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeMetafile - width > height. status = GdipGetImageThumbnail (wmfImage, 20, 10, &thumbImage, NULL, NULL); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppARGB, 20, 10, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeMetafile - height > width. status = GdipGetImageThumbnail (wmfImage, 10, 20, &thumbImage, NULL, NULL); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppARGB, 10, 20, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeMetafile - non zero width and height. status = GdipGetImageThumbnail (emfImage, 10, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppARGB, 10, 10, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeMetafile - width > height. status = GdipGetImageThumbnail (emfImage, 20, 10, &thumbImage, NULL, NULL); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppARGB, 20, 10, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // ImageTypeMetafile - height > width. status = GdipGetImageThumbnail (emfImage, 10, 20, &thumbImage, NULL, NULL); assertEqualInt (status, Ok); verifyBitmap (thumbImage, memoryBmpRawFormat, PixelFormat32bppARGB, 10, 20, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage (thumbImage); // Negative tests. status = GdipGetImageThumbnail (NULL, 10, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, InvalidParameter); status = GdipGetImageThumbnail (bitmapImage, 10, 10, NULL, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, InvalidParameter); status = GdipGetImageThumbnail (bitmapImage, 0, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, OutOfMemory); status = GdipGetImageThumbnail (wmfImage, 0, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, OutOfMemory); status = GdipGetImageThumbnail (emfImage, 0, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, OutOfMemory); status = GdipGetImageThumbnail (NULL, 0, 10, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, InvalidParameter); status = GdipGetImageThumbnail (bitmapImage, 0, 10, NULL, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, InvalidParameter); status = GdipGetImageThumbnail (bitmapImage, 10, 0, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, OutOfMemory); status = GdipGetImageThumbnail (wmfImage, 10, 0, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, OutOfMemory); status = GdipGetImageThumbnail (emfImage, 10, 0, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, OutOfMemory); status = GdipGetImageThumbnail (NULL, 10, 0, &thumbImage, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, InvalidParameter); status = GdipGetImageThumbnail (bitmapImage, 10, 0, NULL, (GetThumbnailImageAbort) callback, (void *) 1); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (wmfImage); GdipDisposeImage (emfImage); } static void test_getEncoderParameterListSize () { GpStatus status; GpImage *image = getImage ("test.bmp"); UINT size; status = GdipGetEncoderParameterListSize (image, &bmpEncoderClsid, &size); assertEqualInt (status, NotImplemented); status = GdipGetEncoderParameterListSize (image, &tifEncoderClsid, &size); assertEqualInt (status, Ok); assertEqualInt (size, (is_32bit() ? 164 : 184)); status = GdipGetEncoderParameterListSize (image, &gifEncoderClsid, &size); assertEqualInt (status, Ok); assertEqualInt (size, (is_32bit() ? 64 : 80)); status = GdipGetEncoderParameterListSize (image, &pngEncoderClsid, &size); assertEqualInt (status, Ok); assertEqualInt (size, (is_32bit() ? 32 : 40)); status = GdipGetEncoderParameterListSize (image, &jpegEncoderClsid, &size); assertEqualInt (status, Ok); assertEqualInt (size, (is_32bit() ? 172 : 200)); status = GdipGetEncoderParameterListSize (image, &icoEncoderClsid, &size); assertEqualInt (status, FileNotFound); status = GdipGetEncoderParameterListSize (image, &wmfEncoderClsid, &size); assertEqualInt (status, FileNotFound); status = GdipGetEncoderParameterListSize (image, &emfEncoderClsid, &size); assertEqualInt (status, FileNotFound); // Negative tests. status = GdipGetEncoderParameterListSize (NULL, &emfEncoderClsid, &size); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterListSize (image, NULL, &size); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterListSize (image, &emfEncoderClsid, NULL); assertEqualInt (status, FileNotFound); status = GdipGetEncoderParameterListSize (image, &jpegEncoderClsid, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_getEncoderParameterList () { GpStatus status; GpImage *image = getImage ("test.bmp"); UINT tiffSize; UINT gifSize; UINT pngSize; UINT jpegSize; EncoderParameters buffer; EncoderParameters *parameters; GUID compression = {0x0E09D739D, 0x0CCD4, 0x44EE, {0x8E, 0x0BA, 0x3F, 0x0BF, 0x8B, 0x0E4, 0x0FC, 0x58}}; GUID colorDepth = {0x66087055, 0x0AD66, 0x4C7C, {0x9A, 0x18, 0x38, 0x0A2, 0x31, 0x0B, 0x83, 0x37}}; GUID saveFlag = {0x292266FC, 0x0AC40, 0x47BF, {0x8C, 0x0FC, 0x0A8, 0x5B, 0x89, 0x0A6, 0x55, 0x0DE}}; GUID saveAsCMYK = {0x0A219BBC9, 0x0A9D, 0x4005, {0x0A3, 0x0EE, 0x3A, 0x42, 0x1B, 0x8B, 0x0B0, 0x6C}}; GUID imageItems = {0x63875E13, 0x1F1D, 0x45AB, {0x91, 0x95, 0x0A2, 0x9B, 0x60, 0x66, 0x0A6, 0x50}}; GUID transformation = {0x8D0EB2D1, 0x0A58E, 0x4EA8, {0x0AA, 0x14, 0x10, 0x80, 0x74, 0x0B7, 0x0B6, 0x0F9}}; GUID quality = {0x1D5BE4B5, 0x0FA4A, 0x452D, {0x9C, 0x0DD, 0x5D, 0x0B3, 0x51, 0x5, 0x0E7, 0x0EB}}; GUID luminanceTable = {0x0EDB33BCE, 0x266, 0x4A77, {0x0B9, 0x4, 0x27, 0x21, 0x60, 0x99, 0x0E7, 0x17}}; GUID chrominanceTable = {0x0F2E455DC, 0x9B3, 0x4316, {0x82, 0x60, 0x67, 0x6A, 0x0DA, 0x32, 0x48, 0x1C}}; // TIFF encoder. GdipGetEncoderParameterListSize (image, &tifEncoderClsid, &tiffSize); parameters = (EncoderParameters *) malloc (tiffSize); status = GdipGetEncoderParameterList (image, &tifEncoderClsid, tiffSize, parameters); assertEqualInt (status, Ok); assertEqualInt (parameters->Count, 4); assert (memcmp ((void *) ¶meters->Parameter[0].Guid, (void *) &compression, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[0].NumberOfValues, 5); assertEqualInt (parameters->Parameter[0].Type, EncoderParameterValueTypeLong); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[0], EncoderValueCompressionLZW); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[1], EncoderValueCompressionCCITT3); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[2], EncoderValueCompressionRle); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[3], EncoderValueCompressionCCITT4); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[4], EncoderValueCompressionNone); assert (memcmp ((void *) ¶meters->Parameter[1].Guid, (void *) &colorDepth, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[1].NumberOfValues, 5); assertEqualInt (parameters->Parameter[1].Type, EncoderParameterValueTypeLong); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[0], 1); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[1], 4); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[2], 8); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[3], 24); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[4], 32); assert (memcmp ((void *) ¶meters->Parameter[2].Guid, (void *) &saveFlag, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[2].NumberOfValues, 1); assertEqualInt (parameters->Parameter[2].Type, EncoderParameterValueTypeLong); assertEqualInt (((LONG *) parameters->Parameter[2].Value)[0], EncoderValueMultiFrame); assert (memcmp ((void *) ¶meters->Parameter[3].Guid, (void *) &saveAsCMYK, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[3].NumberOfValues, 1); assertEqualInt (parameters->Parameter[3].Type, EncoderParameterValueTypeLong); assertEqualInt (((LONG *) parameters->Parameter[3].Value)[0], 1); free (parameters); // GIF encoder. GdipGetEncoderParameterListSize (image, &gifEncoderClsid, &gifSize); parameters = (EncoderParameters *) malloc (gifSize); status = GdipGetEncoderParameterList (image, &gifEncoderClsid, gifSize, parameters); assertEqualInt (status, Ok); assertEqualInt (parameters->Count, 2); assert (memcmp ((void *) ¶meters->Parameter[0].Guid, (void *) &imageItems, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[0].NumberOfValues, 0); assertEqualInt (parameters->Parameter[0].Type, (EncoderParameterValueType) 9); assert (!parameters->Parameter[0].Value); assert (memcmp ((void *) ¶meters->Parameter[1].Guid, (void *) &saveFlag, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[1].NumberOfValues, 1); assertEqualInt (parameters->Parameter[1].Type, EncoderParameterValueTypeLong); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[0], EncoderValueMultiFrame); // PNG encoder. GdipGetEncoderParameterListSize (image, &pngEncoderClsid, &pngSize); parameters = (EncoderParameters *) malloc (pngSize); status = GdipGetEncoderParameterList (image, &pngEncoderClsid, pngSize, parameters); assertEqualInt (status, Ok); assertEqualInt (parameters->Count, 1); assert (memcmp ((void *) ¶meters->Parameter[0].Guid, (void *) &imageItems, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[0].NumberOfValues, 0); assertEqualInt (parameters->Parameter[0].Type, (EncoderParameterValueType) 9); assert (!parameters->Parameter[0].Value); // JPEG encoder. GdipGetEncoderParameterListSize (image, &jpegEncoderClsid, &jpegSize); parameters = (EncoderParameters *) malloc (jpegSize); status = GdipGetEncoderParameterList (image, &jpegEncoderClsid, jpegSize, parameters); assertEqualInt (status, Ok); assertEqualInt (parameters->Count, 5); assert (memcmp ((void *) ¶meters->Parameter[0].Guid, (void *) &transformation, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[0].NumberOfValues, 5); assertEqualInt (parameters->Parameter[0].Type, EncoderParameterValueTypeLong); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[0], EncoderValueTransformRotate90); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[1], EncoderValueTransformRotate180); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[2], EncoderValueTransformRotate270); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[3], EncoderValueTransformFlipHorizontal); assertEqualInt (((LONG *) parameters->Parameter[0].Value)[4], EncoderValueTransformFlipVertical); assert (memcmp ((void *) ¶meters->Parameter[1].Guid, (void *) &quality, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[1].NumberOfValues, 1); assertEqualInt (parameters->Parameter[1].Type, EncoderParameterValueTypeLongRange); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[0], 0); assertEqualInt (((LONG *) parameters->Parameter[1].Value)[1], 100); assert (memcmp ((void *) ¶meters->Parameter[2].Guid, (void *) &luminanceTable, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[2].NumberOfValues, 0); assertEqualInt (parameters->Parameter[2].Type, EncoderParameterValueTypeShort); assert (!parameters->Parameter[2].Value); assert (memcmp ((void *) ¶meters->Parameter[3].Guid, (void *) &chrominanceTable, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[3].NumberOfValues, 0); assertEqualInt (parameters->Parameter[3].Type, EncoderParameterValueTypeShort); assert (!parameters->Parameter[3].Value); assert (memcmp ((void *) ¶meters->Parameter[4].Guid, (void *) &imageItems, sizeof (GUID)) == 0); assertEqualInt (parameters->Parameter[4].NumberOfValues, 0); assertEqualInt (parameters->Parameter[4].Type, (EncoderParameterValueType) 9); assert (!parameters->Parameter[4].Value); // Negative tests. status = GdipGetEncoderParameterList (NULL, &emfEncoderClsid, 100, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, NULL, 100, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &emfEncoderClsid, 100, NULL); assertEqualInt (status, FileNotFound); status = GdipGetEncoderParameterList (image, &tifEncoderClsid, 100, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &gifEncoderClsid, 100, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &pngEncoderClsid, 100, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &jpegEncoderClsid, 100, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &jpegEncoderClsid, 0, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &jpegEncoderClsid, -1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &tifEncoderClsid, tiffSize - 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &tifEncoderClsid, tiffSize + 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &gifEncoderClsid, gifSize - 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &gifEncoderClsid, gifSize + 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &pngEncoderClsid, pngSize - 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &pngEncoderClsid, pngSize + 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &jpegEncoderClsid, jpegSize - 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &jpegEncoderClsid, jpegSize + 1, &buffer); assertEqualInt (status, InvalidParameter); status = GdipGetEncoderParameterList (image, &bmpEncoderClsid, 0, &buffer); assertEqualInt (status, NotImplemented); status = GdipGetEncoderParameterList (image, &icoEncoderClsid, 0, &buffer); assertEqualInt (status, FileNotFound); status = GdipGetEncoderParameterList (image, &wmfEncoderClsid, 0, &buffer); assertEqualInt (status, FileNotFound); status = GdipGetEncoderParameterList (image, &emfEncoderClsid, 0, &buffer); assertEqualInt (status, FileNotFound); GdipDisposeImage (image); } static void test_getFrameDimensionsCount () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); UINT count; status = GdipImageGetFrameDimensionsCount (bitmapImage, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); status = GdipImageGetFrameDimensionsCount (metafileImage, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Negative tests. status = GdipImageGetFrameDimensionsCount (NULL, &count); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameDimensionsCount (metafileImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getFrameDimensionsList () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); GUID dimensions[1]; status = GdipImageGetFrameDimensionsList (bitmapImage, dimensions, 1); assertEqualInt (status, Ok); // Negative tests. status = GdipImageGetFrameDimensionsList (NULL, dimensions, 1); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameDimensionsList (bitmapImage, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameDimensionsList (bitmapImage, dimensions, 0); assertEqualInt (status, Win32Error); status = GdipImageGetFrameDimensionsList (metafileImage, dimensions, 0); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameDimensionsList (bitmapImage, dimensions, -1); assertEqualInt (status, Win32Error); status = GdipImageGetFrameDimensionsList (metafileImage, dimensions, -1); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameDimensionsList (bitmapImage, dimensions, 2); assertEqualInt (status, Win32Error); status = GdipImageGetFrameDimensionsList (metafileImage, dimensions, 2); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getFrameCount () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); GUID pageDimension = {0x7462dc86, 0x6180, 0x4c7e, {0x8e, 0x3f, 0xee, 0x73, 0x33, 0xa7, 0xa4, 0x83}}; GUID timeDimension = {0x6aedbd6d, 0x3fb5, 0x418a, {0x83, 0xa6, 0x7f, 0x45, 0x22, 0x9d, 0xc8, 0x72}}; UINT count; // Bitmap - page dimension. status = GdipImageGetFrameCount (bitmapImage, &pageDimension, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Metafile - null dimension. count = -1; status = GdipImageGetFrameCount (metafileImage, NULL, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Metafile - no such dimension. count = -1; status = GdipImageGetFrameCount (metafileImage, &emfEncoderClsid, &count); assertEqualInt (status, Ok); assertEqualInt (count, 1); // Negative tests. status = GdipImageGetFrameCount (NULL, &pageDimension, &count); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameCount (bitmapImage, NULL, &count); assertEqualInt (status, Win32Error); status = GdipImageGetFrameCount (bitmapImage, &pageDimension, NULL); assertEqualInt (status, Win32Error); status = GdipImageGetFrameCount (metafileImage, &pageDimension, NULL); assertEqualInt (status, InvalidParameter); status = GdipImageGetFrameCount (bitmapImage, &timeDimension, &count); assertEqualInt (status, Win32Error); status = GdipImageGetFrameCount (bitmapImage, &emfEncoderClsid, &count); assertEqualInt (status, Win32Error); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_selectActiveFrame () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); GUID pageDimension = {0x7462dc86, 0x6180, 0x4c7e, {0x8e, 0x3f, 0xee, 0x73, 0x33, 0xa7, 0xa4, 0x83}}; GUID timeDimension = {0x6aedbd6d, 0x3fb5, 0x418a, {0x83, 0xa6, 0x7f, 0x45, 0x22, 0x9d, 0xc8, 0x72}}; // Bitmap - page dimension. status = GdipImageSelectActiveFrame (bitmapImage, &pageDimension, 0); assertEqualInt (status, Ok); // Metafile - page dimension. status = GdipImageSelectActiveFrame (metafileImage, &pageDimension, 100); assertEqualInt (status, Ok); // Metafile - time dimension. status = GdipImageSelectActiveFrame (metafileImage, &timeDimension, 100); assertEqualInt (status, Ok); // Negative tests. status = GdipImageSelectActiveFrame (NULL, &pageDimension, 0); assertEqualInt (status, InvalidParameter); status = GdipImageSelectActiveFrame (bitmapImage, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipImageSelectActiveFrame (metafileImage, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipImageSelectActiveFrame (bitmapImage, &pageDimension, 4); assertEqualInt (status, Win32Error); status = GdipImageSelectActiveFrame (metafileImage, &pageDimension, 200); assertEqualInt (status, Ok); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_forceValidation () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); // ImageTypeBitmap. status = GdipImageForceValidation (bitmapImage); assertEqualInt (status, Ok); // ImageTypeMetafile. status = GdipImageForceValidation (metafileImage); assertEqualInt (status, Ok); // Negative tests. status = GdipImageForceValidation (NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_rotateFlip () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); // RotateNoneFlipNone. status = GdipImageRotateFlip (bitmapImage, RotateNoneFlipNone); assertEqualInt (status, Ok); // Rotate90FlipNone. status = GdipImageRotateFlip (bitmapImage, Rotate90FlipNone); assertEqualInt (status, Ok); // Rotate180FlipNone. status = GdipImageRotateFlip (bitmapImage, Rotate180FlipNone); assertEqualInt (status, Ok); // Rotate270FlipNone. status = GdipImageRotateFlip (bitmapImage, Rotate270FlipNone); assertEqualInt (status, Ok); // RotateNoneFlipX. status = GdipImageRotateFlip (bitmapImage, RotateNoneFlipX); assertEqualInt (status, Ok); // Rotate90FlipX. status = GdipImageRotateFlip (bitmapImage, Rotate90FlipX); assertEqualInt (status, Ok); // Rotate180FlipX. status = GdipImageRotateFlip (bitmapImage, Rotate180FlipX); assertEqualInt (status, Ok); // Rotate270FlipX. status = GdipImageRotateFlip (bitmapImage, Rotate270FlipX); assertEqualInt (status, Ok); // Negative tests. status = GdipImageRotateFlip (NULL, RotateNoneFlipNone); assertEqualInt (status, InvalidParameter); status = GdipImageRotateFlip (metafileImage, Rotate270FlipX); assertEqualInt (status, NotImplemented); status = GdipImageRotateFlip (bitmapImage, (RotateFlipType)(RotateNoneFlipNone - 1)); assertEqualInt (status, InvalidParameter); status = GdipImageRotateFlip (bitmapImage, (RotateFlipType)(Rotate270FlipX + 1)); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getImagePalette () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); INT size; BYTE buffer1[1040]; ColorPalette *palette = (ColorPalette *)buffer1; BYTE buffer2[1040]; ColorPalette *nonEmptyPalette = (ColorPalette *)buffer2; GdipGetImagePaletteSize (bitmapImage, &size); // Empty palette - same size. status = GdipGetImagePalette (bitmapImage, palette, size); assertEqualInt (status, Ok); assertEqualInt (palette->Count, 0); // Empty palette - larger size. palette->Count = 100; status = GdipGetImagePalette (bitmapImage, palette, size + 1); assertEqualInt (status, Ok); assertEqualInt (palette->Count, 0); // Empty palette - negative size. palette->Count = 100; status = GdipGetImagePalette (bitmapImage, palette, -1); assertEqualInt (status, Ok); assertEqualInt (palette->Count, 0); // Negative tests. status = GdipGetImagePalette (NULL, palette, size); assertEqualInt (status, InvalidParameter); status = GdipGetImagePalette (bitmapImage, NULL, size); assertEqualInt (status, InvalidParameter); status = GdipGetImagePalette (metafileImage, NULL, size); assertEqualInt (status, InvalidParameter); status = GdipGetImagePalette (metafileImage, palette, size); assertEqualInt (status, NotImplemented); status = GdipGetImagePalette (metafileImage, palette, -1); assertEqualInt (status, NotImplemented); status = GdipGetImagePalette (bitmapImage, palette, 0); assertEqualInt (status, InvalidParameter); status = GdipGetImagePalette (metafileImage, palette, 0); assertEqualInt (status, NotImplemented); status = GdipGetImagePalette (bitmapImage, palette, size - 1); assertEqualInt (status, InvalidParameter); status = GdipGetImagePalette (metafileImage, palette, size - 1); assertEqualInt (status, NotImplemented); // Non empty palette - setup. nonEmptyPalette->Count = 10; nonEmptyPalette->Flags = 1; nonEmptyPalette->Entries[0] = 2; status = GdipSetImagePalette (bitmapImage, nonEmptyPalette); assertEqualInt (status, Ok); GdipGetImagePaletteSize (bitmapImage, &size); // Non empty palette - same size. palette->Count = 100; palette->Flags = 100; palette->Entries[0] = 100; status = GdipGetImagePalette (bitmapImage, palette, size); assertEqualInt (status, Ok); assertEqualInt (palette->Count, 10); assertEqualInt (palette->Flags, 1); assertEqualInt (palette->Entries[0], 2); // Non empty palette - larger size. palette->Count = 100; palette->Flags = 100; palette->Entries[0] = 100; status = GdipGetImagePalette (bitmapImage, palette, size + 1); assertEqualInt (status, InvalidParameter); status = GdipGetImagePalette (bitmapImage, palette, size - 1); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_setImagePalette () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); INT size; BYTE buffer1[1040]; ColorPalette *palette = (ColorPalette *)buffer1; BYTE buffer2[1040]; ColorPalette *resultPalette = (ColorPalette *)buffer2; GdipGetImagePaletteSize (bitmapImage, &size); // Set with positive count. palette->Count = 10; palette->Flags = 1; palette->Entries[0] = 2; status = GdipSetImagePalette (bitmapImage, palette); assertEqualInt (status, Ok); status = GdipGetImagePaletteSize (bitmapImage, &size); assertEqualInt (status, Ok); assertEqualInt (size, 48); status = GdipGetImagePalette (bitmapImage, resultPalette, size); assertEqualInt (status, Ok); assertEqualInt (resultPalette->Count, 10); assertEqualInt (resultPalette->Flags, 1); assertEqualInt (resultPalette->Entries[0], 2); // Set with large count. palette->Count = 256; palette->Flags = 1; palette->Entries[0] = 20; status = GdipSetImagePalette (bitmapImage, palette); assertEqualInt (status, Ok); status = GdipGetImagePaletteSize (bitmapImage, &size); assertEqualInt (status, Ok); assertEqualInt (size, 1032); status = GdipGetImagePalette (bitmapImage, resultPalette, size); assertEqualInt (status, Ok); assertEqualInt (resultPalette->Count, 256); assertEqualInt (resultPalette->Flags, 1); assertEqualInt (resultPalette->Entries[0], 20); // Negative tests. status = GdipSetImagePalette (NULL, palette); assertEqualInt (status, InvalidParameter); palette->Count = 10; status = GdipSetImagePalette (metafileImage, palette); assertEqualInt (status, NotImplemented); palette->Count = 0; status = GdipSetImagePalette (bitmapImage, palette); assertEqualInt (status, InvalidParameter); palette->Count = -1; status = GdipSetImagePalette (bitmapImage, palette); assertEqualInt (status, InvalidParameter); palette->Count = 257; status = GdipSetImagePalette (bitmapImage, palette); assertEqualInt (status, InvalidParameter); status = GdipSetImagePalette (bitmapImage, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetImagePalette (metafileImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getImagePaletteSize () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); INT size; status = GdipGetImagePaletteSize (bitmapImage, &size); assertEqualInt (status, Ok); assertEqualInt ((int) sizeof(ColorPalette), 12); assertEqualInt (size, 12); // Negative tests. status = GdipGetImagePaletteSize (NULL, &size); assertEqualInt (status, InvalidParameter); status = GdipGetImagePaletteSize (bitmapImage, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetImagePaletteSize (metafileImage, &size); assertEqualInt (status, GenericError); status = GdipGetImagePaletteSize (metafileImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getPropertyCount () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); UINT count; // ImageTypeBitmap. status = GdipGetPropertyCount (bitmapImage, &count); assertEqualInt (status, Ok); assertEqualInt (count, 0); // ImageTypeMetafile. status = GdipGetPropertyCount (metafileImage, &count); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Negative tests. status = GdipGetPropertyCount (NULL, &count); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyCount (bitmapImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getPropertyIdList () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); PROPID list[2]; // ImageTypeBitmap. status = GdipGetPropertyIdList (bitmapImage, 0, list); assertEqualInt (status, Ok); // Negative tests. status = GdipGetPropertyIdList (NULL, 0, list); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyIdList (metafileImage, 0, list); assertEqualInt (status, NotImplemented); status = GdipGetPropertyIdList (bitmapImage, 0, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyIdList (metafileImage, 0, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyIdList (bitmapImage, 1, list); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyIdList (metafileImage, 1, list); assertEqualInt (status, NotImplemented); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getPropertyItemSize () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); PROPID prop = 100; UINT size; // Negative tests. status = GdipGetPropertyItemSize (NULL, prop, &size); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyItemSize (bitmapImage, prop, &size); assertEqualInt (status, PropertyNotFound); status = GdipGetPropertyItemSize (metafileImage, prop, &size); assertEqualInt (status, NotImplemented); status = GdipGetPropertyItemSize (bitmapImage, prop, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyItemSize (metafileImage, prop, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getPropertyItem () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); PROPID prop = 100; PropertyItem propertyItem; // Negative tests. status = GdipGetPropertyItem (NULL, prop, 1, &propertyItem); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyItem (bitmapImage, prop, 1, &propertyItem); assertEqualInt (status, PropertyNotFound); status = GdipGetPropertyItem (metafileImage, prop, 1, &propertyItem); assertEqualInt (status, NotImplemented); status = GdipGetPropertyItem (bitmapImage, prop, 1, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPropertyItem (metafileImage, prop, 1, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getPropertySize () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); UINT totalBufferSize; UINT numProperties; status = GdipGetPropertySize (bitmapImage, &totalBufferSize, &numProperties); assertEqualInt (status, Ok); assertEqualInt (totalBufferSize, 0); assertEqualInt (numProperties, 0); // Negative tests. status = GdipGetPropertySize (NULL, &totalBufferSize, &numProperties); assertEqualInt (status, InvalidParameter); status = GdipGetPropertySize (metafileImage, &totalBufferSize, &numProperties); assertEqualInt (status, NotImplemented); status = GdipGetPropertySize (bitmapImage, NULL, &numProperties); assertEqualInt (status, InvalidParameter); status = GdipGetPropertySize (metafileImage, NULL, &numProperties); assertEqualInt (status, InvalidParameter); status = GdipGetPropertySize (bitmapImage, &totalBufferSize, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPropertySize (metafileImage, &totalBufferSize, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_getAllPropertyItems () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); PropertyItem propertyItems[2]; // Negative tests. status = GdipGetAllPropertyItems (NULL, 0, 0, propertyItems); assertEqualInt (status, InvalidParameter); status = GdipGetAllPropertyItems (bitmapImage, 0, 0, propertyItems); assertEqualInt (status, GenericError); status = GdipGetAllPropertyItems (metafileImage, 0, 0, propertyItems); assertEqualInt (status, NotImplemented); status = GdipGetAllPropertyItems (bitmapImage, 0, 0, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetAllPropertyItems (metafileImage, 0, 0, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetAllPropertyItems (bitmapImage, 1, 0, propertyItems); assertEqualInt (status, InvalidParameter); status = GdipGetAllPropertyItems (metafileImage, 1, 0, propertyItems); assertEqualInt (status, NotImplemented); status = GdipGetAllPropertyItems (bitmapImage, 0, 1, propertyItems); assertEqualInt (status, InvalidParameter); status = GdipGetAllPropertyItems (metafileImage, 0, 1, propertyItems); assertEqualInt (status, NotImplemented); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void test_removePropertyItem () { GpStatus status; GpImage *bitmapImage = getImage ("test.bmp"); GpImage *metafileImage = getImage ("test.wmf"); PROPID prop = 100; // Negative tests. status = GdipRemovePropertyItem (NULL, prop); assertEqualInt (status, InvalidParameter); status = GdipRemovePropertyItem (bitmapImage, prop); assertEqualInt (status, GenericError); status = GdipRemovePropertyItem (metafileImage, prop); assertEqualInt (status, NotImplemented); GdipDisposeImage (bitmapImage); GdipDisposeImage (metafileImage); } static void setPropertyItemForImage (GpImage *image) { GpStatus status; INT temp = 1; PropertyItem propertyItem1 = {10, 0, 11, &temp}; PropertyItem propertyItem2 = {11, 0, 12, NULL}; PropertyItem propertyItem3 = {10, 0, 9, NULL}; UINT propertySize; PropertyItem resultPropertyItem; UINT numProperties; UINT totalBufferSize; PROPID propertyIds[2]; // Set new property. status = GdipSetPropertyItem (image, &propertyItem1); assertEqualInt (status, Ok); status = GdipGetPropertyItemSize (image, propertyItem1.id, &propertySize); assertEqualInt (status, Ok); assertEqualInt (propertySize, (int) sizeof(PropertyItem)); status = GdipGetPropertyItem (image, propertyItem1.id, propertySize, &resultPropertyItem); assertEqualInt (status, Ok); assertEqualInt (resultPropertyItem.id, 10); assertEqualInt (resultPropertyItem.length, 0); assertEqualInt (resultPropertyItem.type, 11); status = GdipGetPropertyCount (image, &numProperties); assertEqualInt (status, Ok); assertEqualInt (numProperties, 1); numProperties = -1; status = GdipGetPropertySize (image, &totalBufferSize, &numProperties); assertEqualInt (status, Ok); assertEqualInt (totalBufferSize, (int) sizeof(PropertyItem)); assertEqualInt (numProperties, 1); propertyIds[1] = -1; status = GdipGetPropertyIdList (image, numProperties, propertyIds); assertEqualInt (status, Ok); assertEqualInt (propertyIds[0], 10); assertEqualInt (propertyIds[1], -1); // Set another new property. status = GdipSetPropertyItem (image, &propertyItem2); assertEqualInt (status, Ok); status = GdipGetPropertyItemSize (image, propertyItem2.id, &propertySize); assertEqualInt (status, Ok); assertEqualInt (propertySize, (int) sizeof(PropertyItem)); status = GdipGetPropertyItem (image, propertyItem2.id, propertySize, &resultPropertyItem); assertEqualInt (status, Ok); assertEqualInt (resultPropertyItem.id, 11); assertEqualInt (resultPropertyItem.length, 0); assertEqualInt (resultPropertyItem.type, 12); status = GdipGetPropertyCount (image, &numProperties); assertEqualInt (status, Ok); assertEqualInt (numProperties, 2); numProperties = -1; status = GdipGetPropertySize (image, &totalBufferSize, &numProperties); assertEqualInt (status, Ok); assertEqualInt (totalBufferSize, (int) sizeof(PropertyItem) * 2); assertEqualInt (numProperties, 2); propertyIds[1] = -1; status = GdipGetPropertyIdList (image, numProperties, propertyIds); assertEqualInt (status, Ok); assertEqualInt (propertyIds[0], 10); assertEqualInt (propertyIds[1], 11); // Override an existing property. status = GdipSetPropertyItem (image, &propertyItem3); assertEqualInt (status, Ok); status = GdipGetPropertyItemSize (image, propertyItem3.id, &propertySize); assertEqualInt (status, Ok); assertEqualInt (propertySize, (int) sizeof(PropertyItem)); status = GdipGetPropertyItem (image, propertyItem3.id, propertySize, &resultPropertyItem); assertEqualInt (status, Ok); assertEqualInt (resultPropertyItem.id, 10); assertEqualInt (resultPropertyItem.length, 0); assertEqualInt (resultPropertyItem.type, 9); status = GdipGetPropertyCount (image, &numProperties); assertEqualInt (status, Ok); assertEqualInt (numProperties, 2); numProperties = -1; status = GdipGetPropertySize (image, &totalBufferSize, &numProperties); assertEqualInt (status, Ok); assertEqualInt (totalBufferSize, (int) sizeof(PropertyItem) * 2); assertEqualInt (numProperties, 2); propertyIds[1] = -1; status = GdipGetPropertyIdList (image, numProperties, propertyIds); assertEqualInt (status, Ok); assertEqualInt (propertyIds[0], 10); assertEqualInt (propertyIds[1], 11); } static void test_setPropertyItem() { GpStatus status; GpImage *bmpImage = getImage ("test.bmp"); GpImage *tifImage = getImage ("test.tif"); GpImage *gifImage = getImage ("test.gif"); GpImage *pngImage = getImage ("test.png"); GpImage *jpgImage = getImage ("test.jpg"); GpImage *icoImage = getImage ("test.ico"); GpImage *metafileImage = getImage ("test.wmf"); PropertyItem propertyItem = {10, 0, 11, NULL}; setPropertyItemForImage (bmpImage); status = GdipSetPropertyItem (tifImage, &propertyItem); assertEqualInt (status, Ok); status = GdipSetPropertyItem (gifImage, &propertyItem); assertEqualInt (status, Ok); status = GdipSetPropertyItem (pngImage, &propertyItem); assertEqualInt (status, Ok); status = GdipSetPropertyItem (jpgImage, &propertyItem); assertEqualInt (status, Ok); status = GdipSetPropertyItem (icoImage, &propertyItem); assertEqualInt (status, Ok); // Negative tests. status = GdipSetPropertyItem (NULL, &propertyItem); assertEqualInt (status, InvalidParameter); status = GdipSetPropertyItem (metafileImage, &propertyItem); assertEqualInt (status, NotImplemented); status = GdipSetPropertyItem (bmpImage, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPropertyItem (metafileImage, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (bmpImage); GdipDisposeImage (tifImage); GdipDisposeImage (gifImage); GdipDisposeImage (pngImage); GdipDisposeImage (jpgImage); GdipDisposeImage (icoImage); GdipDisposeImage (metafileImage); } int main (int argc, char**argv) { STARTUP; test_loadImageFromStream (); test_loadImageFromFile (); test_loadImageFromStreamICM (); test_loadImageFromFileICM (); test_loadImageFromFileTif (); test_loadImageFromFileGif (); test_loadImageFromFilePng (); test_loadImageFromFileJpg (); test_loadImageFromFileIcon (); test_loadImageFromFileWmf (); test_loadImageFromFileEmf (); test_cloneImage (); test_disposeImage (); test_getImageGraphicsContext (); test_getImageBounds (); test_getImageDimension (); test_getImageType (); test_getImageWidth (); test_getImageHeight (); test_getImageHorizontalResolution (); test_getImageVerticalResolution (); test_getImageFlags (); test_getImageRawFormat (); test_getImagePixelFormat (); test_getImageThumbnail (); test_getEncoderParameterListSize (); test_getEncoderParameterList (); test_getFrameDimensionsCount (); test_getFrameDimensionsList (); test_getFrameCount (); test_selectActiveFrame (); test_forceValidation (); test_rotateFlip (); test_getImagePalette (); test_setImagePalette (); test_getImagePaletteSize (); test_getPropertyCount (); test_getPropertyIdList (); test_getPropertyItemSize (); test_getPropertyItem (); test_getPropertySize (); test_getAllPropertyItems (); test_removePropertyItem (); test_setPropertyItem (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testemfcodec.c0000644000175000017500000017675213542672033021320 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static const char *file = "temp_asset.emf"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'e', 'm', 'f', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccess(buffer, x, y, width, height, dimensionWidth, dimensionHeight) \ { \ createFile (buffer, Ok); \ verifyMetafile (image, emfRawFormat, x, y, width, height, dimensionWidth, dimensionHeight) \ GdipDisposeImage (image); \ } static void test_valid () { BYTE simpleHeader[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE headerExtension1[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE headerExtension2[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x80, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00, /* Micrometers */ 0xC0, 0x4B, 0x03, 0x00, 0xD8, 0x41, 0x04, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroHeaderSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE smallHeaderSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroBoundsWidth[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroBoundsHeight[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE negativeWidth[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xB1, 0x03, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xD2, 0x00, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroFrameWidth[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroFrameHeight[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroVersion[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x00, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE bytesEqualToHeaderSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x58, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE largeRecords[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0xFF, 0xFF, 0xFF, 0xFF, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE largeHandles[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0xFF, 0xFF, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE nonZeroReserved[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0xFF, 0xFF, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE invalidDescription[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x6D, 0x00, 0x00, 0x00, /* offDescription*/ 0xFF, 0xFF, 0xFF, 0xFF, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE invalidPalEntries[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0xFF, 0xFF, 0xFF, 0xFF, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE shortMillimetres[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00 }; BYTE invalidPixelFormat[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x6D, 0x00, 0x00, 0x00, /* offPixelFormat */ 0xFF, 0xFF, 0xFF, 0xFF, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE invalidOpenGL[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x6D, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0xFF, 0xFF, 0xFF, 0xFF, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroMicrometresWidth[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x80, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00, /* Micrometers */ 0x00, 0x00, 0x00, 0x00, 0xD8, 0x41, 0x04, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroMicrometresHeight[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x80, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00, /* Micrometers */ 0xC0, 0x4B, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE noRecords[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x70, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE noCbPixelFormat[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE shortCbPixelFormat[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00 }; BYTE noOffPixelFormat[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, }; BYTE shortOffPixelFormat[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00 }; BYTE noOpenGL[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, }; BYTE shortOpenGL[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x78, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00 }; BYTE noMicrometers[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x80, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00 }; BYTE shortMicrometers[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x80, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* cbPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* offPixelFormat */ 0x00, 0x00, 0x00, 0x00, /* bOpenGL */ 0x00, 0x00, 0x00, 0x00, /* Micrometers */ 0xC0, 0x4B, 0x03, 0x00, 0xD8, 0x41, 0x04 }; BYTE tooLargeFileSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x00, 0x01, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; createFileSuccess (simpleHeader, 14, 20, 50, 18, 750, 216); createFileSuccess (headerExtension1, 14, 20, 50, 18, 750, 216); createFileSuccess (headerExtension2, 14, 20, 50, 18, 750, 216); createFileSuccess (zeroHeaderSize, 14, 20, 50, 18, 750, 216); createFileSuccess (smallHeaderSize, 14, 20, 50, 18, 750, 216); createFileSuccess (zeroBoundsWidth, 14, 20, 50, 18, 750, 216); createFileSuccess (zeroBoundsHeight, 14, 20, 50, 18, 750, 216); createFileSuccess (negativeWidth, 63, 20, -48, 18, -720, 216); createFileSuccess (zeroFrameWidth, 0, 20, 1, 18, 15, 216); createFileSuccess (zeroFrameHeight, 14, 0, 50, 1, 750, 12); createFileSuccess (zeroVersion, 14, 20, 50, 18, 750, 216); createFileSuccess (bytesEqualToHeaderSize, 14, 20, 50, 18, 750, 216); createFileSuccess (largeRecords, 14, 20, 50, 18, 750, 216); createFileSuccess (largeHandles, 14, 20, 50, 18, 750, 216); createFileSuccess (nonZeroReserved, 14, 20, 50, 18, 750, 216); createFileSuccess (invalidDescription, 14, 20, 50, 18, 750, 216); createFileSuccess (invalidPalEntries, 14, 20, 50, 18, 750, 216); createFileSuccess (shortMillimetres, 14, 20, 50, 18, 750, 216); createFileSuccess (invalidPixelFormat, 14, 20, 50, 18, 750, 216); createFileSuccess (invalidOpenGL, 14, 20, 50, 18, 750, 216); createFileSuccess (zeroMicrometresWidth, 14, 20, 50, 18, 750, 216); createFileSuccess (zeroMicrometresHeight, 14, 20, 50, 18, 750, 216); createFileSuccess (noRecords, 14, 20, 50, 18, 750, 216); createFileSuccess (noCbPixelFormat, 14, 20, 50, 18, 750, 216); createFileSuccess (shortCbPixelFormat, 14, 20, 50, 18, 750, 216); createFileSuccess (noOffPixelFormat, 14, 20, 50, 18, 750, 216); createFileSuccess (shortOffPixelFormat, 14, 20, 50, 18, 750, 216); createFileSuccess (noOpenGL, 14, 20, 50, 18, 750, 216); createFileSuccess (shortOpenGL, 14, 20, 50, 18, 750, 216); createFileSuccess (noMicrometers, 14, 20, 50, 18, 750, 216); createFileSuccess (shortMicrometers, 14, 20, 50, 18, 750, 216); createFileSuccess (tooLargeFileSize, 14, 20, 50, 18, 750, 216); } static void test_invalidHeader() { BYTE shortType[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00 }; BYTE noSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00 }; BYTE shortSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00 }; BYTE noBounds[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00 }; BYTE shortBounds[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00 }; BYTE noFrame[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00 }; BYTE shortFrame[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00 }; BYTE noSignature[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00 }; BYTE shortSignature[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D }; BYTE noVersion[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46 }; BYTE shortVersion[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01 }; BYTE noBytes[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00 }; BYTE shortBytes[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00 }; BYTE noRecords[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00 }; BYTE shortRecords[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00 }; BYTE noHandles[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00 }; BYTE shortHandles[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01 }; BYTE noReserved[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00 }; BYTE shortReserved[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00 }; BYTE noNDescription[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00 }; BYTE shortNDescription[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00 }; BYTE noOffDescription[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00 }; BYTE shortOffDescription[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00 }; BYTE noPalEntries[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00 }; BYTE shortPalEntries[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00 }; BYTE noDevice[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, }; BYTE shortDevice[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00 }; BYTE noMillimetres[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00 }; createFile (shortType, OutOfMemory); createFile (noSize, OutOfMemory); createFile (shortSize, OutOfMemory); createFile (noBounds, OutOfMemory); createFile (shortBounds, OutOfMemory); createFile (noFrame, OutOfMemory); createFile (shortFrame, OutOfMemory); createFile (noSignature, OutOfMemory); createFile (shortSignature, OutOfMemory); createFile (noVersion, OutOfMemory); createFile (shortVersion, OutOfMemory); createFile (noBytes, OutOfMemory); createFile (shortBytes, OutOfMemory); createFile (noRecords, OutOfMemory); createFile (shortRecords, OutOfMemory); createFile (noHandles, OutOfMemory); createFile (shortHandles, OutOfMemory); createFile (noReserved, OutOfMemory); createFile (shortReserved, OutOfMemory); createFile (noNDescription, OutOfMemory); createFile (shortNDescription, OutOfMemory); createFile (noOffDescription, OutOfMemory); createFile (shortOffDescription, OutOfMemory); createFile (noPalEntries, OutOfMemory); createFile (shortPalEntries, OutOfMemory); createFile (noDevice, OutOfMemory); createFile (shortDevice, OutOfMemory); createFile (noMillimetres, OutOfMemory); createFile (shortDevice, OutOfMemory); } static void test_invalidData () { BYTE invalidType[] = { /* EMR_HEADER */ 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE largeHeaderSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0xCD, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE negativeHeight[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE invalidSignature[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x00, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroBytes[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x00, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE bytesSmallerThanHeaderSize[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x54, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE bytesNotDivisibleBy4[] = { /* EMR_HEADER */ 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6E, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroRecords[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x00, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE oneRecord[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x01, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroHandles[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x00, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroDeviceWidth[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0x00, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroDeviceHeight[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x01, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroMillimetresWidth[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x00, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; BYTE zeroMillimetresHeight[] = { /* EMR_HEADER */ 0x01, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, /* Bounds */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, /* Frame */ 0xD2, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xB1, 0x03, 0x00, 0x00, 0xBC, 0x01, 0x00, 0x00, /* Signature */ 0x20, 0x45, 0x4D, 0x46, /* Version */ 0x00, 0x00, 0x01, 0x00, /* Bytes */ 0x6C, 0x00, 0x00, 0x00, /* Records */ 0x02, 0x00, 0x00, 0x00, /* Handles */ 0x00, 0x00, /* Reserved */ 0x00, 0x00, /* nDescription */ 0x00, 0x00, 0x00, 0x00, /* offDescription*/ 0x00, 0x00, 0x00, 0x00, /* palEntries */ 0x00, 0x00, 0x00, 0x00, /* Device */ 0xA0, 0x05, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, /* Millimetres */ 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* EMR_EOF */ 0x0E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00 }; createFile (invalidType, OutOfMemory); createFile (largeHeaderSize, OutOfMemory); createFile (negativeHeight, OutOfMemory); createFile (invalidSignature, OutOfMemory); createFile (zeroBytes, OutOfMemory); createFile (bytesSmallerThanHeaderSize, OutOfMemory); createFile (bytesNotDivisibleBy4, OutOfMemory); createFile (zeroRecords, OutOfMemory); createFile (oneRecord, OutOfMemory); createFile (zeroHandles, OutOfMemory); createFile (zeroDeviceWidth, OutOfMemory); createFile (zeroDeviceHeight, OutOfMemory); createFile (zeroMillimetresWidth, OutOfMemory); createFile (zeroMillimetresHeight, OutOfMemory); } int main (int argc, char**argv) { STARTUP; test_valid (); test_invalidHeader (); test_invalidData (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.jpg0000644000175000017500000000426612377405421020156 0ustar directhexdirecthexJFIFC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222Dd" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?-{ĶZkDQ|u$Ǝ ]&iy2]chϠSκMcu5ս U%p sҼƾӬt+xi2ṐWTN3Y?#a%kj^⏈g[$\^1^XεfW3ǸH!1^06&1J>M?Ks8H2!p?"~[[!Hc` #`2ti$jd)q֧5: +7e!rGcli uMmuD}T?*ƭQ@Q@Q@ZMԚTO~Rf'y /e:}=+)}3^E&ܨc. x"NkXm&͋s)뻒A?Q_?:L,/0op3q#k:c?ƚ#io07GqE`qQAv}jFco+lh(}}j]/Q>Mb`BT%ɝڮ'M[Of㘍GpO޷чS}^YGW|,e+hV -+ō gz,m|r].џG]0]D%9c=6 +A{D DnY.ELJKir?, 9P+7HCRQ-p,y (#J(Ҋu{@&rDHy#l\|Ye-Ԑ ]jnOƶ C}5 ,xƺYC]6= u^Y{6Ww$::(^zv7Kk;hAx @g#X|U ʑ,yVpA /ZN;󰪪tb ( ( (xǘdڬ([KġrG^ڲA[ rs .>VǨ8?&5YxB "[\@RwJ2C_]Fv='5?>,l ž!f2s:nyy t{ uug|ʄFz&yd]MkE[=Ȍ'ΉVdxCiw\y@ 'W@ ; F&( #Ojikm&׆8y'O r8ӥKmԃGWZBUQm}I;k~ z#F /dƽv;5iXZ(!EPEPEPEPXzmVv9Inx0z(6VVKxpH*䜓jPHQEQElibgdiplus-6.0.4+dfsg/tests/test.gif0000644000175000017500000001134312377405421020135 0ustar directhexdirecthexGIF89adD765YZZrtw#" f95* JNRfTK'%uiyZSY82B%!ikl>>=uq**'~dIE־eZWzdbaSPKJIO81}`\/:$ ʞPA>cVR[>xvB*.%! VVT Ʀ?{fc7,(WEAS2/ wrqzv/p][oROjd@86Ȕvvt]-*& Ңpjh*$!sVScQM/*(&zrjb`H>< ha8JED6 üRVXC2+İ.ܗͱcA;  xlk&&$0.-\NKmIIe^][VTb^^bb򄂂RJHdffV"OFCFFDQRRWJFZR򾮞9:9zNJ/!>-+zf}} ons]^^rB>ڼjfzzzV+-PNMy"F,&ofeqnllfң&B 72/nL?[ROjVP~rrjfdB>=j^\&{vt|oNMzRF̩^ZX,dD@k o$[P.j1#ؐړ'@h|ŏ CIIL%>Z(@KS.qITn>4wԨAsCѳ(]7o]TQɫXIz|,[$9'W`\ u+;3f# sFx\>Eɽ{a$GA?ahݲ>q!7ppNd3nZv:Z c_2 U\S2MC.Qr@N2X[osf+Ԫ/>*ā wLpx RDhK!"dH. J]dE^ m !O; bM pA#" h}\$`pO<"8W 5첋(AI9^ӏmw$EءEЍ lt$3 E:DM:G2)e秠C%`~k=O0*H@;Ϯ@`8TL҅!`qFpQqyCVt#ɶ%H2GT *p4  \X>tOe]L%= UHGcpJ%C^b (t0|E;}l D2 #x)'uhGڬ"<|3,Ӝ"4:C1?aX2V\vO7*Pg6 B0 D$(+`44J9   䠁V[=$8.Z7>I0H;Ȓ@!`'@?"x'0(.VQ5TQ4`NmLj0 =s'+>Ec@!8.2Τf[a!O݃>2Ncl ?8Ć-|#\; ^ƭKA vG7,rACP?{[E, M0fgj 92ёw#ԸG<$ Rbi$ gŪ kC9=Hьd1@E1HQIC9j0$Ux5OMˉȌR% M`A& |` 0D8 19,a &Vԡ #ʇ>I(QK6_#*pTAB/&1-vt2g'`hC*tSl" D n4WBb9 "Db 4|v,` <#`f0 `C CnpF\cp8B!eAi2y҆)A<=:v C'rP SD?u>fF4 `CBNR;8:$#[E Bp!԰*,"G8RnN8q D8׸4р)'1VqKA`"X8@2C n0%<1 ; L'Pj! >DT@(vN D,Ė-hakIrA:S|PK4U$9;c"D'h<9'Qf>2ɝXl1 h^G *"DP#L=بwQ@ PCMOT@s@r`v0,`3Rϐ} #0 p + Pkp =@j_L0MI- P PKp  [scE`:@*dj#0 dPx`#F`0 up EE ݀C6o@-! I`20 KCp=d `.1h\ 2 1cO=C p 58 P s 4*Mt` C6$ h  ڠ0 @P3)` u0 eUPT} `:[p `8%WY"%^df [ A6y R [0 Ћ0p 2)  €!B` 0E q Ed1pC 9LYQ 30k` J0uӀ7b0 ' 0E@T: @ p րSǐ` PưI"qv%ANOp60Np Pp 22` ӠPX0  0 06y:q {; ^ ' B ) `e"R2[1 X( P^p 4% ` 0 3% PU0`]ҕeA]-RR\Q# Va0\ !3= =A^`C5W9 0 rM WOX `>#$DNE @dhH` `S<2= T[P f}I 0 ;Rp65 ^: E0 +PSW!iװ^ak60 ^#b!]  bUSUB0 E, ey# Cw}Q Ȁ` 9R@ F4 `>X0 ``^䅥*R + `eq.8!fS$#z$p W$8`32'pИ` `ZvF Vyn!)!+"Ȱz@0P v@p` hڀ#-" P d)U~? i@ ^Qf Z0 `Pߠ cp[nO.( 2 O VaApgpS` g  k9J7.@Ȑa@n (k=N ` Y@˰0 ?GGk9k`20 Jn ?  pnD@h` &p M2hhcK- 1  fx4[6A tRM 50 b #include #pragma comment(lib, "gdiplus") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include #include #include "testhelpers.h" /* FIXME: * libgdiplus version is larger than it should be. The library writes * to the extended fields, overwriting other data if the non-extended * version is used. This causes the failure of this test because other * parts of the stack are unexpectedly overwritten. */ typedef union { BitmapData origBitmapData; /* This structure is from src/bitmap-private.h */ struct { unsigned int width; unsigned int height; int stride; int pixel_format; BYTE *scan0; unsigned int reserved; /* the rest of the structure isn't part of MS GDI+ definition */ ColorPalette *palette; int property_count; /* Number of properties */ PropertyItem *property; /* Properties associated with image */ float dpi_horz; /* */ float dpi_vert; /* */ ImageFlags image_flags; /* Alpha, ColorSpace, etc. */ unsigned int left; /* left display coordinate of frame */ unsigned int top; /* top display coordinate of frame */ unsigned int x; /* LockBits: left coordinate of locked rectangle */ unsigned int y; /* LockBits: top coordinate of locked rectangle */ int transparent; /* Index of transparent color (<24bit only) */ } extendedBitmapData; } IncompatibleBitmapData; static void test_lockBits () { GpBitmap *bitmap; IncompatibleBitmapData d, q; Rect r = {0, 0, 10, 10}; int i, j; unsigned char *cptr; BYTE *scan0 = (BYTE*) GdipAlloc(10 * 10 * 4); GpStatus status = GdipCreateBitmapFromScan0 (10, 10, 10 * 4, PixelFormat32bppARGB, scan0, &bitmap); assertEqualInt (status, Ok); // Full rectangle, no format conversion, read only. status = GdipBitmapLockBits (bitmap, &r, ImageLockModeRead, PixelFormat32bppARGB, &d.origBitmapData); assertEqualInt (status, Ok); // Relock. status = GdipBitmapLockBits (bitmap, &r, ImageLockModeRead, PixelFormat32bppARGB, &q.origBitmapData); assertEqualInt (status, WrongState); // Unlock. status = GdipBitmapUnlockBits (bitmap, &d.origBitmapData); assertEqualInt (status, Ok); // Half rectangle, no format conversion, read only memset (&d, 0x00, sizeof (IncompatibleBitmapData)); status = GdipBitmapLockBits (bitmap, &r, ImageLockModeRead, PixelFormat32bppARGB, &d.origBitmapData); assertEqualInt (status, Ok); for (j = 0; j < 5; j++) { cptr = (unsigned char *) d.origBitmapData.Scan0 + j * d.origBitmapData.Stride; printf ("%d: ", j); for (i = 0; i < 5; i++) { printf ("%04x ", *cptr++); } printf ("\n"); } printf ("Modifying (setting to 0xff)\n"); memset (d.origBitmapData.Scan0, 0xff, d.origBitmapData.Stride * d.origBitmapData.Height); status = GdipBitmapUnlockBits (bitmap, &d.origBitmapData); assertEqualInt (status, Ok); // Half rectangle, 32bpp ARGB -> 32bpp RGB, read only memset (&d, 0x00, sizeof (IncompatibleBitmapData)); r.X = 5; r.Y = 5; r.Width = 5; r.Height = 5; status = GdipBitmapLockBits (bitmap, &r, ImageLockModeRead, PixelFormat32bppRGB, &d.origBitmapData); assertEqualInt (status, Ok); for (j = 0; j < 5; j++) { cptr = (unsigned char *) d.origBitmapData.Scan0 + j * d.origBitmapData.Stride; printf ("%d: ", j); for (i = 0; i < 5; i++) { printf ("%04x ", *cptr++); } printf ("\n"); } status = GdipBitmapUnlockBits (bitmap, &d.origBitmapData); assertEqualInt (status, Ok); // nHalf rectangle, 32bpp ARGB -> 24bpp RGB, read/write only memset (&d, 0x00, sizeof (IncompatibleBitmapData)); r.X = 5; r.Y = 5; r.Width = 5; r.Height = 5; status = GdipBitmapLockBits (bitmap, &r, ImageLockModeRead | ImageLockModeWrite, PixelFormat24bppRGB, &d.origBitmapData); assertEqualInt (status, Ok); for (j = 0; j < 5; j++) { cptr = ((unsigned char *)d.origBitmapData.Scan0) + (j * d.origBitmapData.Stride); printf ("%d: ", j); for (i = 0; i < 5; i++) { printf ("%02x%02x%02x ", cptr[0], cptr[1], cptr[2]); cptr += 3; } printf ("\n"); } printf ("Modifying (setting to 0xaabbcc)\n"); for (j = 0; j < 5; j++) { cptr = ((unsigned char *)d.origBitmapData.Scan0) + (j * d.origBitmapData.Stride); for (i = 0; i < 5; i++) { *cptr++ = 0xcc; *cptr++ = 0xbb; *cptr++ = 0xaa; } } status = GdipBitmapUnlockBits (bitmap, &d.origBitmapData); assertEqualInt (status, Ok); GdipFree (scan0); GdipDisposeImage ((GpImage *) bitmap); } static void test_unlockBits () { GpStatus status; GpBitmap *bitmap; IncompatibleBitmapData data; GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat32bppARGB, NULL, &bitmap); // Negative tests. memset (&data, 0x00, sizeof (IncompatibleBitmapData)); status = GdipBitmapUnlockBits (NULL, &data.origBitmapData); assertEqualInt (status, InvalidParameter); status = GdipBitmapUnlockBits (bitmap, NULL); assertEqualInt (status, InvalidParameter); status = GdipBitmapUnlockBits (bitmap, &data.origBitmapData); assertEqualInt (status, Win32Error); GdipDisposeImage ((GpImage *) bitmap); } int main (int argc, char **argv) { STARTUP; test_lockBits (); test_unlockBits (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testwmfcodec.c0000644000175000017500000005724413542672033021334 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static const char *file = "temp_asset.wmf"; static WCHAR wFile[] = {'t', 'e', 'm', 'p', '_', 'a', 's', 's', 'e', 't', '.', 'w', 'm', 'f', 0}; GpImage *image; #define createFile(buffer, expectedStatus) \ { \ GpStatus status; \ FILE *f = fopen (file, "wb+"); \ assert (f); \ fwrite ((void *) buffer, sizeof (BYTE), sizeof (buffer), f); \ fclose (f); \ \ status = GdipLoadImageFromFile (wFile, &image); \ assertEqualInt (status, expectedStatus); \ } #define createFileSuccess(buffer, x, y, width, height, dimensionWidth, dimensionHeight) \ { \ createFile (buffer, Ok); \ verifyMetafile (image, wmfRawFormat, x, y, width, height, dimensionWidth, dimensionHeight) \ GdipDisposeImage (image); \ } static void test_valid () { BYTE singleEOFRecord[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE nonZeroHandle[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x01, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x54, /* Metafile Header */ 0x02, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE diskFileType[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x02, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE nonZeroNumberOfObjects[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroMaxRecordSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE nonZeroNoParameters[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xFF, 0xFF, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE longEOFRecord[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, /* Random */ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x02 }; BYTE topGreaterThanBottom[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0xCE, 0xF2, 0x00, 0x01, 0x32, 0x0D, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0xAA, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE leftGreaterThanRight[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x01, 0xCE, 0xF2, 0x00, 0x00, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0xAA, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroInches[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x57, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE nonZeroReserved[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE nonDIBVersionNumber[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x01, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; createFileSuccess (singleEOFRecord, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (nonZeroHandle, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (diskFileType, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (nonZeroNumberOfObjects, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (zeroMaxRecordSize, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (nonZeroNoParameters, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (longEOFRecord, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (topGreaterThanBottom, -3378, 0, 6756, 256, 17160.2383f, 650.239929f); createFileSuccess (leftGreaterThanRight, 0, -3378, 256, 6756, 650.239929f, 17160.2383f); createFileSuccess (zeroInches, -4008, -3378, 8016, 6756, 14139.333008f, 11916.833008f); createFileSuccess (nonZeroReserved, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (nonDIBVersionNumber, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); } static void test_invalidDataCorruptingGdiPlus () { // GDI+ produces some really strange results - including negative sizes - if the checksum is invalid. // We probably don't want to emulate this behaviour. #if defined(USE_WINDOWS_GDIPLUS) BYTE invalidChecksum[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroWidth[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x00, 0xCE, 0xF2, 0x00, 0x00, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0xAB, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroHeight[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0x00, 0x00, 0xA8, 0x0F, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0xAB, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; createFile (invalidChecksum, Ok); verifyImage (image, ImageTypeMetafile, emfRawFormat, PixelFormat32bppRGB, 0, 0, 2, 2, -0.005236f, -0.004651f, -0.104166f, -0.092590f, 327683, 0, TRUE); GdipDisposeImage(image); createFile (zeroWidth, Ok); verifyImage (image, ImageTypeMetafile, emfRawFormat, PixelFormat32bppRGB, 0, 0, 2, 2, -0.005236f, -0.004651f, -0.104166f, -0.092590f, 327683, 0, TRUE); GdipDisposeImage(image); createFile (zeroHeight, Ok); verifyImage (image, ImageTypeMetafile, emfRawFormat, PixelFormat32bppRGB, 0, 0, 2, 2, -0.005236f, -0.004651f, -0.104166f, -0.092590f, 327683, 0, TRUE); GdipDisposeImage(image); #endif } static void test_invalidFileSize() { BYTE equalToHeaderFileSizeWithoutExtraData[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE equalToHeaderFileSizeWithExtraData[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE tooLargeFileSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; createFileSuccess (equalToHeaderFileSizeWithoutExtraData, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (equalToHeaderFileSizeWithExtraData, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); createFileSuccess (tooLargeFileSize, -4008, -3378, 8016, 6756, 20360.638672f, 17160.2383f); } static void test_invalidPlaceableHeader () { BYTE shortKey1[] = {0xD7}; BYTE shortKey2[] = {0xD7, 0xCD}; BYTE shortKey3[] = {0xD7, 0xCD, 0xC6}; BYTE noHandle[] = {0xD7, 0xCD, 0xC6, 0x9A}; BYTE shortHandle[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00}; BYTE noLeft[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00}; BYTE shortLeft[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00}; BYTE noTop[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05}; BYTE shortTop[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00}; BYTE noRight[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04}; BYTE shortRight[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00}; BYTE noBottom[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06}; BYTE shortBottom[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00}; BYTE noInches[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02}; BYTE shortInches[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00}; BYTE noReserved[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02}; BYTE shortReserved[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00}; BYTE noChecksum[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; BYTE shortChecksum[] = {0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50}; createFile (shortKey1, OutOfMemory); createFile (shortKey2, OutOfMemory); createFile (shortKey3, OutOfMemory); createFile (noHandle, OutOfMemory); createFile (shortHandle, OutOfMemory); createFile (noLeft, OutOfMemory); createFile (shortLeft, OutOfMemory); createFile (noTop, OutOfMemory); createFile (shortTop, OutOfMemory); createFile (noRight, OutOfMemory); createFile (shortRight, OutOfMemory); createFile (noBottom, OutOfMemory); createFile (shortBottom, OutOfMemory); createFile (noInches, OutOfMemory); createFile (shortInches, OutOfMemory); createFile (noReserved, OutOfMemory); createFile (shortReserved, OutOfMemory); createFile (noChecksum, OutOfMemory); createFile (shortChecksum, OutOfMemory); } static void test_invalidMetafileHeader () { BYTE noType[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11 }; BYTE shortType[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01 }; BYTE noHeaderSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00 }; BYTE shortHeaderSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09 }; BYTE noVersion[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00 }; BYTE shortVersion[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00 }; BYTE noFileSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03 }; BYTE shortFileSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 004, 0x00, 0x00 }; BYTE noNumObjects[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x05, 0x00, 0x00, 0x00 }; BYTE shortNumObjects[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00 }; BYTE noMaxRecordSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE shortMaxRecordSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noNoParameters[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE shortNoParameters[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0x11, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; createFile (noType, OutOfMemory); createFile (shortType, OutOfMemory); createFile (noHeaderSize, OutOfMemory); createFile (shortHeaderSize, OutOfMemory); createFile (noVersion, OutOfMemory); createFile (shortVersion, OutOfMemory); createFile (noFileSize, OutOfMemory); createFile (shortFileSize, OutOfMemory); createFile (noNumObjects, OutOfMemory); createFile (shortNumObjects, OutOfMemory); createFile (noMaxRecordSize, OutOfMemory); createFile (shortMaxRecordSize, OutOfMemory); createFile (noNoParameters, OutOfMemory); createFile (shortNoParameters, OutOfMemory); } static void test_invalidImageData() { BYTE zeroFileType[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x00, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE invalidFileType[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x03, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroHeaderSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE smallHeaderSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x08, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE largeHeaderSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x0A, 0x00, 0x00, 0x03, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroVersionNumber[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE twoVersionNumber[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x02, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE largeVersionNumber[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x04, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE zeroFileSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE smallerThanHeaderFileSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE smallerThanEOFFileSize1[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE smallerThanEOFFileSize2[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* META_EOF */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noRecordsZeroMaxSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noRecordsSmallMaxSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }; BYTE noRecordsLargeMaxSize[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }; #if defined(USE_WINDOWS_GDIPLUS) BYTE noSuchFunction[] = { /* Placeable Header */ 0xD7, 0xCD, 0xC6, 0x9A, 0x00, 0x00, 0x58, 0xF0, 0xCE, 0xF2, 0xA8, 0x0F, 0x32, 0x0d, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x54, /* Metafile Header */ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* Random */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x01 }; #endif createFile (zeroFileType, OutOfMemory); createFile (invalidFileType, OutOfMemory); createFile (zeroHeaderSize, OutOfMemory); createFile (smallHeaderSize, OutOfMemory); createFile (largeHeaderSize, OutOfMemory); createFile (zeroVersionNumber, OutOfMemory); createFile (twoVersionNumber, OutOfMemory); createFile (largeVersionNumber, OutOfMemory); createFile (zeroFileSize, OutOfMemory); createFile (smallerThanHeaderFileSize, OutOfMemory); createFile (smallerThanEOFFileSize1, OutOfMemory); createFile (smallerThanEOFFileSize2, OutOfMemory); createFile (noRecordsZeroMaxSize, OutOfMemory); createFile (noRecordsSmallMaxSize, OutOfMemory); createFile (noRecordsLargeMaxSize, OutOfMemory); // FIXME: seems like GDI+ validates records more than libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) createFile (noSuchFunction, OutOfMemory); #endif } int main (int argc, char**argv) { STARTUP; test_valid (); test_invalidDataCorruptingGdiPlus (); test_invalidFileSize (); test_invalidPlaceableHeader (); test_invalidMetafileHeader (); test_invalidImageData (); deleteFile (file); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/Makefile.in0000644000175000017500000020021213545371055020532 0ustar directhexdirecthex# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = testadjustablearrowcap$(EXEEXT) testbitmap$(EXEEXT) \ testbits$(EXEEXT) testbmpcodec$(EXEEXT) testbrush$(EXEEXT) \ testclip$(EXEEXT) testcodecs$(EXEEXT) \ testcustomlinecap$(EXEEXT) testemfcodec$(EXEEXT) \ testfont$(EXEEXT) testgeneral$(EXEEXT) testgifcodec$(EXEEXT) \ testgpimage$(EXEEXT) testgraphics$(EXEEXT) \ testgraphicsdraw$(EXEEXT) testgraphicsfill$(EXEEXT) \ testgraphicspath$(EXEEXT) testhatchbrush$(EXEEXT) \ testicocodec$(EXEEXT) testimageattributes$(EXEEXT) \ testjpegcodec$(EXEEXT) testlineargradientbrush$(EXEEXT) \ testmatrix$(EXEEXT) testmetafile$(EXEEXT) \ testpathgradientbrush$(EXEEXT) testpen$(EXEEXT) \ testpng$(EXEEXT) testpngcodec$(EXEEXT) testregion$(EXEEXT) \ testreversepath$(EXEEXT) testsolidbrush$(EXEEXT) \ teststringformat$(EXEEXT) testtext$(EXEEXT) \ testtexturebrush$(EXEEXT) testtiffcodec$(EXEEXT) \ testwmfcodec$(EXEEXT) TESTS = testadjustablearrowcap$(EXEEXT) testbitmap$(EXEEXT) \ testbits$(EXEEXT) testbmpcodec$(EXEEXT) testbrush$(EXEEXT) \ testclip$(EXEEXT) testcodecs$(EXEEXT) \ testcustomlinecap$(EXEEXT) testemfcodec$(EXEEXT) \ testfont$(EXEEXT) testgifcodec$(EXEEXT) testgeneral$(EXEEXT) \ testgpimage$(EXEEXT) testgraphics$(EXEEXT) \ testgraphicsdraw$(EXEEXT) testgraphicsfill$(EXEEXT) \ testgraphicspath$(EXEEXT) testhatchbrush$(EXEEXT) \ testicocodec$(EXEEXT) testimageattributes$(EXEEXT) \ testjpegcodec$(EXEEXT) testlineargradientbrush$(EXEEXT) \ testmatrix$(EXEEXT) testmetafile$(EXEEXT) \ testpathgradientbrush$(EXEEXT) testpen$(EXEEXT) \ testpng$(EXEEXT) testpngcodec$(EXEEXT) testregion$(EXEEXT) \ testreversepath$(EXEEXT) testsolidbrush$(EXEEXT) \ teststringformat$(EXEEXT) testtexturebrush$(EXEEXT) \ testtext$(EXEEXT) testtiffcodec$(EXEEXT) testwmfcodec$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_testadjustablearrowcap_OBJECTS = testadjustablearrowcap.$(OBJEXT) testadjustablearrowcap_OBJECTS = $(am_testadjustablearrowcap_OBJECTS) am__DEPENDENCIES_1 = $(top_builddir)/src/libgdiplus.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_testbitmap_OBJECTS = testbitmap.$(OBJEXT) testbitmap_OBJECTS = $(am_testbitmap_OBJECTS) am_testbits_OBJECTS = testbits.$(OBJEXT) testbits_OBJECTS = $(am_testbits_OBJECTS) am_testbmpcodec_OBJECTS = testbmpcodec.$(OBJEXT) testbmpcodec_OBJECTS = $(am_testbmpcodec_OBJECTS) am_testbrush_OBJECTS = testbrush.$(OBJEXT) testbrush_OBJECTS = $(am_testbrush_OBJECTS) am_testclip_OBJECTS = testclip.$(OBJEXT) testclip_OBJECTS = $(am_testclip_OBJECTS) am_testcodecs_OBJECTS = testcodecs.$(OBJEXT) testcodecs_OBJECTS = $(am_testcodecs_OBJECTS) am_testcustomlinecap_OBJECTS = testcustomlinecap.$(OBJEXT) testcustomlinecap_OBJECTS = $(am_testcustomlinecap_OBJECTS) am_testemfcodec_OBJECTS = testemfcodec.$(OBJEXT) testemfcodec_OBJECTS = $(am_testemfcodec_OBJECTS) am_testfont_OBJECTS = testfont.$(OBJEXT) testfont_OBJECTS = $(am_testfont_OBJECTS) am_testgeneral_OBJECTS = testgeneral.$(OBJEXT) testgeneral_OBJECTS = $(am_testgeneral_OBJECTS) am_testgifcodec_OBJECTS = testgifcodec.$(OBJEXT) testgifcodec_OBJECTS = $(am_testgifcodec_OBJECTS) am_testgpimage_OBJECTS = testgpimage.$(OBJEXT) testgpimage_OBJECTS = $(am_testgpimage_OBJECTS) am_testgraphics_OBJECTS = testgraphics.$(OBJEXT) testgraphics_OBJECTS = $(am_testgraphics_OBJECTS) am_testgraphicsdraw_OBJECTS = testgraphicsdraw.$(OBJEXT) testgraphicsdraw_OBJECTS = $(am_testgraphicsdraw_OBJECTS) am_testgraphicsfill_OBJECTS = testgraphicsfill.$(OBJEXT) testgraphicsfill_OBJECTS = $(am_testgraphicsfill_OBJECTS) am_testgraphicspath_OBJECTS = testgraphicspath.$(OBJEXT) testgraphicspath_OBJECTS = $(am_testgraphicspath_OBJECTS) am_testhatchbrush_OBJECTS = testhatchbrush.$(OBJEXT) testhatchbrush_OBJECTS = $(am_testhatchbrush_OBJECTS) am_testicocodec_OBJECTS = testicocodec.$(OBJEXT) testicocodec_OBJECTS = $(am_testicocodec_OBJECTS) am_testimageattributes_OBJECTS = testimageattributes.$(OBJEXT) testimageattributes_OBJECTS = $(am_testimageattributes_OBJECTS) am_testjpegcodec_OBJECTS = testjpegcodec.$(OBJEXT) testjpegcodec_OBJECTS = $(am_testjpegcodec_OBJECTS) am_testlineargradientbrush_OBJECTS = \ testlineargradientbrush.$(OBJEXT) testlineargradientbrush_OBJECTS = \ $(am_testlineargradientbrush_OBJECTS) am_testmatrix_OBJECTS = testmatrix.$(OBJEXT) testmatrix_OBJECTS = $(am_testmatrix_OBJECTS) am_testmetafile_OBJECTS = testmetafile.$(OBJEXT) testmetafile_OBJECTS = $(am_testmetafile_OBJECTS) am_testpathgradientbrush_OBJECTS = testpathgradientbrush.$(OBJEXT) testpathgradientbrush_OBJECTS = $(am_testpathgradientbrush_OBJECTS) am_testpen_OBJECTS = testpen.$(OBJEXT) testpen_OBJECTS = $(am_testpen_OBJECTS) am_testpng_OBJECTS = testpng.$(OBJEXT) testpng_OBJECTS = $(am_testpng_OBJECTS) am_testpngcodec_OBJECTS = testpngcodec.$(OBJEXT) testpngcodec_OBJECTS = $(am_testpngcodec_OBJECTS) am_testregion_OBJECTS = testregion.$(OBJEXT) testregion_OBJECTS = $(am_testregion_OBJECTS) am_testreversepath_OBJECTS = testreversepath.$(OBJEXT) testreversepath_OBJECTS = $(am_testreversepath_OBJECTS) am_testsolidbrush_OBJECTS = testsolidbrush.$(OBJEXT) testsolidbrush_OBJECTS = $(am_testsolidbrush_OBJECTS) am_teststringformat_OBJECTS = teststringformat.$(OBJEXT) teststringformat_OBJECTS = $(am_teststringformat_OBJECTS) am_testtext_OBJECTS = testtext.$(OBJEXT) testtext_OBJECTS = $(am_testtext_OBJECTS) am_testtexturebrush_OBJECTS = testtexturebrush.$(OBJEXT) testtexturebrush_OBJECTS = $(am_testtexturebrush_OBJECTS) am_testtiffcodec_OBJECTS = testtiffcodec.$(OBJEXT) testtiffcodec_OBJECTS = $(am_testtiffcodec_OBJECTS) am_testwmfcodec_OBJECTS = testwmfcodec.$(OBJEXT) testwmfcodec_OBJECTS = $(am_testwmfcodec_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(testadjustablearrowcap_SOURCES) $(testbitmap_SOURCES) \ $(testbits_SOURCES) $(testbmpcodec_SOURCES) \ $(testbrush_SOURCES) $(testclip_SOURCES) $(testcodecs_SOURCES) \ $(testcustomlinecap_SOURCES) $(testemfcodec_SOURCES) \ $(testfont_SOURCES) $(testgeneral_SOURCES) \ $(testgifcodec_SOURCES) $(testgpimage_SOURCES) \ $(testgraphics_SOURCES) $(testgraphicsdraw_SOURCES) \ $(testgraphicsfill_SOURCES) $(testgraphicspath_SOURCES) \ $(testhatchbrush_SOURCES) $(testicocodec_SOURCES) \ $(testimageattributes_SOURCES) $(testjpegcodec_SOURCES) \ $(testlineargradientbrush_SOURCES) $(testmatrix_SOURCES) \ $(testmetafile_SOURCES) $(testpathgradientbrush_SOURCES) \ $(testpen_SOURCES) $(testpng_SOURCES) $(testpngcodec_SOURCES) \ $(testregion_SOURCES) $(testreversepath_SOURCES) \ $(testsolidbrush_SOURCES) $(teststringformat_SOURCES) \ $(testtext_SOURCES) $(testtexturebrush_SOURCES) \ $(testtiffcodec_SOURCES) $(testwmfcodec_SOURCES) DIST_SOURCES = $(testadjustablearrowcap_SOURCES) $(testbitmap_SOURCES) \ $(testbits_SOURCES) $(testbmpcodec_SOURCES) \ $(testbrush_SOURCES) $(testclip_SOURCES) $(testcodecs_SOURCES) \ $(testcustomlinecap_SOURCES) $(testemfcodec_SOURCES) \ $(testfont_SOURCES) $(testgeneral_SOURCES) \ $(testgifcodec_SOURCES) $(testgpimage_SOURCES) \ $(testgraphics_SOURCES) $(testgraphicsdraw_SOURCES) \ $(testgraphicsfill_SOURCES) $(testgraphicspath_SOURCES) \ $(testhatchbrush_SOURCES) $(testicocodec_SOURCES) \ $(testimageattributes_SOURCES) $(testjpegcodec_SOURCES) \ $(testlineargradientbrush_SOURCES) $(testmatrix_SOURCES) \ $(testmetafile_SOURCES) $(testpathgradientbrush_SOURCES) \ $(testpen_SOURCES) $(testpng_SOURCES) $(testpngcodec_SOURCES) \ $(testregion_SOURCES) $(testreversepath_SOURCES) \ $(testsolidbrush_SOURCES) $(teststringformat_SOURCES) \ $(testtext_SOURCES) $(testtexturebrush_SOURCES) \ $(testtiffcodec_SOURCES) $(testwmfcodec_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_DEPENDENCIES_CFLAGS = @BASE_DEPENDENCIES_CFLAGS@ BASE_DEPENDENCIES_LIBS = @BASE_DEPENDENCIES_LIBS@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_CONFIG = @FONTCONFIG_CONFIG@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FREETYPE_CONFIG = @FREETYPE_CONFIG@ GDIPLUS_CFLAGS = @GDIPLUS_CFLAGS@ GDIPLUS_LIBS = @GDIPLUS_LIBS@ GDIPLUS_PKG_CFLAGS = @GDIPLUS_PKG_CFLAGS@ GDIPLUS_PKG_LIBS = @GDIPLUS_PKG_LIBS@ GDIPLUS_PKG_REQ = @GDIPLUS_PKG_REQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBEXIF_CFLAGS = @LIBEXIF_CFLAGS@ LIBEXIF_LIBS = @LIBEXIF_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = $(GDIPLUS_LIBS) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANGO_CFLAGS = @PANGO_CFLAGS@ PANGO_LIBS = @PANGO_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir)/src \ -I$(top_srcdir)/src \ $(GDIPLUS_CFLAGS) DEPS = \ $(top_builddir)/src/libgdiplus.la LDADDS = \ $(top_builddir)/src/libgdiplus.la \ -lm #if HAVE_X11 #noinst_PROGRAMS += testgdi # #testgdi_DEPENDENCIES = $(TEST_DEPS) #testgdi_LDADD = $(LDADDS) # #testgdi_SOURCES = \ # testgdi.c #endif HAVE_X11 testadjustablearrowcap_SOURCES = \ testadjustablearrowcap.c testadjustablearrowcap_DEPENDENCIES = $(TEST_DEPS) testadjustablearrowcap_LDADD = $(LDADDS) testbitmap_SOURCES = \ testbitmap.c testbitmap_DEPENDENCIES = $(TEST_DEPS) testbitmap_LDADD = $(LDADDS) testbits_DEPENDENCIES = $(TEST_DEPS) testbits_LDADD = $(LDADDS) testbits_SOURCES = \ testbits.c testbmpcodec_SOURCES = \ testbmpcodec.c testbmpcodec_DEPENDENCIES = $(TEST_DEPS) testbmpcodec_LDADD = $(LDADDS) testbrush_SOURCES = \ testbrush.c testbrush_DEPENDENCIES = $(TEST_DEPS) testbrush_LDADD = $(LDADDS) testclip_SOURCES = \ testclip.c testclip_DEPENDENCIES = $(TEST_DEPS) testclip_LDADD = $(LDADDS) testcodecs_SOURCES = \ testcodecs.c testcodecs_DEPENDENCIES = $(TEST_DEPS) testcodecs_LDADD = $(LDADDS) testcustomlinecap_SOURCES = \ testcustomlinecap.c testcustomlinecap_DEPENDENCIES = $(TEST_DEPS) testcustomlinecap_LDADD = $(LDADDS) testemfcodec_SOURCES = \ testemfcodec.c testemfcodec_DEPENDENCIES = $(TEST_DEPS) testemfcodec_LDADD = $(LDADDS) testfont_DEPENDENCIES = $(TEST_DEPS) testfont_LDADD = $(LDADDS) testfont_SOURCES = \ testfont.c testgeneral_SOURCES = \ testgeneral.c testgeneral_DEPENDENCIES = $(TEST_DEPS) testgeneral_LDADD = $(LDADDS) testgifcodec_SOURCES = \ testgifcodec.c testgifcodec_DEPENDENCIES = $(TEST_DEPS) testgifcodec_LDADD = $(LDADDS) testgpimage_SOURCES = \ testgpimage.c testgpimage_DEPENDENCIES = $(TEST_DEPS) testgpimage_LDADD = $(LDADDS) testgraphics_SOURCES = \ testgraphics.c testgraphics_DEPENDENCIES = $(TEST_DEPS) testgraphics_LDADD = $(LDADDS) testgraphicsdraw_SOURCES = \ testgraphicsdraw.c testgraphicsdraw_DEPENDENCIES = $(TEST_DEPS) testgraphicsdraw_LDADD = $(LDADDS) testgraphicsfill_SOURCES = \ testgraphicsfill.c testgraphicsfill_DEPENDENCIES = $(TEST_DEPS) testgraphicsfill_LDADD = $(LDADDS) testgraphicspath_SOURCES = \ testgraphicspath.c testgraphicspath_DEPENDENCIES = $(TEST_DEPS) testgraphicspath_LDADD = $(LDADDS) testhatchbrush_SOURCES = \ testhatchbrush.c testhatchbrush_DEPENDENCIES = $(TEST_DEPS) testhatchbrush_LDADD = $(LDADDS) testicocodec_SOURCES = \ testicocodec.c testicocodec_DEPENDENCIES = $(TEST_DEPS) testicocodec_LDADD = $(LDADDS) testimageattributes_SOURCES = \ testimageattributes.c testimageattributes_DEPENDENCIES = $(TEST_DEPS) testimageattributes_LDADD = $(LDADDS) testjpegcodec_SOURCES = \ testjpegcodec.c testjpegcodec_DEPENDENCIES = $(TEST_DEPS) testjpegcodec_LDADD = $(LDADDS) testlineargradientbrush_SOURCES = \ testlineargradientbrush.c testlineargradientbrush_DEPENDENCIES = $(TEST_DEPS) testlineargradientbrush_LDADD = $(LDADDS) testmatrix_SOURCES = \ testmatrix.c testmatrix_DEPENDENCIES = $(TEST_DEPS) testmatrix_LDADD = $(LDADDS) testmetafile_SOURCES = \ testmetafile.c testmetafile_DEPENDENCIES = $(TEST_DEPS) testmetafile_LDADD = $(LDADDS) testpngcodec_SOURCES = \ testpngcodec.c testpngcodec_DEPENDENCIES = $(TEST_DEPS) testpngcodec_LDADD = $(LDADDS) testregion_SOURCES = \ testregion.c testregion_DEPENDENCIES = $(TEST_DEPS) testregion_LDADD = $(LDADDS) testreversepath_SOURCES = \ testreversepath.c testreversepath_DEPENDENCIES = $(TEST_DEPS) testreversepath_LDADD = $(LDADDS) testsolidbrush_SOURCES = \ testsolidbrush.c testsolidbrush_DEPENDENCIES = $(TEST_DEPS) testsolidbrush_LDADD = $(LDADDS) teststringformat_SOURCES = \ teststringformat.c teststringformat_DEPENDENCIES = $(TEST_DEPS) teststringformat_LDADD = $(LDADDS) testtext_SOURCES = \ testtext.c testtext_DEPENDENCIES = $(TEST_DEPS) testtext_LDADD = $(LDADDS) testtexturebrush_SOURCES = \ testtexturebrush.c testtexturebrush_DEPENDENCIES = $(TEST_DEPS) testtexturebrush_LDADD = $(LDADDS) testpathgradientbrush_SOURCES = \ testpathgradientbrush.c testpathgradientbrush_DEPENDENCIES = $(TEST_DEPS) testpathgradientbrush_LDADD = $(LDADDS) testpen_SOURCES = \ testpen.c testpen_DEPENDENCIES = $(TEST_DEPS) testpen_LDADD = $(LDADDS) testpng_DEPENDENCIES = $(TEST_DEPS) testpng_LDADD = $(LDADDS) testpng_SOURCES = \ testpng.c testtiffcodec_SOURCES = \ testtiffcodec.c testtiffcodec_DEPENDENCIES = $(TEST_DEPS) testtiffcodec_LDADD = $(LDADDS) testwmfcodec_SOURCES = \ testwmfcodec.c testwmfcodec_DEPENDENCIES = $(TEST_DEPS) testwmfcodec_LDADD = $(LDADDS) # TESTS += testgdi EXTRA_DIST = \ AdobeRGB1998.icc \ test-gsa.png \ test-trns.png \ test.bmp \ test.emf \ test.gif \ test.ico \ test.jpg \ test.otf \ test.png \ test.tif \ test.ttf \ test.wmf \ testhelpers.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list testadjustablearrowcap$(EXEEXT): $(testadjustablearrowcap_OBJECTS) $(testadjustablearrowcap_DEPENDENCIES) $(EXTRA_testadjustablearrowcap_DEPENDENCIES) @rm -f testadjustablearrowcap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testadjustablearrowcap_OBJECTS) $(testadjustablearrowcap_LDADD) $(LIBS) testbitmap$(EXEEXT): $(testbitmap_OBJECTS) $(testbitmap_DEPENDENCIES) $(EXTRA_testbitmap_DEPENDENCIES) @rm -f testbitmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testbitmap_OBJECTS) $(testbitmap_LDADD) $(LIBS) testbits$(EXEEXT): $(testbits_OBJECTS) $(testbits_DEPENDENCIES) $(EXTRA_testbits_DEPENDENCIES) @rm -f testbits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testbits_OBJECTS) $(testbits_LDADD) $(LIBS) testbmpcodec$(EXEEXT): $(testbmpcodec_OBJECTS) $(testbmpcodec_DEPENDENCIES) $(EXTRA_testbmpcodec_DEPENDENCIES) @rm -f testbmpcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testbmpcodec_OBJECTS) $(testbmpcodec_LDADD) $(LIBS) testbrush$(EXEEXT): $(testbrush_OBJECTS) $(testbrush_DEPENDENCIES) $(EXTRA_testbrush_DEPENDENCIES) @rm -f testbrush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testbrush_OBJECTS) $(testbrush_LDADD) $(LIBS) testclip$(EXEEXT): $(testclip_OBJECTS) $(testclip_DEPENDENCIES) $(EXTRA_testclip_DEPENDENCIES) @rm -f testclip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testclip_OBJECTS) $(testclip_LDADD) $(LIBS) testcodecs$(EXEEXT): $(testcodecs_OBJECTS) $(testcodecs_DEPENDENCIES) $(EXTRA_testcodecs_DEPENDENCIES) @rm -f testcodecs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testcodecs_OBJECTS) $(testcodecs_LDADD) $(LIBS) testcustomlinecap$(EXEEXT): $(testcustomlinecap_OBJECTS) $(testcustomlinecap_DEPENDENCIES) $(EXTRA_testcustomlinecap_DEPENDENCIES) @rm -f testcustomlinecap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testcustomlinecap_OBJECTS) $(testcustomlinecap_LDADD) $(LIBS) testemfcodec$(EXEEXT): $(testemfcodec_OBJECTS) $(testemfcodec_DEPENDENCIES) $(EXTRA_testemfcodec_DEPENDENCIES) @rm -f testemfcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testemfcodec_OBJECTS) $(testemfcodec_LDADD) $(LIBS) testfont$(EXEEXT): $(testfont_OBJECTS) $(testfont_DEPENDENCIES) $(EXTRA_testfont_DEPENDENCIES) @rm -f testfont$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testfont_OBJECTS) $(testfont_LDADD) $(LIBS) testgeneral$(EXEEXT): $(testgeneral_OBJECTS) $(testgeneral_DEPENDENCIES) $(EXTRA_testgeneral_DEPENDENCIES) @rm -f testgeneral$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgeneral_OBJECTS) $(testgeneral_LDADD) $(LIBS) testgifcodec$(EXEEXT): $(testgifcodec_OBJECTS) $(testgifcodec_DEPENDENCIES) $(EXTRA_testgifcodec_DEPENDENCIES) @rm -f testgifcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgifcodec_OBJECTS) $(testgifcodec_LDADD) $(LIBS) testgpimage$(EXEEXT): $(testgpimage_OBJECTS) $(testgpimage_DEPENDENCIES) $(EXTRA_testgpimage_DEPENDENCIES) @rm -f testgpimage$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgpimage_OBJECTS) $(testgpimage_LDADD) $(LIBS) testgraphics$(EXEEXT): $(testgraphics_OBJECTS) $(testgraphics_DEPENDENCIES) $(EXTRA_testgraphics_DEPENDENCIES) @rm -f testgraphics$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgraphics_OBJECTS) $(testgraphics_LDADD) $(LIBS) testgraphicsdraw$(EXEEXT): $(testgraphicsdraw_OBJECTS) $(testgraphicsdraw_DEPENDENCIES) $(EXTRA_testgraphicsdraw_DEPENDENCIES) @rm -f testgraphicsdraw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgraphicsdraw_OBJECTS) $(testgraphicsdraw_LDADD) $(LIBS) testgraphicsfill$(EXEEXT): $(testgraphicsfill_OBJECTS) $(testgraphicsfill_DEPENDENCIES) $(EXTRA_testgraphicsfill_DEPENDENCIES) @rm -f testgraphicsfill$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgraphicsfill_OBJECTS) $(testgraphicsfill_LDADD) $(LIBS) testgraphicspath$(EXEEXT): $(testgraphicspath_OBJECTS) $(testgraphicspath_DEPENDENCIES) $(EXTRA_testgraphicspath_DEPENDENCIES) @rm -f testgraphicspath$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testgraphicspath_OBJECTS) $(testgraphicspath_LDADD) $(LIBS) testhatchbrush$(EXEEXT): $(testhatchbrush_OBJECTS) $(testhatchbrush_DEPENDENCIES) $(EXTRA_testhatchbrush_DEPENDENCIES) @rm -f testhatchbrush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testhatchbrush_OBJECTS) $(testhatchbrush_LDADD) $(LIBS) testicocodec$(EXEEXT): $(testicocodec_OBJECTS) $(testicocodec_DEPENDENCIES) $(EXTRA_testicocodec_DEPENDENCIES) @rm -f testicocodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testicocodec_OBJECTS) $(testicocodec_LDADD) $(LIBS) testimageattributes$(EXEEXT): $(testimageattributes_OBJECTS) $(testimageattributes_DEPENDENCIES) $(EXTRA_testimageattributes_DEPENDENCIES) @rm -f testimageattributes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testimageattributes_OBJECTS) $(testimageattributes_LDADD) $(LIBS) testjpegcodec$(EXEEXT): $(testjpegcodec_OBJECTS) $(testjpegcodec_DEPENDENCIES) $(EXTRA_testjpegcodec_DEPENDENCIES) @rm -f testjpegcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testjpegcodec_OBJECTS) $(testjpegcodec_LDADD) $(LIBS) testlineargradientbrush$(EXEEXT): $(testlineargradientbrush_OBJECTS) $(testlineargradientbrush_DEPENDENCIES) $(EXTRA_testlineargradientbrush_DEPENDENCIES) @rm -f testlineargradientbrush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testlineargradientbrush_OBJECTS) $(testlineargradientbrush_LDADD) $(LIBS) testmatrix$(EXEEXT): $(testmatrix_OBJECTS) $(testmatrix_DEPENDENCIES) $(EXTRA_testmatrix_DEPENDENCIES) @rm -f testmatrix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testmatrix_OBJECTS) $(testmatrix_LDADD) $(LIBS) testmetafile$(EXEEXT): $(testmetafile_OBJECTS) $(testmetafile_DEPENDENCIES) $(EXTRA_testmetafile_DEPENDENCIES) @rm -f testmetafile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testmetafile_OBJECTS) $(testmetafile_LDADD) $(LIBS) testpathgradientbrush$(EXEEXT): $(testpathgradientbrush_OBJECTS) $(testpathgradientbrush_DEPENDENCIES) $(EXTRA_testpathgradientbrush_DEPENDENCIES) @rm -f testpathgradientbrush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testpathgradientbrush_OBJECTS) $(testpathgradientbrush_LDADD) $(LIBS) testpen$(EXEEXT): $(testpen_OBJECTS) $(testpen_DEPENDENCIES) $(EXTRA_testpen_DEPENDENCIES) @rm -f testpen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testpen_OBJECTS) $(testpen_LDADD) $(LIBS) testpng$(EXEEXT): $(testpng_OBJECTS) $(testpng_DEPENDENCIES) $(EXTRA_testpng_DEPENDENCIES) @rm -f testpng$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testpng_OBJECTS) $(testpng_LDADD) $(LIBS) testpngcodec$(EXEEXT): $(testpngcodec_OBJECTS) $(testpngcodec_DEPENDENCIES) $(EXTRA_testpngcodec_DEPENDENCIES) @rm -f testpngcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testpngcodec_OBJECTS) $(testpngcodec_LDADD) $(LIBS) testregion$(EXEEXT): $(testregion_OBJECTS) $(testregion_DEPENDENCIES) $(EXTRA_testregion_DEPENDENCIES) @rm -f testregion$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testregion_OBJECTS) $(testregion_LDADD) $(LIBS) testreversepath$(EXEEXT): $(testreversepath_OBJECTS) $(testreversepath_DEPENDENCIES) $(EXTRA_testreversepath_DEPENDENCIES) @rm -f testreversepath$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testreversepath_OBJECTS) $(testreversepath_LDADD) $(LIBS) testsolidbrush$(EXEEXT): $(testsolidbrush_OBJECTS) $(testsolidbrush_DEPENDENCIES) $(EXTRA_testsolidbrush_DEPENDENCIES) @rm -f testsolidbrush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testsolidbrush_OBJECTS) $(testsolidbrush_LDADD) $(LIBS) teststringformat$(EXEEXT): $(teststringformat_OBJECTS) $(teststringformat_DEPENDENCIES) $(EXTRA_teststringformat_DEPENDENCIES) @rm -f teststringformat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(teststringformat_OBJECTS) $(teststringformat_LDADD) $(LIBS) testtext$(EXEEXT): $(testtext_OBJECTS) $(testtext_DEPENDENCIES) $(EXTRA_testtext_DEPENDENCIES) @rm -f testtext$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testtext_OBJECTS) $(testtext_LDADD) $(LIBS) testtexturebrush$(EXEEXT): $(testtexturebrush_OBJECTS) $(testtexturebrush_DEPENDENCIES) $(EXTRA_testtexturebrush_DEPENDENCIES) @rm -f testtexturebrush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testtexturebrush_OBJECTS) $(testtexturebrush_LDADD) $(LIBS) testtiffcodec$(EXEEXT): $(testtiffcodec_OBJECTS) $(testtiffcodec_DEPENDENCIES) $(EXTRA_testtiffcodec_DEPENDENCIES) @rm -f testtiffcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testtiffcodec_OBJECTS) $(testtiffcodec_LDADD) $(LIBS) testwmfcodec$(EXEEXT): $(testwmfcodec_OBJECTS) $(testwmfcodec_DEPENDENCIES) $(EXTRA_testwmfcodec_DEPENDENCIES) @rm -f testwmfcodec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testwmfcodec_OBJECTS) $(testwmfcodec_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testadjustablearrowcap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbitmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbmpcodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbrush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testclip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcodecs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcustomlinecap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testemfcodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testfont.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgeneral.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgifcodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgpimage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgraphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgraphicsdraw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgraphicsfill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgraphicspath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhatchbrush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testicocodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testimageattributes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testjpegcodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlineargradientbrush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmatrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmetafile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpathgradientbrush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpng.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpngcodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testregion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testreversepath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsolidbrush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/teststringformat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtexturebrush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtiffcodec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testwmfcodec.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? testadjustablearrowcap.log: testadjustablearrowcap$(EXEEXT) @p='testadjustablearrowcap$(EXEEXT)'; \ b='testadjustablearrowcap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testbitmap.log: testbitmap$(EXEEXT) @p='testbitmap$(EXEEXT)'; \ b='testbitmap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testbits.log: testbits$(EXEEXT) @p='testbits$(EXEEXT)'; \ b='testbits'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testbmpcodec.log: testbmpcodec$(EXEEXT) @p='testbmpcodec$(EXEEXT)'; \ b='testbmpcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testbrush.log: testbrush$(EXEEXT) @p='testbrush$(EXEEXT)'; \ b='testbrush'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testclip.log: testclip$(EXEEXT) @p='testclip$(EXEEXT)'; \ b='testclip'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testcodecs.log: testcodecs$(EXEEXT) @p='testcodecs$(EXEEXT)'; \ b='testcodecs'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testcustomlinecap.log: testcustomlinecap$(EXEEXT) @p='testcustomlinecap$(EXEEXT)'; \ b='testcustomlinecap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testemfcodec.log: testemfcodec$(EXEEXT) @p='testemfcodec$(EXEEXT)'; \ b='testemfcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testfont.log: testfont$(EXEEXT) @p='testfont$(EXEEXT)'; \ b='testfont'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgifcodec.log: testgifcodec$(EXEEXT) @p='testgifcodec$(EXEEXT)'; \ b='testgifcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgeneral.log: testgeneral$(EXEEXT) @p='testgeneral$(EXEEXT)'; \ b='testgeneral'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgpimage.log: testgpimage$(EXEEXT) @p='testgpimage$(EXEEXT)'; \ b='testgpimage'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgraphics.log: testgraphics$(EXEEXT) @p='testgraphics$(EXEEXT)'; \ b='testgraphics'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgraphicsdraw.log: testgraphicsdraw$(EXEEXT) @p='testgraphicsdraw$(EXEEXT)'; \ b='testgraphicsdraw'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgraphicsfill.log: testgraphicsfill$(EXEEXT) @p='testgraphicsfill$(EXEEXT)'; \ b='testgraphicsfill'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testgraphicspath.log: testgraphicspath$(EXEEXT) @p='testgraphicspath$(EXEEXT)'; \ b='testgraphicspath'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testhatchbrush.log: testhatchbrush$(EXEEXT) @p='testhatchbrush$(EXEEXT)'; \ b='testhatchbrush'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testicocodec.log: testicocodec$(EXEEXT) @p='testicocodec$(EXEEXT)'; \ b='testicocodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testimageattributes.log: testimageattributes$(EXEEXT) @p='testimageattributes$(EXEEXT)'; \ b='testimageattributes'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testjpegcodec.log: testjpegcodec$(EXEEXT) @p='testjpegcodec$(EXEEXT)'; \ b='testjpegcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testlineargradientbrush.log: testlineargradientbrush$(EXEEXT) @p='testlineargradientbrush$(EXEEXT)'; \ b='testlineargradientbrush'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testmatrix.log: testmatrix$(EXEEXT) @p='testmatrix$(EXEEXT)'; \ b='testmatrix'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testmetafile.log: testmetafile$(EXEEXT) @p='testmetafile$(EXEEXT)'; \ b='testmetafile'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testpathgradientbrush.log: testpathgradientbrush$(EXEEXT) @p='testpathgradientbrush$(EXEEXT)'; \ b='testpathgradientbrush'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testpen.log: testpen$(EXEEXT) @p='testpen$(EXEEXT)'; \ b='testpen'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testpng.log: testpng$(EXEEXT) @p='testpng$(EXEEXT)'; \ b='testpng'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testpngcodec.log: testpngcodec$(EXEEXT) @p='testpngcodec$(EXEEXT)'; \ b='testpngcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testregion.log: testregion$(EXEEXT) @p='testregion$(EXEEXT)'; \ b='testregion'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testreversepath.log: testreversepath$(EXEEXT) @p='testreversepath$(EXEEXT)'; \ b='testreversepath'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsolidbrush.log: testsolidbrush$(EXEEXT) @p='testsolidbrush$(EXEEXT)'; \ b='testsolidbrush'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) teststringformat.log: teststringformat$(EXEEXT) @p='teststringformat$(EXEEXT)'; \ b='teststringformat'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testtexturebrush.log: testtexturebrush$(EXEEXT) @p='testtexturebrush$(EXEEXT)'; \ b='testtexturebrush'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testtext.log: testtext$(EXEEXT) @p='testtext$(EXEEXT)'; \ b='testtext'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testtiffcodec.log: testtiffcodec$(EXEEXT) @p='testtiffcodec$(EXEEXT)'; \ b='testtiffcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testwmfcodec.log: testwmfcodec$(EXEEXT) @p='testwmfcodec$(EXEEXT)'; \ b='testwmfcodec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libgdiplus-6.0.4+dfsg/tests/testbitmap.c0000644000175000017500000007671613545154623021031 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include #include #include "testhelpers.h" static void test_createBitmapFromStream () { GpStatus status; GpBitmap *bitmap; // Negative tests. status = GdipCreateBitmapFromStream (NULL, &bitmap); assertEqualInt (status, InvalidParameter); #if !defined(USE_WINDOWS_GDIPLUS) int temp = 0; status = GdipCreateBitmapFromStream (&temp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromStream (&temp, &bitmap); assertEqualInt (status, NotImplemented); #endif } static void test_createBitmapFromFile () { GpStatus status; GpBitmap *bitmap; WCHAR *bitmapFile = createWchar ("test.png"); WCHAR *metafileFile = createWchar ("test.wmf"); WCHAR *enhancedMetafileFile = createWchar ("test.emf"); WCHAR *noSuchFile = createWchar ("noSuchFile.bmp"); WCHAR *invalidFile = createWchar ("test.ttf"); status = GdipCreateBitmapFromFile (bitmapFile, &bitmap); assertEqualInt (status, Ok); verifyBitmap ((GpImage *) bitmap, pngRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 5, TRUE); GdipDisposeImage ((GpImage *) bitmap); status = GdipCreateBitmapFromFile (metafileFile, &bitmap); assertEqualInt (status, Ok); verifyBitmap ((GpImage *) bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 770, 649, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage ((GpImage *) bitmap); status = GdipCreateBitmapFromFile (enhancedMetafileFile, &bitmap); assertEqualInt (status, Ok); verifyBitmap ((GpImage *) bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 100, 100, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage ((GpImage *) bitmap); // Negative tests. status = GdipCreateBitmapFromFile (NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromFile (noSuchFile, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromFile (invalidFile, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromFile (noSuchFile, NULL); assertEqualInt (status, InvalidParameter); freeWchar (bitmapFile); freeWchar (metafileFile); freeWchar (enhancedMetafileFile); freeWchar (noSuchFile); freeWchar (invalidFile); } static void test_createBitmapFromStreamICM () { GpStatus status; GpBitmap *bitmap; // Negative tests. status = GdipCreateBitmapFromStreamICM (NULL, &bitmap); assertEqualInt (status, InvalidParameter); #if !defined(USE_WINDOWS_GDIPLUS) int temp = 0; status = GdipCreateBitmapFromStreamICM (&temp, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromStreamICM (&temp, &bitmap); assertEqualInt (status, NotImplemented); #endif } static void test_createBitmapFromFileICM () { GpStatus status; GpBitmap *bitmap; WCHAR *bitmapFile = createWchar ("test.png"); WCHAR *metafileFile = createWchar ("test.wmf"); WCHAR *enhancedMetafileFile = createWchar ("test.emf"); WCHAR *noSuchFile = createWchar ("noSuchFile.bmp"); WCHAR *invalidFile = createWchar ("test.ttf"); status = GdipCreateBitmapFromFileICM (bitmapFile, &bitmap); assertEqualInt (status, Ok); verifyBitmap ((GpImage *) bitmap, pngRawFormat, PixelFormat24bppRGB, 100, 68, ImageFlagsColorSpaceRGB | ImageFlagsHasRealDPI | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly, 5, TRUE); GdipDisposeImage ((GpImage *) bitmap); status = GdipCreateBitmapFromFileICM (metafileFile, &bitmap); assertEqualInt (status, Ok); verifyBitmap ((GpImage *) bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 770, 649, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage ((GpImage *) bitmap); status = GdipCreateBitmapFromFileICM (enhancedMetafileFile, &bitmap); assertEqualInt (status, Ok); verifyBitmap ((GpImage *) bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 100, 100, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage ((GpImage *) bitmap); // Negative tests. status = GdipCreateBitmapFromFileICM (NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromFileICM (noSuchFile, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromFileICM (invalidFile, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromFileICM (noSuchFile, NULL); assertEqualInt (status, InvalidParameter); freeWchar (bitmapFile); freeWchar (metafileFile); freeWchar (enhancedMetafileFile); freeWchar (noSuchFile); freeWchar (invalidFile); } static void test_createBitmapFromScan0 () { GpStatus status; GpBitmap *bitmap; ARGB emptyPixelsWithAlpha[] = {0x00000000, 0x00000000,0x00000000}; ARGB emptyPixelsWithNoAlpha[] = {0xFF000000, 0xFF000000,0xFF000000}; // No scan0 - PixelFormat64bppARGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat64bppARGB, NULL, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat64bppARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithAlpha); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // Has scan0 - PixelFormat64bppARGB. BYTE bpp64ArgbData[] = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, }; status = GdipCreateBitmapFromScan0 (1, 2, 8, PixelFormat64bppARGB, bpp64ArgbData, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) // It appears that GDI+ ignores the data. ARGB bpp64ArgbPixels[] = { 0x00000000, 0x00000000, 0x00000000, }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat64bppARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp64ArgbPixels); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // No scan0 - PixelFormat64bppPARGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat64bppPARGB, NULL, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat64bppPARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithAlpha); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // Has scan0 - PixelFormat64bppPARGB. BYTE bpp64PArgbData[] = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, }; status = GdipCreateBitmapFromScan0 (1, 2, 8, PixelFormat64bppPARGB, bpp64PArgbData, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) // It appears that GDI+ ignores the data. ARGB bpp64PArgbPixels[] = { 0x00000000, 0x00000000, 0x00000000, }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat64bppPARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp64PArgbPixels); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // No scan0 - PixelFormat48bppRGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat48bppRGB, NULL, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat48bppRGB, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // Has scan0 - PixelFormat48bppRGB. BYTE bpp48RgbData[] = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, }; status = GdipCreateBitmapFromScan0 (1, 2, 8, PixelFormat48bppRGB, bpp48RgbData, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) // It appears that GDI+ ignores the data. ARGB bpp48RgbPixels[] = { 0xFF000000, 0xFF000000, 0xFF000000, }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat48bppRGB, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, bpp48RgbPixels); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // No scan0 - PixelFormat32bppARGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat32bppARGB, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat32bppARGB. BYTE bpp32ArgbData[] = { 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x80, 0x00, 0x00, 0xFF, 0x00 }; ARGB bpp32ArgbPixels[] = { 0xFF0000FF, 0x8000FF00, 0x00FF0000, }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat32bppARGB, bpp32ArgbData, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp32ArgbPixels); // Holds a reference to the original data. ARGB bpp32ArgbPixelsModified[] = { 0xFF000000, 0x8000FF00, 0x00FF0000 }; bpp32ArgbData[0] = 0x00; verifyPixels (bitmap, bpp32ArgbPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat32bppPARGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat32bppPARGB, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppPARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat32bppPARGB. BYTE bpp32PArgbData[] = { 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x80, 0x00, 0x00, 0xFF, 0x00 }; ARGB bpp32PArgbPixels[] = { 0xFF0000FF, 0x8000FF00, 0x00FF0000 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat32bppPARGB, bpp32PArgbData, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppPARGB, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp32PArgbPixels); // Holds a reference to the original data. ARGB bpp32PArgbPixelsModified[] = { 0xFF000000, 0x8000FF00, 0x00FF0000 }; bpp32PArgbData[0] = 0x00; verifyPixels (bitmap, bpp32PArgbPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat32bppRGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat32bppRGB, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppRGB, 1, 2, 0, 0, TRUE); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat32bppRGB. BYTE bpp32RgbData[] = { 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00 }; ARGB bpp32RgbPixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat32bppRGB, bpp32RgbData, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppRGB, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, bpp32RgbPixels); // Holds a reference to the original data. ARGB bpp32RgbPixelsModified[] = { 0xFF000000, 0xFF00FF00, 0xFFFF0000 }; bpp32RgbData[0] = 0x00; verifyPixels (bitmap, bpp32RgbPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat32bppCMYK. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat32bppCMYK, NULL, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppCMYK, 1, 2, 0, 0, TRUE); // Don't verify the image pixel data as a bug in GDI+ means that we read uninitialized memory. GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif BYTE bpp32CMYKData[] = { 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat32bppCMYK, bpp32CMYKData, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppCMYK, 1, 2, 0, 0, TRUE); // Don't verify the image pixel data as a bug in GDI+ means that we read uninitialized memory. GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // No scan0 - PixelFormat24bppRGB. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat24bppRGB, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat24bppRGB, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat24bppRGB. BYTE bpp24RgbData[] = { 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00 }; ARGB bpp24RgbPixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat24bppRGB, bpp24RgbData, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat24bppRGB, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, bpp24RgbPixels); // Holds a reference to the original data. ARGB bpp24RgbPixelsModified[] = { 0xFF000000, 0xFF00FF00, 0xFFFF0000 }; bpp24RgbData[0] = 0x00; verifyPixels (bitmap, bpp24RgbPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat16bppRGB555. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat16bppRGB555, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppRGB555, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat16bppRGB555. BYTE bpp16rgb555Data[] = { 0x1F, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00 }; ARGB bpp16rgb555Pixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat16bppRGB555, bpp16rgb555Data, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppRGB555, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, bpp16rgb555Pixels); // Holds a reference to the original data. ARGB bpp16rgb555PixelsModified[] = { 0xFF0000FF, 0xFF00FF00, 0xFF000000 }; bpp16rgb555Data[9] = 0x00; verifyPixels (bitmap, bpp16rgb555PixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat16bppRGB565. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat16bppRGB565, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppRGB565, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat16bppRGB565. BYTE bpp16rgb565Data[] = { 0x1F, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00 }; ARGB bpp16rgb565Pixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat16bppRGB565, bpp16rgb565Data, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppRGB565, 1, 2, 0, 0, TRUE); verifyPixels (bitmap, bpp16rgb565Pixels); // Holds a reference to the original data. ARGB bpp16rgb565PixelsModified[] = { 0xFF0000FF, 0xFF00FF00, 0xFF000000 }; bpp16rgb565Data[9] = 0x00; verifyPixels (bitmap, bpp16rgb565PixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat16bppARGB1555. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat16bppARGB1555, NULL, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppARGB1555, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithAlpha); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // Has scan0 - PixelFormat16bppARGB1555. BYTE bpp16argb555Data[] = { 0x1F, 0x80, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat16bppARGB1555, bpp16argb555Data, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) ARGB bpp16argb555Pixels[] = { 0xFF0000FF, 0x0000FF00, 0x00FF0000 }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppARGB1555, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp16argb555Pixels); // Holds a reference to the original data. ARGB bpp16argb555PixelsModified[] = { 0xFF0000FF, 0x0000FF00, 0x00000000 }; bpp16argb555Data[9] = 0x00; verifyPixels (bitmap, bpp16argb555PixelsModified); GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // No scan0 - PixelFormat16bppGrayScale. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat16bppGrayScale, NULL, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppGrayScale, 1, 2, 0, 0, TRUE); // Don't verify the image pixel data as a bug in GDI+ means that we read uninitialized memory. GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // Has scan0 - PixelFormat16bppGrayScale. BYTE bpp16grayscaleData[] = { 0x1F, 0x80, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat16bppGrayScale, bpp16grayscaleData, &bitmap); #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat16bppGrayScale, 1, 2, 0, 0, TRUE); // Don't verify the image pixel data as a bug in GDI+ means that we read uninitialized memory. GdipDisposeImage ((GpImage *) bitmap); #else assertEqualInt (status, NotImplemented); #endif // No scan0 - PixelFormat8bppIndexed. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat8bppIndexed, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat8bppIndexed, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat8bppIndexed. BYTE bpp8indexedData[] = { 0x0C, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat8bppIndexed, bpp8indexedData, &bitmap); ARGB bpp8indexedPixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000 }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat8bppIndexed, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp8indexedPixels); // Holds a reference to the original data. ARGB bpp8indexedPixelsModified[] = { 0xFFFF0000, 0xFF00FF00, 0xFFFF0000 }; bpp8indexedData[0] = 0x09; verifyPixels (bitmap, bpp8indexedPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat4bppIndexed. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat4bppIndexed, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat4bppIndexed, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat4bppIndexed. BYTE bpp4indexedData[] = { 0xC0, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat4bppIndexed, bpp4indexedData, &bitmap); ARGB bpp4indexedPixels[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000 }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat4bppIndexed, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp4indexedPixels); // Holds a reference to the original data. ARGB bpp4indexedPixelsModified[] = { 0xFFFF0000, 0xFF00FF00, 0xFFFF0000 }; bpp4indexedData[0] = 0x90; verifyPixels (bitmap, bpp4indexedPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // No scan0 - PixelFormat1bppIndexed. status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat1bppIndexed, NULL, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat1bppIndexed, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, emptyPixelsWithNoAlpha); GdipDisposeImage ((GpImage *) bitmap); // Has scan0 - PixelFormat1bppIndexed. BYTE bpp1indexedData[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00 }; status = GdipCreateBitmapFromScan0 (1, 2, 4, PixelFormat1bppIndexed, bpp1indexedData, &bitmap); ARGB bpp1indexedPixels[] = { 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF }; assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat1bppIndexed, 1, 2, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp1indexedPixels); // Holds a reference to the original data. ARGB bpp1indexedPixelsModified[] = { 0xFF000000, 0xFFFFFFFF, 0xFF000000 }; bpp1indexedData[8] = 0x00; verifyPixels (bitmap, bpp1indexedPixelsModified); GdipDisposeImage ((GpImage *) bitmap); // Negative tests. status = GdipCreateBitmapFromScan0 (0, 2, 0, PixelFormat32bppRGB, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (-1, 2, 0, PixelFormat32bppRGB, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 0, 0, PixelFormat32bppRGB, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, -1, 0, PixelFormat32bppRGB, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, -1, PixelFormat32bppRGB, bpp32RgbData, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormat32bppRGB, bpp32RgbData, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 3, PixelFormat32bppRGB, bpp32RgbData, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatIndexed, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatGDI, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatAlpha, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatPAlpha, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatExtended, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatCanonical, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromScan0 (1, 2, 0, PixelFormatUndefined, NULL, &bitmap); assertEqualInt (status, InvalidParameter); } static void test_createBitmapFromGraphics () { GpStatus status; GpBitmap *source; GpBitmap *sourceWithResolution; GpGraphics *graphics; GpGraphics *graphicsWithResolution; GpBitmap *bitmap; GpGraphics *bitmapGraphics; REAL dpiX; REAL dpiY; GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat24bppRGB, NULL, &source); GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat24bppRGB, NULL, &sourceWithResolution); GdipBitmapSetResolution (sourceWithResolution, 100, 124); GdipGetImageGraphicsContext ((GpImage *) source, &graphics); GdipGetImageGraphicsContext ((GpImage *) sourceWithResolution, &graphicsWithResolution); status = GdipCreateBitmapFromGraphics (24, 32, graphics, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppPARGB, 24, 32, ImageFlagsHasAlpha, 0, TRUE); GdipDisposeImage ((GpImage *) bitmap); status = GdipCreateBitmapFromGraphics (24, 32, graphicsWithResolution, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppPARGB, 24, 32, ImageFlagsHasAlpha, 0, TRUE); // Verify the DPI. GdipGetImageGraphicsContext ((GpImage *) bitmap, &bitmapGraphics); GdipGetDpiX (bitmapGraphics, &dpiX); GdipGetDpiY (bitmapGraphics, &dpiY); assertEqualFloat (dpiX, 100); assertEqualFloat (dpiY, 124); GdipDisposeImage ((GpImage *) bitmap); GdipDeleteGraphics (bitmapGraphics); // Negative tests. status = GdipCreateBitmapFromGraphics (0, 32, graphics, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromGraphics (-1, 32, graphics, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromGraphics (24, 0, graphics, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromGraphics (24, -1, graphics, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromGraphics (24, 32, NULL, &bitmap); assertEqualInt (status, InvalidParameter); status = GdipCreateBitmapFromGraphics (24, 32, graphics, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage ((GpImage *) source); GdipDisposeImage ((GpImage *) sourceWithResolution); GdipDeleteGraphics (graphics); GdipDeleteGraphics (graphicsWithResolution); } static void test_bitmapLockBits () { GpStatus status; GpBitmap *image; GpBitmap *indexedImage; BitmapData data; memset (&data, 0, sizeof (data)); GdipCreateBitmapFromScan0 (3, 4, 0, PixelFormat32bppRGB, NULL, &image); GdipCreateBitmapFromScan0 (3, 4, 0, PixelFormat32bppRGB, NULL, &indexedImage); // Negative tests. status = GdipBitmapLockBits (NULL, NULL, 0, PixelFormat32bppARGB, &data); assertEqualInt (status, InvalidParameter); Rect negativeX = {-1, 0, 3, 4}; status = GdipBitmapLockBits (image, &negativeX, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &negativeX, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect negativeY = {0, -1, 3, 4}; status = GdipBitmapLockBits (image, &negativeY, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &negativeY, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect negativeWidth = {0, 0, -1, 4}; status = GdipBitmapLockBits (image, &negativeWidth, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &negativeWidth, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect zeroWidth = {0, 0, 0, 4}; status = GdipBitmapLockBits (image, &zeroWidth, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &zeroWidth, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect largeWidth = {0, 0, 4, 4}; status = GdipBitmapLockBits (image, &largeWidth, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &largeWidth, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect negativeHeight = {0, 0, 3, -1}; status = GdipBitmapLockBits (image, &negativeHeight, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &negativeHeight, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect zeroHeight = {0, 0, 3, 0}; status = GdipBitmapLockBits (image, &zeroHeight, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &zeroHeight, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect largeHeight = {0, 0, 3, 5}; status = GdipBitmapLockBits (image, &largeHeight, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &largeHeight, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppCMYK, &data); assertEqualInt (status, InvalidParameter); Rect invalidXWidth = {2, 0, 2, 4}; status = GdipBitmapLockBits (image, &invalidXWidth, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &invalidXWidth, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); Rect invalidYHeight = {0, 2, 3, 3}; status = GdipBitmapLockBits (image, &invalidYHeight, 0, PixelFormat32bppRGB, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (indexedImage, &invalidYHeight, 0, PixelFormat8bppIndexed, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppCMYK, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatIndexed, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatGDI, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatAlpha, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatPAlpha, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatExtended, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatCanonical, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormatUndefined, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, -10, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppARGB, NULL); assertEqualInt (status, InvalidParameter); // Locked. status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppARGB, &data); assertEqualInt (status, Ok); status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppARGB, &data); assertEqualInt (status, WrongState); status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppARGB, NULL); assertEqualInt (status, InvalidParameter); status = GdipBitmapLockBits (image, NULL, 0, PixelFormat32bppCMYK, &data); assertEqualInt (status, WrongState); status = GdipBitmapLockBits (image, NULL, 0, -10, &data); assertEqualInt (status, WrongState); status = GdipBitmapUnlockBits (image, &data); assertEqualInt (status, Ok); GdipDisposeImage ((GpImage *) image); GdipDisposeImage ((GpImage *) indexedImage); } static void test_bitmapUnlockBits () { GpStatus status; GpBitmap *image; BYTE scan0[] = { 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x02, 0x03, 0x04, 0x7F, 0xFF, 0x00, 0x80, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0x80, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, }; BitmapData data; memset (&data, 0, sizeof (data)); GdipCreateBitmapFromScan0 (3, 4, 16, PixelFormat32bppARGB, scan0, &image); // Negative tests. status = GdipBitmapUnlockBits (NULL, &data); assertEqualInt (status, InvalidParameter); status = GdipBitmapUnlockBits (image, NULL); assertEqualInt (status, InvalidParameter); status = GdipBitmapUnlockBits (image, &data); assertEqualInt (status, Win32Error); GdipDisposeImage ((GpImage *) image); } int main(int argc, char**argv) { STARTUP; test_createBitmapFromStream (); test_createBitmapFromFile (); test_createBitmapFromStreamICM (); test_createBitmapFromFileICM (); test_createBitmapFromScan0 (); test_createBitmapFromGraphics (); test_bitmapLockBits (); test_bitmapUnlockBits (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testlineargradientbrush.c0000644000175000017500000017442213545154623023602 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void verifyLineGradientBrush (GpLineGradient *brush, REAL x, REAL y, REAL width, REAL height, ARGB startColor, ARGB endColor, GpWrapMode expectedWrapMode, REAL e1, REAL e2, REAL e3, REAL e4, REAL e5, REAL e6) { assert (brush && "Expected the brush to be initialized."); GpStatus status; GpBrushType brushType; GpRectF rect; GpWrapMode wrapMode; GpMatrix *brushTransform; ARGB colors[2]; GdipCreateMatrix (&brushTransform); status = GdipGetBrushType (brush, &brushType); assertEqualInt (brushType, BrushTypeLinearGradient); status = GdipGetLineRect (brush, &rect); assertEqualInt (status, Ok); assertEqualFloat (rect.X, x); assertEqualFloat (rect.Y, y); assertEqualFloat (rect.Width, width); assertEqualFloat (rect.Height, height); status = GdipGetLineColors (brush, colors); assertEqualInt (status, Ok); assertEqualInt (colors[0], startColor); assertEqualInt (colors[1], endColor); status = GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (status, Ok); assertEqualInt (wrapMode, expectedWrapMode); status = GdipGetLineTransform (brush, brushTransform); assertEqualInt (status, Ok); verifyMatrix (brushTransform, e1, e2, e3, e4, e5, e6); GdipDeleteMatrix (brushTransform); } static void test_createLineBrush () { GpStatus status; GpLineGradient *brush; GpPointF point1 = {1, 5}; GpPointF point2 = {2, 3}; GpPointF topLeft = {1, 2}; GpPointF topCenter = {3, 2}; GpPointF topRight = {5, 2}; GpPointF middleLeft = {1, 4}; GpPointF middleCenter = {3, 4}; GpPointF middleRight = {5, 4}; GpPointF bottomLeft = {1, 6}; GpPointF bottomCenter = {3, 6}; GpPointF bottomRight = {5, 6}; // WrapModeTile. status = GdipCreateLineBrush (&point1, &point2, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTile, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipX. status = GdipCreateLineBrush (&point1, &point2, 10, 11, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipX, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipY. status = GdipCreateLineBrush (&point1, &point2, 10, 11, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipY, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipXY status = GdipCreateLineBrush (&point1, &point2, 10, 11, WrapModeTileFlipXY, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipXY, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // Invalid WrapMode. status = GdipCreateLineBrush (&point1, &point2, 10, 11, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // point1.X > point2.X, point1.Y == point2.Y status = GdipCreateLineBrush (&middleCenter, &middleLeft, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 2, 2, 10, 11, WrapModeTile, -1, 0, 0, -1, 4, 8); GdipDeleteBrush ((GpBrush *) brush); // point1.X > point2.X, point1.Y > point2.Y status = GdipCreateLineBrush (&middleCenter, &topLeft, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 2, 2, 2, 10, 11, WrapModeTile, -1, -1, 1, -1, 1, 8); GdipDeleteBrush ((GpBrush *) brush); // point1.X == point2.X, point1.Y > point2.Y status = GdipCreateLineBrush (&middleCenter, &topCenter, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 2, 2, 2, 2, 10, 11, WrapModeTile, 0, -1, 1, 0, 0, 6); GdipDeleteBrush ((GpBrush *) brush); // point1.X < point2.X, point1.Y > point2.Y status = GdipCreateLineBrush (&middleCenter, &topRight, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 3, 2, 2, 2, 10, 11, WrapModeTile, 1, -1, 1, 1, -3, 4); GdipDeleteBrush ((GpBrush *) brush); // point1.X < point2.X, point1.Y == point2.Y status = GdipCreateLineBrush (&middleCenter, &middleRight, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 3, 3, 2, 2, 10, 11, WrapModeTile, 1, 0, 0, 1, 0, 0); GdipDeleteBrush ((GpBrush *) brush); // point1.X < point2.X, point1.Y < point2.Y status = GdipCreateLineBrush (&middleCenter, &bottomRight, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 3, 4, 2, 2, 10, 11, WrapModeTile, 1, 1, -1, 1, 5, -4); GdipDeleteBrush ((GpBrush *) brush); // point1.X == point2.X, point1.Y < point2.Y status = GdipCreateLineBrush (&middleCenter, &bottomCenter, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 2, 4, 2, 2, 10, 11, WrapModeTile, -0, 1, -1, -0, 8, 2); GdipDeleteBrush ((GpBrush *) brush); // point1.X > point2.X, point1.Y < point2.Y status = GdipCreateLineBrush (&middleCenter, &bottomLeft, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 4, 2, 2, 10, 11, WrapModeTile, -1, 1, -1, -1, 9, 8); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrush (NULL, &point2, 10, 11, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrush (&point1, NULL, 10, 11, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrush (&point1, &point2, 10, 11, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrush (&point1, &point2, 10, 11, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); } static void test_createLineBrushI () { GpStatus status; GpLineGradient *brush; GpPoint point1 = {1, 5}; GpPoint point2 = {2, 3}; GpPoint topLeft = {1, 2}; GpPoint topCenter = {3, 2}; GpPoint topRight = {5, 2}; GpPoint middleLeft = {1, 4}; GpPoint middleCenter = {3, 4}; GpPoint middleRight = {5, 4}; GpPoint bottomLeft = {1, 6}; GpPoint bottomCenter = {3, 6}; GpPoint bottomRight = {5, 6}; // WrapModeTile. status = GdipCreateLineBrushI (&point1, &point2, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTile, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipX. status = GdipCreateLineBrushI (&point1, &point2, 10, 11, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipX, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipY. status = GdipCreateLineBrushI (&point1, &point2, 10, 11, WrapModeTileFlipY, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipY, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // WrapModeTileFlipXY status = GdipCreateLineBrushI (&point1, &point2, 10, 11, WrapModeTileFlipXY, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipXY, 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // Invalid WrapMode. status = GdipCreateLineBrushI (&point1, &point2, 10, 11, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1, -2, 0.8f, 0.4f, -3.2f, 5.4f); GdipDeleteBrush ((GpBrush *) brush); // point1.X > point2.X, point1.Y == point2.Y status = GdipCreateLineBrushI (&middleCenter, &middleLeft, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 2, 2, 10, 11, WrapModeTile, -1, 0, 0, -1, 4, 8); GdipDeleteBrush ((GpBrush *) brush); // point1.X > point2.X, point1.Y > point2.Y status = GdipCreateLineBrushI (&middleCenter, &topLeft, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 2, 2, 2, 10, 11, WrapModeTile, -1, -1, 1, -1, 1, 8); GdipDeleteBrush ((GpBrush *) brush); // point1.X == point2.X, point1.Y > point2.Y status = GdipCreateLineBrushI (&middleCenter, &topCenter, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 2, 2, 2, 2, 10, 11, WrapModeTile, 0, -1, 1, 0, 0, 6); GdipDeleteBrush ((GpBrush *) brush); // point1.X < point2.X, point1.Y > point2.Y status = GdipCreateLineBrushI (&middleCenter, &topRight, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 3, 2, 2, 2, 10, 11, WrapModeTile, 1, -1, 1, 1, -3, 4); GdipDeleteBrush ((GpBrush *) brush); // point1.X < point2.X, point1.Y == point2.Y status = GdipCreateLineBrushI (&middleCenter, &middleRight, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 3, 3, 2, 2, 10, 11, WrapModeTile, 1, 0, 0, 1, 0, 0); GdipDeleteBrush ((GpBrush *) brush); // point1.X < point2.X, point1.Y < point2.Y status = GdipCreateLineBrushI (&middleCenter, &bottomRight, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 3, 4, 2, 2, 10, 11, WrapModeTile, 1, 1, -1, 1, 5, -4); GdipDeleteBrush ((GpBrush *) brush); // point1.X == point2.X, point1.Y < point2.Y status = GdipCreateLineBrushI (&middleCenter, &bottomCenter, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 2, 4, 2, 2, 10, 11, WrapModeTile, -0, 1, -1, -0, 8, 2); GdipDeleteBrush ((GpBrush *) brush); // point1.X > point2.X, point1.Y < point2.Y status = GdipCreateLineBrushI (&middleCenter, &bottomLeft, 10, 11, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 4, 2, 2, 10, 11, WrapModeTile, -1, 1, -1, -1, 9, 8); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushI (NULL, &point2, 10, 11, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushI (&point1, NULL, 10, 11, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushI (&point1, &point2, 10, 11, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushI (&point1, &point2, 10, 11, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); } static void test_createLineBrushFromRect () { GpStatus status; GpLineGradient *brush; GpRectF rect1 = { 1, 3, 1, 2 }; status = GdipCreateLineBrushFromRect (&rect1, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTile, 1, 0, 0, 1, 0, 0); GdipDeleteBrush ((GpBrush *) brush); GpRectF rect2 = { 1, 3, -1, -2 }; status = GdipCreateLineBrushFromRect (&rect2, 10, 11, LinearGradientModeBackwardDiagonal, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, -1, -2, 10, 11, (WrapMode)(WrapModeTile - 1), -1, 2, -0.5, -1, 2, 3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRect (&rect1, 10, 11, LinearGradientModeForwardDiagonal, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1, 2, -0.5, 1, 2, -3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRect (&rect1, 10, 11, LinearGradientModeVertical, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipX, 0, 2, -0.5, 0, 3.5, 1); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (NULL, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); GpRectF rect3 = { 1, 3, 0, 1 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect3, 10, 11, LinearGradientModeBackwardDiagonal, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); GpRectF rect4 = { 1, 3, 1, 0 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect4, 10, 11, LinearGradientModeBackwardDiagonal, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect1, 10, 11, (LinearGradientMode)(LinearGradientModeHorizontal - 1), WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect1, 10, 11, (LinearGradientMode)(LinearGradientModeBackwardDiagonal + 1), WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (NULL, 10, 11, (LinearGradientMode)(LinearGradientModeBackwardDiagonal + 1), WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect1, 10, 11, (LinearGradientMode)(LinearGradientModeBackwardDiagonal + 1), WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect1, 10, 11, LinearGradientModeHorizontal, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRect (&rect1, 10, 11, LinearGradientModeHorizontal, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); } static void test_createLineBrushFromRectI () { GpStatus status; GpLineGradient *brush; GpRect normalRect = { 1, 3, 1, 2 }; status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTile, 1, 0, 0, 1, 0, 0); GdipDeleteBrush ((GpBrush *) brush); GpRect negativeRect = { 1, 3, -1, -2 }; status = GdipCreateLineBrushFromRectI (&negativeRect, 10, 11, LinearGradientModeBackwardDiagonal, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, -1, -2, 10, 11, (WrapMode)(WrapModeTile - 1), -1, 2, -0.5, -1, 2, 3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, LinearGradientModeForwardDiagonal, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1, 2, -0.5, 1, 2, -3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, LinearGradientModeVertical, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipX, 0, 2, -0.5, 0, 3.5, 1); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (NULL, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); GpRect zeroWidth = { 1, 3, 0, 1 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&zeroWidth, 10, 11, LinearGradientModeBackwardDiagonal, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); GpRect zeroHeight = { 1, 3, 1, 0 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&zeroHeight, 10, 11, LinearGradientModeBackwardDiagonal, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, (LinearGradientMode)(LinearGradientModeHorizontal - 1), WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, (LinearGradientMode)(LinearGradientModeBackwardDiagonal + 1), WrapModeTile, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (NULL, 10, 11, (LinearGradientMode)(LinearGradientModeBackwardDiagonal + 1), WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, (LinearGradientMode)(LinearGradientModeBackwardDiagonal + 1), WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, LinearGradientModeHorizontal, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectI (&normalRect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); } static void test_createLineBrushFromRectWithAngle () { GpStatus status; GpLineGradient *brush; GpRectF rect1 = { 1, 3, 1, 2 }; status = GdipCreateLineBrushFromRectWithAngle (&rect1, 10, 11, 0, TRUE, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTile, 1, 0, 0, 1, 0, 0); GdipDeleteBrush ((GpBrush *) brush); GpRectF rect2 = { 1, 3, -1, -2 }; status = GdipCreateLineBrushFromRectWithAngle (&rect2, 10, 11, 135, TRUE, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, -1, -2, 10, 11, (WrapMode)(WrapModeTile - 1), -1, 2, -0.5, -1, 2, 3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngle (&rect2, 10, 11, -225, FALSE, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, -1, -2, 10, 11, (WrapMode)(WrapModeTile - 1), -1.500000, 1.500000, -0.750000, -0.750000, 2.750000, 2.750000); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngle (&rect1, 10, 11, 405, TRUE, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1, 2, -0.5, 1, 2, -3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngle (&rect1, 10, 11, 45, FALSE, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1.5, 1.5, -0.75, 0.75, 2.25, -1.25); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngle (&rect1, 10, 11, 90, TRUE, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipX, 0, 2, -0.5, 0, 3.5, 1); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngle (NULL, 10, 11, 90, TRUE, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); GpRectF rect3 = { 1, 3, 0, 1 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngle (&rect3, 10, 11, 90, TRUE, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); GpRectF rect4 = { 1, 3, 1, 0 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngle (&rect4, 10, 11, 90, TRUE, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngle (&rect1, 10, 11, 90, TRUE, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngle (&rect1, 10, 11, 90, TRUE, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); } static void test_createLineBrushFromRectWithAngleI () { GpStatus status; GpLineGradient *brush; GpRect rect1 = { 1, 3, 1, 2 }; status = GdipCreateLineBrushFromRectWithAngleI (&rect1, 10, 11, 0, TRUE, WrapModeTile, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTile, 1, 0, 0, 1, 0, 0); GdipDeleteBrush ((GpBrush *) brush); GpRect rect2 = { 1, 3, -1, -2 }; status = GdipCreateLineBrushFromRectWithAngleI (&rect2, 10, 11, 135, TRUE, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, -1, -2, 10, 11, (WrapMode)(WrapModeTile - 1), -1, 2, -0.5, -1, 2, 3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngleI (&rect2, 10, 11, -225, FALSE, (WrapMode)(WrapModeTile - 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, -1, -2, 10, 11, (WrapMode)(WrapModeTile - 1), -1.500000, 1.500000, -0.750000, -0.750000, 2.750000, 2.750000); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngleI (&rect1, 10, 11, 405, TRUE, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1, 2, -0.5, 1, 2, -3); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngleI (&rect1, 10, 11, 45, FALSE, (WrapMode)(WrapModeClamp + 1), &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, (WrapMode)(WrapModeClamp + 1), 1.5, 1.5, -0.75, 0.75, 2.25, -1.25); GdipDeleteBrush ((GpBrush *) brush); status = GdipCreateLineBrushFromRectWithAngleI (&rect1, 10, 11, 90, TRUE, WrapModeTileFlipX, &brush); assertEqualInt (status, Ok); verifyLineGradientBrush (brush, 1, 3, 1, 2, 10, 11, WrapModeTileFlipX, 0, 2, -0.5, 0, 3.5, 1); GdipDeleteBrush ((GpBrush *) brush); // Negative tests. brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngleI (NULL, 10, 11, 90, TRUE, WrapModeTile, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); GpRect rect3 = { 1, 3, 0, 1 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngleI (&rect3, 10, 11, 90, TRUE, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); GpRect rect4 = { 1, 3, 1, 0 }; brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngleI (&rect4, 10, 11, 90, TRUE, WrapModeTileFlipXY, &brush); assertEqualInt (status, OutOfMemory); assert (brush == NULL); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngleI (&rect1, 10, 11, 90, TRUE, WrapModeClamp, &brush); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); brush = (GpLineGradient *) 0xCC; status = GdipCreateLineBrushFromRectWithAngleI (&rect1, 10, 11, 90, TRUE, WrapModeTile, NULL); assertEqualInt (status, InvalidParameter); assert (brush == (GpLineGradient *) 0xCC); } static void test_setLineColors () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; ARGB colors[2]; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipSetLineColors (brush, 1, 2); assertEqualInt (status, Ok); GdipGetLineColors (brush, colors); assertEqualInt (colors[0], 1); assertEqualInt (colors[1], 2); // Negative tests. status = GdipSetLineColors (NULL, 1, 2); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineColors () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; ARGB colors[2]; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // Negative tests. status = GdipGetLineColors (NULL, colors); assertEqualInt (status, InvalidParameter); status = GdipGetLineColors (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineRect () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpRectF lineRect; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // Negative tests. status = GdipGetLineRect (NULL, &lineRect); assertEqualInt (status, InvalidParameter); status = GdipGetLineRect (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineRectI () { GpStatus status; GpLineGradient *brush; GpRect lineRect; // Whole numbers. GpRectF wholeNumbers = { 1, 3, 1, 2 }; GdipCreateLineBrushFromRect (&wholeNumbers, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLineRectI (brush, &lineRect); assertEqualInt (status, Ok); assertEqualInt (lineRect.X, 1); assertEqualInt (lineRect.Y, 3); assertEqualInt (lineRect.Width, 1); assertEqualInt (lineRect.Height, 2); GdipDeleteBrush ((GpBrush *) brush); // > 0.5 is rounded up. GpRectF greaterThanPointFive = { 1.6f, 3.6f, 1.6f, 2.6f }; GdipCreateLineBrushFromRect (&greaterThanPointFive, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLineRectI (brush, &lineRect); assertEqualInt (status, Ok); assertEqualInt (lineRect.X, 2); assertEqualInt (lineRect.Y, 4); assertEqualInt (lineRect.Width, 2); assertEqualInt (lineRect.Height, 3); GdipDeleteBrush ((GpBrush *) brush); // 0.5 is rounded up. GpRectF pointFive = { 1.5f, 3.5f, 1.5f, 2.5f }; GdipCreateLineBrushFromRect (&pointFive, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLineRectI (brush, &lineRect); assertEqualInt (status, Ok); assertEqualInt (lineRect.X, 2); assertEqualInt (lineRect.Y, 4); assertEqualInt (lineRect.Width, 2); assertEqualInt (lineRect.Height, 3); GdipDeleteBrush ((GpBrush *) brush); // < 0.5 is rounded down. GpRectF lessThanPointFive = { 1.1f, 3.1f, 1.1f, 2.1f }; GdipCreateLineBrushFromRect (&lessThanPointFive, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLineRectI (brush, &lineRect); assertEqualInt (status, Ok); assertEqualInt (lineRect.X, 1); assertEqualInt (lineRect.Y, 3); assertEqualInt (lineRect.Width, 1); assertEqualInt (lineRect.Height, 2); // Negative tests. status = GdipGetLineRectI (NULL, &lineRect); assertEqualInt (status, InvalidParameter); status = GdipGetLineRectI (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setLineGammaCorrection () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; BOOL useGammaCorrection; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // True. status = GdipSetLineGammaCorrection (brush, TRUE); assertEqualInt (status, Ok); GdipGetLineGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == TRUE); // Same. status = GdipSetLineGammaCorrection (brush, TRUE); assertEqualInt (status, Ok); GdipGetLineGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == TRUE); // False. status = GdipSetLineGammaCorrection (brush, FALSE); assertEqualInt (status, Ok); GdipGetLineGammaCorrection (brush, &useGammaCorrection); assert (useGammaCorrection == FALSE); // Negative tests. status = GdipSetLineGammaCorrection (NULL, TRUE); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineGammaCorrection () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; BOOL useGammaCorrection; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLineGammaCorrection (brush, &useGammaCorrection); assertEqualInt (status, Ok); assert (useGammaCorrection == FALSE); // Negative tests. status = GdipGetLineGammaCorrection (NULL, &useGammaCorrection); assertEqualInt (status, InvalidParameter); status = GdipGetLineGammaCorrection (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineBlendCount () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; INT blendCount; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLineBlendCount (brush, &blendCount); assertEqualInt (status, Ok); assertEqualInt (blendCount, 1); // Negative tests. status = GdipGetLineBlendCount (NULL, &blendCount); assertEqualInt (status, InvalidParameter); status = GdipGetLineBlendCount (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void fill_array (REAL *array, INT count, REAL value) { for (int i = 0; i < count; i++) array[i] = value; } static void test_getLineBlend () { GpStatus status; GpLineGradient *brush; REAL blend[3]; REAL positions[3]; GpRectF rect = { 1, 3, 1, 2 }; REAL threeBlends[3] = {1, 2, 3}; REAL threePositions[3] = {0, 0.5, 1}; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // Default blend - equal count. fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetLineBlend (brush, blend, positions, 1); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 123); assertEqualFloat (blend[2], 123); // Positions are meaningless for blends with a count of 1 so this parameter is ignored. assertEqualFloat (positions[0], 123); assertEqualFloat (positions[1], 123); assertEqualFloat (positions[2], 123); // Default blend - larger count. fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetLineBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 123); assertEqualFloat (blend[2], 123); // Positions are meaningless for blends with a count of 1 so this parameter is ignored. assertEqualFloat (positions[0], 123); assertEqualFloat (positions[1], 123); assertEqualFloat (positions[2], 123); // Negative tests. GdipSetLineBlend (brush, threeBlends, threePositions, 3); status = GdipGetLineBlend (brush, blend, positions, 1); assertEqualInt (status, InsufficientBuffer); status = GdipGetLineBlend (NULL, blend, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLineBlend (brush, NULL, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLineBlend (brush, blend, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLineBlend (brush, blend, positions, 0); assertEqualInt (status, InvalidParameter); status = GdipGetLineBlend (brush, blend, positions, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setLineBlend () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; REAL blend[3]= {1, 2, 3}; REAL positions[3] = {0, 0.5f, 1.0f}; REAL twoBlends[2] = {1, 2}; REAL twoPositions[2] = {0, 1}; REAL threeBlends[3] = {1, 2, 3}; REAL threePositions[3] = {0, 0.5, 1}; REAL oneBlend[1] = {10}; REAL onePosition[1] = {-12}; ARGB pathPresetBlend[3] = {1, 2, 3}; REAL pathPresetPositions[3] = {0, 0.5f, 1.0f}; INT presetBlendCount; REAL invalidPositions1[2] = {0.5, 1}; REAL invalidPositions2[2] = {0, 0.5}; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // Two blends - equal count. status = GdipSetLineBlend (brush, twoBlends, twoPositions, 2); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetLineBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 2); assertEqualFloat (blend[2], 123); assertEqualFloat (positions[0], 0); assertEqualFloat (positions[1], 1); assertEqualFloat (positions[2], 123); // Same. status = GdipSetLineBlend (brush, twoBlends, twoPositions, 2); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetLineBlend (brush, blend, positions, 2); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 2); assertEqualFloat (blend[2], 123); assertEqualFloat (positions[0], 0); assertEqualFloat (positions[1], 1); assertEqualFloat (positions[2], 123); // Three blends - equal count. status = GdipSetLineBlend (brush, threeBlends, threePositions, 3); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetLineBlend (brush, blend, positions, 3); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 1); assertEqualFloat (blend[1], 2); assertEqualFloat (blend[2], 3); assertEqualFloat (positions[0], 0); assertEqualFloat (positions[1], 0.5); assertEqualFloat (positions[2], 1); // One blend - equal count. status = GdipSetLineBlend (brush, oneBlend, onePosition, 1); assertEqualInt (status, Ok); fill_array (blend, ARRAY_SIZE (blend), 123); fill_array (positions, ARRAY_SIZE (positions), 123); status = GdipGetLineBlend (brush, blend, positions, 1); assertEqualInt (status, Ok); assertEqualFloat (blend[0], 10); assertEqualFloat (blend[1], 123); assertEqualFloat (blend[2], 123); assertEqualFloat (positions[0], 123); assertEqualFloat (positions[1], 123); assertEqualFloat (positions[2], 123); // Should clear the existing blend. status = GdipSetLinePresetBlend (brush, pathPresetBlend, pathPresetPositions, 3); assertEqualInt (status, Ok); status = GdipSetLineBlend (brush, threeBlends, threePositions, 3); assertEqualInt (status, Ok); status = GdipGetLinePresetBlendCount (brush, &presetBlendCount); assertEqualInt (status, Ok); assertEqualInt (presetBlendCount, 0); // Negative tests. status = GdipSetLineBlend (NULL, threeBlends, threePositions, 3); assertEqualInt (status, InvalidParameter); status = GdipSetLineBlend (brush, NULL, threePositions, 3); assertEqualInt (status, InvalidParameter); status = GdipSetLineBlend (brush, threeBlends, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipSetLineBlend (brush, twoBlends, invalidPositions1, 2); assertEqualInt (status, InvalidParameter); status = GdipSetLineBlend (brush, twoBlends, invalidPositions2, 2); assertEqualInt (status, InvalidParameter); status = GdipSetLineBlend (brush, threeBlends, threePositions, 0); assertEqualInt (status, InvalidParameter); status = GdipSetLineBlend (brush, threeBlends, threePositions, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLinePresetBlendCount () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; INT blendCount; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipGetLinePresetBlendCount (brush, &blendCount); assertEqualInt (status, Ok); assertEqualInt (blendCount, 0); // Negative tests. status = GdipGetLinePresetBlendCount (NULL, &blendCount); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlendCount (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLinePresetBlend () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; ARGB blend[2]; REAL positions[2]; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // Negative tests. status = GdipGetLinePresetBlend (brush, blend, positions, 2); assertEqualInt (status, GenericError); status = GdipGetLinePresetBlend (NULL, blend, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, NULL, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, blend, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, blend, positions, 1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, blend, positions, 0); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, blend, positions, -1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (NULL, blend, positions, -1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, NULL, positions, -1); assertEqualInt (status, InvalidParameter); status = GdipGetLinePresetBlend (brush, blend, NULL, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setLinePresetBlend () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; ARGB blend2[2] = { 1, 0 }; REAL positions2[2] = { 0, 1.0f }; ARGB destBlend2[2]; REAL destPositions2[2]; ARGB blend3[3] = { 1, 2, 3 }; REAL positions3[3] = { 0, 0.5f, 1.0f }; ARGB destBlend3[3]; REAL destPositions3[3]; #if !defined(USE_WINDOWS_GDIPLUS) REAL destBlendReal[2]; REAL destPositionsReal[2]; #endif REAL invalidPositions1[2] = { 0.5, 1 }; REAL invalidPositions2[2] = { 0, 0.5 }; REAL lineBlend[3] = { 1, 2, 3 }; REAL linePositions[3] = { 0, 2, 1 }; INT blendCount; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); // Count of 2. status = GdipSetLinePresetBlend (brush, blend2, positions2, 2); assertEqualInt (status, Ok); status = GdipGetLinePresetBlend (brush, destBlend2, destPositions2, 2); assertEqualInt (status, Ok); assertEqualInt (destBlend2[0], 1); assertEqualInt (destBlend2[1], 0); assertEqualFloat (destPositions2[0], 0); assertEqualFloat (destPositions2[1], 1); // Same. status = GdipSetLinePresetBlend (brush, blend2, positions2, 2); assertEqualInt (status, Ok); status = GdipGetLinePresetBlend (brush, destBlend2, destPositions2, 2); assertEqualInt (status, Ok); assertEqualInt (destBlend2[0], 1); assertEqualInt (destBlend2[1], 0); assertEqualFloat (destPositions2[0], 0); assertEqualFloat (destPositions2[1], 1); // Count of 3. status = GdipSetLinePresetBlend (brush, blend3, positions3, 3); assertEqualInt (status, Ok); status = GdipGetLinePresetBlend (brush, destBlend3, destPositions3, 3); assertEqualInt (status, Ok); assertEqualInt (destBlend3[0], 1); assertEqualInt (destBlend3[1], 2); assertEqualInt (destBlend3[2], 3); assertEqualFloat (destPositions3[0], 0); assertEqualFloat (destPositions3[1], 0.5); assertEqualFloat (destPositions3[2], 1); // Should clear the existing blend. status = GdipSetLineBlend (brush, lineBlend, linePositions, 3); assertEqualInt (status, Ok); status = GdipSetLinePresetBlend (brush, destBlend2, destPositions2, 2); assertEqualInt (status, Ok); status = GdipGetLineBlendCount (brush, &blendCount); assertEqualInt (status, Ok); // GDI+ has a bug where it sets the blend and positions to NULL but incorrectly // decrements blendCount, instead of setting it to zero. // This causes GDI+ to crash. This is a bug we don't want to replicate. #if !defined(USE_WINDOWS_GDIPLUS) assertEqualInt (blendCount, 0); status = GdipGetLineBlend(brush, destBlendReal, destPositionsReal, blendCount); assertEqualInt(status, InvalidParameter); #endif // Negative tests. status = GdipSetLinePresetBlend (NULL, blend3, positions3, 3); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, NULL, positions3, 3); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, blend3, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, blend2, invalidPositions1, 2); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, blend2, invalidPositions2, 2); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, blend3, positions3, 1); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, blend3, positions3, 0); assertEqualInt (status, InvalidParameter); status = GdipSetLinePresetBlend (brush, blend3, positions3, -1); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setLineSigmaBlend () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipSetLineSigmaBlend (brush, 0, 0.5f); assertEqualInt (status, Ok); status = GdipSetLineSigmaBlend (brush, 0.5f, 1); assertEqualInt (status, Ok); status = GdipSetLineSigmaBlend (brush, 1, 0); assertEqualInt (status, Ok); // Negative tests. status = GdipSetLineSigmaBlend (NULL, 0.5f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetLineSigmaBlend (brush, -0.01f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetLineSigmaBlend (brush, 1.01f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetLineSigmaBlend (brush, 0.5f, -0.01f); assertEqualInt (status, InvalidParameter); status = GdipSetLineSigmaBlend (brush, 0.5f, 1.01f); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setLineLinearBlend () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTile, &brush); status = GdipSetLineLinearBlend (brush, 0, 0.5f); assertEqualInt (status, Ok); status = GdipSetLineLinearBlend (brush, 0.5f, 1); assertEqualInt (status, Ok); status = GdipSetLineLinearBlend (brush, 1, 0); assertEqualInt (status, Ok); // Negative tests. status = GdipSetLineLinearBlend (NULL, 0.5f, 0.5f); assertEqualInt (status, InvalidParameter); status = GdipSetLineLinearBlend (brush, -0.01f, 0.5); assertEqualInt (status, InvalidParameter); status = GdipSetLineLinearBlend (brush, 1.01f, 0.5); assertEqualInt (status, InvalidParameter); status = GdipSetLineLinearBlend (brush, 0.5f, -0.01f); assertEqualInt (status, InvalidParameter); status = GdipSetLineLinearBlend (brush, 0.5f, 1.01f); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_setLineWrapMode () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpWrapMode wrapMode; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); // WrapModeTile. status = GdipSetLineWrapMode (brush, WrapModeTile); assertEqualInt (status, Ok); GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTile); // Same. status = GdipSetLineWrapMode (brush, WrapModeTile); assertEqualInt (status, Ok); GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTile); // WrapModeTileFlipX. status = GdipSetLineWrapMode (brush, WrapModeTileFlipX); assertEqualInt (status, Ok); GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipX); // WrapModeTileFlipY. status = GdipSetLineWrapMode (brush, WrapModeTileFlipY); assertEqualInt (status, Ok); GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipY); // WrapModeTileFlipXY. status = GdipSetLineWrapMode (brush, WrapModeTileFlipXY); assertEqualInt (status, Ok); GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipXY); // Invalid WrapMode - nop. status = GdipSetLineWrapMode (brush, (WrapMode)(WrapModeClamp + 1)); assertEqualInt (status, Ok); GdipGetLineWrapMode (brush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipXY); // Negative tests. status = GdipSetLineWrapMode (NULL, WrapModeTile); assertEqualInt (status, InvalidParameter); status = GdipSetLineWrapMode (brush, WrapModeClamp); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineWrapMode () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpWrapMode wrapMode; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); // Negative tests. status = GdipGetLineWrapMode (NULL, &wrapMode); assertEqualInt (status, InvalidParameter); status = GdipGetLineWrapMode (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); } static void test_getLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *transform; ARGB blend[2] = {1, 0}; REAL positions[2] = {0, 1.0f}; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix (&transform); // With no preset blend. status = GdipGetLineTransform (brush, transform); assertEqualInt (status, Ok); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // With preset blend. GdipSetLinePresetBlend (brush, blend, positions, 2); status = GdipGetLineTransform (brush, transform); assertEqualInt (status, Ok); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // Negative tests. status = GdipGetLineTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipGetLineTransform (brush, NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (transform); } static void test_setLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; ARGB blend[2] = {1, 0}; REAL positions[2] = {0, 1.0f}; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); // With no preset blend. status = GdipSetLineTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Same. status = GdipSetLineTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // Changing the original transform should not modify the brush's transform. GdipSetMatrixElements (matrix, 2, 3, 4, 5, 6, 7); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 5, 6); // With preset blend. GdipSetLinePresetBlend (brush, blend, positions, 2); status = GdipSetLineTransform (brush, matrix); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); assert (transform != matrix && "Expected new matrix to be a clone."); verifyMatrix (transform, 2, 3, 4, 5, 6, 7); // Negative tests. status = GdipSetLineTransform (NULL, transform); assertEqualInt (status, InvalidParameter); status = GdipSetLineTransform (brush, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetLineTransform (brush, nonInvertibleMatrix); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDeleteMatrix (transform); } static void test_resetLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *matrix; GpMatrix *transform; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &matrix); GdipCreateMatrix (&transform); GdipSetLineTransform (brush, matrix); status = GdipResetLineTransform (brush); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 1, 0, 0, 1, 0, 0); // Negative tests. status = GdipResetLineTransform (NULL); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (matrix); } static void test_multiplyLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *originalTransform; GpMatrix *matrix; GpMatrix *nonInvertibleMatrix; GpMatrix *transform; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix2 (2, 3, 4, 5, 6, 7, &matrix); GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetLineTransform (brush, originalTransform); status = GdipMultiplyLineTransform (brush, matrix, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // MatrixOrderPrepend. GdipSetLineTransform (brush, originalTransform); status = GdipMultiplyLineTransform (brush, matrix, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Null matrix - nop. status = GdipMultiplyLineTransform (brush, NULL, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 11, 16, 19, 28, 32, 46); // Invalid MatrixOrder - negative. GdipSetLineTransform (brush, originalTransform); status = GdipMultiplyLineTransform (brush, matrix, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Invalid MatrixOrder - positive. GdipSetLineTransform (brush, originalTransform); status = GdipMultiplyLineTransform (brush, matrix, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 10, 13, 22, 29, 40, 52); // Negative tests. status = GdipMultiplyLineTransform (NULL, matrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipMultiplyLineTransform (brush, nonInvertibleMatrix, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (matrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDeleteMatrix (transform); } static void test_translateLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *originalTransform; GpMatrix *transform; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetLineTransform (brush, originalTransform); status = GdipTranslateLineTransform (brush, 5, 6, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 10, 12); // MatrixOrderPrepend. GdipSetLineTransform (brush, originalTransform); status = GdipTranslateLineTransform (brush, 5, 6, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 1, 2, 3, 4, 28, 40); // Negative tests. status = GdipTranslateLineTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipTranslateLineTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipTranslateLineTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_scaleLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *originalTransform; GpMatrix *transform; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetLineTransform (brush, originalTransform); status = GdipScaleLineTransform (brush, 0.5, 0.75, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 0.5, 1.5, 1.5, 3, 2.5, 4.5); // MatrixOrderPrepend. GdipSetLineTransform (brush, originalTransform); status = GdipScaleLineTransform (brush, 0.5, 0.75, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 0.5, 1, 2.25, 3, 5, 6); // Negative tests. status = GdipScaleLineTransform (NULL, 1, 1, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipScaleLineTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipScaleLineTransform (brush, 1, 1, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_rotateLineTransform () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpMatrix *originalTransform; GpMatrix *transform; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &originalTransform); GdipCreateMatrix (&transform); // MatrixOrderAppend. GdipSetLineTransform (brush, originalTransform); status = GdipRotateLineTransform (brush, 90, MatrixOrderAppend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, -2, 1, -4, 3, -6, 5); // MatrixOrderPrepend. GdipSetLineTransform (brush, originalTransform); status = GdipRotateLineTransform (brush, 90, MatrixOrderPrepend); assertEqualInt (status, Ok); GdipGetLineTransform (brush, transform); verifyMatrix (transform, 3, 4, -1, -2, 5, 6); // Negative tests. status = GdipRotateLineTransform (NULL, 90, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipRotateLineTransform (brush, 90, (MatrixOrder)(MatrixOrderPrepend - 1)); assertEqualInt (status, InvalidParameter); status = GdipRotateLineTransform (brush, 90, (MatrixOrder)(MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteMatrix (originalTransform); GdipDeleteMatrix (transform); } static void test_clone () { GpStatus status; GpLineGradient *brush; GpRectF rect = { 1, 3, 1, 2 }; GpBrush *clonedBrush; GpBrushType brushType; GpWrapMode wrapMode; ARGB colors[2]; REAL blend[2] = { 1, 2 }; REAL positions[2] = { 0, 1 }; INT blendCount; REAL blendResult[2]; REAL positionsResult[2]; GpMatrix *transform; GpMatrix *matrix; BOOL useGammaCorrection; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); GdipSetLineBlend (brush, blend, positions, 2); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); GdipCreateMatrix (&matrix); GdipSetLineTransform (brush, transform); GdipSetLineGammaCorrection (brush, TRUE); status = GdipCloneBrush ((GpBrush *) brush, &clonedBrush); assertEqualInt (status, Ok); assert (clonedBrush && clonedBrush != brush); GdipGetBrushType (clonedBrush, &brushType); assertEqualInt (brushType, BrushTypeLinearGradient); GdipGetLineWrapMode ((GpLineGradient *) clonedBrush, &wrapMode); assertEqualInt (wrapMode, WrapModeTileFlipY); GdipGetLineColors (brush, colors); assertEqualInt (colors[0], 10); assertEqualInt (colors[1], 11); GdipGetLineRect ((GpLineGradient *) clonedBrush, &rect); assertEqualFloat (rect.X, 1); assertEqualFloat (rect.Y, 3); assertEqualFloat (rect.Width, 1); assertEqualFloat (rect.Height, 2); GdipGetLineBlendCount ((GpLineGradient *) clonedBrush, &blendCount); assertEqualInt (blendCount, 2); GdipGetLineBlend ((GpLineGradient *) clonedBrush, blendResult, positionsResult, 2); assertEqualFloat (blendResult[0], 1); assertEqualFloat (blendResult[1], 2); assertEqualFloat (positionsResult[0], 0); assertEqualFloat (positionsResult[1], 1); GdipGetLineTransform ((GpLineGradient *) clonedBrush, matrix); verifyMatrix (matrix, 1, 2, 3, 4, 5, 6); GdipGetLineGammaCorrection ((GpLineGradient *) clonedBrush, &useGammaCorrection); assert (useGammaCorrection == TRUE); GdipDeleteBrush ((GpBrush *) brush); GdipDeleteBrush ((GpBrush *) clonedBrush); GdipDeleteMatrix (transform); GdipDeleteMatrix (matrix); } static void test_delete () { GpStatus status; GpRectF rect = { 1, 3, 1, 2 }; GpLineGradient *brush; GdipCreateLineBrushFromRect (&rect, 10, 11, LinearGradientModeHorizontal, WrapModeTileFlipY, &brush); status = GdipDeleteBrush ((GpBrush *) brush); assertEqualInt (status, Ok); } int main (int argc, char**argv) { STARTUP; test_createLineBrush (); test_createLineBrushI (); test_createLineBrushFromRect (); test_createLineBrushFromRectI (); test_createLineBrushFromRectWithAngle (); test_createLineBrushFromRectWithAngleI (); test_setLineColors (); test_getLineColors (); test_getLineRect (); test_getLineRectI (); test_setLineGammaCorrection (); test_getLineGammaCorrection (); test_getLineBlendCount (); test_getLineBlend (); test_setLineBlend (); test_getLinePresetBlendCount (); test_getLinePresetBlend (); test_setLinePresetBlend (); test_setLineSigmaBlend (); test_setLineLinearBlend (); test_setLineWrapMode (); test_getLineWrapMode (); test_getLineTransform (); test_setLineTransform (); test_resetLineTransform (); test_multiplyLineTransform (); test_translateLineTransform (); test_scaleLineTransform (); test_rotateLineTransform (); test_clone (); test_delete (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testgraphics.c0000644000175000017500000032356213545154626021352 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static GpGraphics *getImageGraphics (GpImage **image) { GpStatus status; WCHAR *filePath; GpGraphics *graphics; filePath = createWchar ("test.bmp"); status = GdipLoadImageFromFile (filePath, image); assertEqualInt (status, Ok); freeWchar (filePath); status = GdipGetImageGraphicsContext (*image, &graphics); assertEqualInt (status, Ok); return graphics; } #if defined(USE_WINDOWS_GDIPLUS) HWND hwnd; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } #endif static void test_createFromHDC() { GpStatus status; GpImage *image; GpGraphics *graphicsOriginal; HDC hdc; GpGraphics *graphics; TextRenderingHint textRenderingHint; graphicsOriginal = getImageGraphics (&image); status = GdipSetTextRenderingHint (graphicsOriginal, TextRenderingHintClearTypeGridFit); assertEqualInt (status, Ok); status = GdipGetDC (graphicsOriginal, &hdc); assertEqualInt (status, Ok); status = GdipCreateFromHDC (hdc, &graphics); assertEqualInt (status, Ok); assert (graphics != NULL); // The graphics from the HDC should not have the same values as the original graphics. status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintSystemDefault); // Modifying the graphics from the HDC should not modify the original graphics. status = GdipSetTextRenderingHint (graphics, TextRenderingHintSingleBitPerPixelGridFit); assertEqualInt (status, Ok); GdipReleaseDC (graphicsOriginal, hdc); status = GdipGetTextRenderingHint (graphicsOriginal, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintClearTypeGridFit); #if defined(USE_WINDOWS_GDIPLUS) { HDC hdc; INT x; INT y; // Window DC. hdc = GetDC (hwnd); SetViewportOrgEx (hdc, 10, 20, NULL); SetWindowOrgEx (hdc, 30, 40, NULL); status = GdipCreateFromHDC (hdc, &graphics); assertEqualInt (status, Ok); GdipGetRenderingOrigin (graphics, &x, &y); assertEqualInt (10, x); assertEqualInt (20, y); ReleaseDC (hwnd, hdc); } #endif // Negative tests. status = GdipCreateFromHDC (0, &graphics); assertEqualInt (status, OutOfMemory); status = GdipCreateFromHDC (0, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); GdipDeleteGraphics (graphicsOriginal); GdipDeleteGraphics (graphics); } static void test_createFromHDC2() { GpStatus status; GpImage *image; GpGraphics *graphicsOriginal; HDC hdc; GpGraphics *graphics; TextRenderingHint textRenderingHint; graphicsOriginal = getImageGraphics (&image); status = GdipSetTextRenderingHint (graphicsOriginal, TextRenderingHintClearTypeGridFit); assertEqualInt (status, Ok); status = GdipGetDC (graphicsOriginal, &hdc); assertEqualInt (status, Ok); status = GdipCreateFromHDC2 (hdc, NULL, &graphics); assertEqualInt (status, Ok); assert (graphics != NULL); // The graphics from the HDC should not have the same values as the original graphics. status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintSystemDefault); // Modifying the graphics from the HDC should not modify the original graphics. status = GdipSetTextRenderingHint (graphics, TextRenderingHintSingleBitPerPixelGridFit); assertEqualInt (status, Ok); GdipReleaseDC (graphicsOriginal, hdc); status = GdipGetTextRenderingHint (graphicsOriginal, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintClearTypeGridFit); #if defined(USE_WINDOWS_GDIPLUS) { HDC hdc; INT x; INT y; // Window DC. hdc = GetDC (hwnd); SetViewportOrgEx (hdc, 10, 20, NULL); SetWindowOrgEx (hdc, 30, 40, NULL); status = GdipCreateFromHDC2 (hdc, NULL, &graphics); assertEqualInt (status, Ok); GdipGetRenderingOrigin (graphics, &x, &y); assertEqualInt (10, x); assertEqualInt (20, y); ReleaseDC (hwnd, hdc); } #endif // Negative tests. status = GdipCreateFromHDC2 (0, NULL, &graphics); assertEqualInt (status, OutOfMemory); status = GdipCreateFromHDC2 (0, NULL, NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); GdipDeleteGraphics (graphicsOriginal); GdipDeleteGraphics (graphics); } static void test_createFromHWND() { GpStatus status; GpGraphics *graphics; #if defined(USE_WINDOWS_GDIPLUS) GpRectF bounds; #endif status = GdipCreateFromHWND (0, NULL); assertEqualInt (status, InvalidParameter); // Libgdiplus does not implement GdipCreateFromHwnd. #if defined(USE_WINDOWS_GDIPLUS) // HWND of zero means the current screen. status = GdipCreateFromHWND (0, &graphics); assertEqualInt (status, Ok); assert (graphics != NULL); GdipDeleteGraphics (graphics); status = GdipCreateFromHWND (hwnd, &graphics); assertEqualInt (status, Ok); assert (graphics != NULL); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 484); assertEqualFloat (bounds.Height, 61); GdipDeleteGraphics (graphics); #else status = GdipCreateFromHWND (0, &graphics); assertEqualInt (status, NotImplemented); #endif } static void test_createFromHWNDICM() { GpStatus status; GpGraphics *graphics; status = GdipCreateFromHWNDICM (0, NULL); assertEqualInt (status, InvalidParameter); // Libgdiplus does not implement GdipCreateFromHwndICM. #if defined(USE_WINDOWS_GDIPLUS) // HWND of zero means the current screen. status = GdipCreateFromHWNDICM (0, &graphics); assertEqualInt (status, Ok); assert (graphics != NULL); status = GdipCreateFromHWNDICM (hwnd, &graphics); assertEqualInt (status, Ok); assert (graphics != NULL); GdipDeleteGraphics (graphics); #else status = GdipCreateFromHWNDICM (0, &graphics); assertEqualInt (status, NotImplemented); #endif } static void test_hdc () { GpStatus status; GpImage *image; GpGraphics *graphics; HDC hdc; graphics = getImageGraphics (&image); // Negative tests. status = GdipGetDC (NULL, &hdc); assertEqualInt (status, InvalidParameter); status = GdipGetDC (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetDC (graphics, &hdc); assertEqualInt (status, Ok); assert (hdc != 0); status = GdipGetDC (graphics, &hdc); assertEqualInt (status, ObjectBusy); status = GdipGetDC (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipReleaseDC (NULL, hdc); assertEqualInt (status, InvalidParameter); status = GdipReleaseDC (NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipReleaseDC (graphics, 0); assertEqualInt (status, InvalidParameter); status = GdipReleaseDC (graphics, hdc); assertEqualInt (status, Ok); status = GdipReleaseDC (graphics, hdc); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_compositingMode () { GpStatus status; GpImage *image; GpGraphics *graphics; CompositingMode mode; graphics = getImageGraphics (&image); // Default get. status = GdipGetCompositingMode(graphics, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, CompositingModeSourceOver); // CompositingModeSourceOver. status = GdipSetCompositingMode (graphics, CompositingModeSourceOver); assertEqualInt (status, Ok); status = GdipGetCompositingMode(graphics, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, CompositingModeSourceOver); // CompositingModeSourceOver. status = GdipSetCompositingMode (graphics, CompositingModeSourceCopy); assertEqualInt (status, Ok); status = GdipGetCompositingMode(graphics, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, CompositingModeSourceCopy); // Invalid CompositingMode. status = GdipSetCompositingMode (graphics, (CompositingMode) (CompositingModeSourceCopy + 1)); assertEqualInt (status, Ok); status = GdipGetCompositingMode(graphics, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, (CompositingMode) (CompositingModeSourceCopy + 1)); // Invalid CompositingMode. status = GdipSetCompositingMode (graphics, (CompositingMode) (CompositingModeSourceOver - 1)); assertEqualInt (status, Ok); status = GdipGetCompositingMode(graphics, &mode); assertEqualInt (status, Ok); assertEqualInt (mode, (CompositingMode) (CompositingModeSourceOver - 1)); // Negative tests. status = GdipSetCompositingMode (NULL, CompositingModeSourceCopy); assertEqualInt (status, InvalidParameter); status = GdipGetCompositingMode (NULL, &mode); assertEqualInt (status, InvalidParameter); status = GdipGetCompositingMode (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetCompositingMode (graphics, &mode); assertEqualInt (status, ObjectBusy); status = GdipGetCompositingMode (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetCompositingMode (graphics, CompositingModeSourceCopy); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_compositingQuality () { GpStatus status; GpImage *image; GpGraphics *graphics; CompositingQuality quality; graphics = getImageGraphics (&image); // Default get. status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityDefault); // CompositingQualityInvalid. status = GdipSetCompositingQuality (graphics, CompositingQualityInvalid); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityInvalid); // CompositingQualityDefault. status = GdipSetCompositingQuality (graphics, CompositingQualityDefault); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityDefault); // CompositingQualityHighSpeed. status = GdipSetCompositingQuality (graphics, CompositingQualityHighSpeed); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityHighSpeed); // CompositingQualityHighQuality. status = GdipSetCompositingQuality (graphics, CompositingQualityHighQuality); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityHighQuality); // CompositingQualityGammaCorrected. status = GdipSetCompositingQuality (graphics, CompositingQualityGammaCorrected); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityGammaCorrected); // CompositingQualityAssumeLinear. status = GdipSetCompositingQuality (graphics, CompositingQualityAssumeLinear); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, CompositingQualityAssumeLinear); // Invalid CompositingQuality. status = GdipSetCompositingQuality (graphics, (CompositingQuality) (CompositingQualityAssumeLinear + 1)); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, (CompositingQuality) (CompositingQualityAssumeLinear + 1)); // Invalid CompositingQuality. status = GdipSetCompositingQuality (graphics, (CompositingQuality) (CompositingQualityInvalid - 1)); assertEqualInt (status, Ok); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, Ok); assertEqualInt (quality, (CompositingQuality) (CompositingQualityInvalid - 1)); // Negative tests. status = GdipGetCompositingQuality(NULL, &quality); assertEqualInt (status, InvalidParameter); status = GdipGetCompositingQuality (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetCompositingQuality (NULL, CompositingQualityAssumeLinear); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetCompositingQuality (graphics, &quality); assertEqualInt (status, ObjectBusy); status = GdipGetCompositingQuality (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetCompositingQuality(graphics, CompositingQualityAssumeLinear); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_renderingOrigin () { GpStatus status; GpImage *image; GpGraphics *graphics; int x; int y; graphics = getImageGraphics (&image); // Default get. status = GdipGetRenderingOrigin (graphics, &x, &y); assertEqualInt (status, Ok); assertEqualInt (x, 0); assertEqualInt (y, 0); // Positive. status = GdipSetRenderingOrigin (graphics, 1, 2); assertEqualInt (status, Ok); status = GdipGetRenderingOrigin (graphics, &x, &y); assertEqualInt (status, Ok); assertEqualInt (x, 1); assertEqualInt (y, 2); // Zero. status = GdipSetRenderingOrigin (graphics, 0, 0); assertEqualInt (status, Ok); status = GdipGetRenderingOrigin (graphics, &x, &y); assertEqualInt (status, Ok); assertEqualInt (x, 0); assertEqualInt (y, 0); // Negative. status = GdipSetRenderingOrigin (graphics, -1, -2); assertEqualInt (status, Ok); status = GdipGetRenderingOrigin (graphics, &x, &y); assertEqualInt (status, Ok); assertEqualInt (x, -1); assertEqualInt (y, -2); // Negative tests. status = GdipGetRenderingOrigin (NULL, &x, &y); assertEqualInt (status, InvalidParameter); status = GdipGetRenderingOrigin (graphics, NULL, &y); assertEqualInt (status, InvalidParameter); status = GdipGetRenderingOrigin (graphics, &x, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetRenderingOrigin(NULL, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetRenderingOrigin(graphics, &x, &y); assertEqualInt (status, ObjectBusy); status = GdipGetRenderingOrigin(graphics, NULL, &y); assertEqualInt (status, InvalidParameter); status = GdipGetRenderingOrigin(graphics, &x, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetRenderingOrigin (graphics, 1, 2); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_textRenderingHint () { GpStatus status; GpImage *image; GpGraphics *graphics; TextRenderingHint textRenderingHint; graphics = getImageGraphics (&image); // Default get. status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintSystemDefault); // TextRenderingHintSystemDefault. status = GdipSetTextRenderingHint (graphics, TextRenderingHintSystemDefault); assertEqualInt (status, Ok); status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintSystemDefault); // TextRenderingHintSingleBitPerPixelGridFit. status = GdipSetTextRenderingHint (graphics, TextRenderingHintSingleBitPerPixelGridFit); assertEqualInt (status, Ok); status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintSingleBitPerPixelGridFit); // TextRenderingHintSingleBitPerPixel. status = GdipSetTextRenderingHint (graphics, TextRenderingHintSingleBitPerPixel); assertEqualInt (status, Ok); status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintSingleBitPerPixel); // TextRenderingHintAntiAliasGridFit. status = GdipSetTextRenderingHint (graphics, TextRenderingHintAntiAliasGridFit); assertEqualInt (status, Ok); status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintAntiAliasGridFit); // TextRenderingHintAntiAlias. status = GdipSetTextRenderingHint (graphics, TextRenderingHintAntiAlias); assertEqualInt (status, Ok); status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintAntiAlias); // TextRenderingHintClearTypeGridFit. status = GdipSetTextRenderingHint (graphics, TextRenderingHintClearTypeGridFit); assertEqualInt (status, Ok); status = GdipGetTextRenderingHint (graphics, &textRenderingHint); assertEqualInt (status, Ok); assertEqualInt (textRenderingHint, TextRenderingHintClearTypeGridFit); // Negative tests. status = GdipGetTextRenderingHint (NULL, &textRenderingHint); assertEqualInt (status, InvalidParameter); status = GdipGetTextRenderingHint (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetTextRenderingHint (NULL, TextRenderingHintAntiAlias); assertEqualInt (status, InvalidParameter); status = GdipSetTextRenderingHint (graphics, (TextRenderingHint)(TextRenderingHintClearTypeGridFit + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetTextRenderingHint(graphics, &textRenderingHint); assertEqualInt (status, ObjectBusy); status = GdipGetTextRenderingHint(graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetTextRenderingHint (graphics, TextRenderingHintClearTypeGridFit); assertEqualInt (status, ObjectBusy); status = GdipSetTextRenderingHint (graphics, (TextRenderingHint)(TextRenderingHintClearTypeGridFit + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_textContrast () { GpStatus status; GpImage *image; GpGraphics *graphics; UINT textContrast; graphics = getImageGraphics (&image); // Default get. status = GdipGetTextContrast (graphics, &textContrast); assertEqualInt (status, Ok); assertEqualInt (textContrast, 4); // Large. status = GdipSetTextContrast (graphics, 12); assertEqualInt (status, Ok); status = GdipGetTextContrast (graphics, &textContrast); assertEqualInt (status, Ok); assertEqualInt (textContrast, 12); // Zero. status = GdipSetTextContrast (graphics, 0); assertEqualInt (status, Ok); status = GdipGetTextContrast (graphics, &textContrast); assertEqualInt (status, Ok); assertEqualInt (textContrast, 0); // Negative tests. status = GdipGetTextContrast (NULL, &textContrast); assertEqualInt (status, InvalidParameter); status = GdipGetTextContrast (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetTextContrast(NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipSetTextContrast (graphics, -1); assertEqualInt (status, InvalidParameter); status = GdipSetTextContrast (graphics, 13); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetTextContrast (graphics, &textContrast); assertEqualInt (status, ObjectBusy); status = GdipGetTextContrast (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetTextContrast (graphics, 1); assertEqualInt (status, ObjectBusy); status = GdipSetTextContrast (graphics, 13); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_smoothingMode () { GpStatus status; GpImage *image; GpGraphics *graphics; SmoothingMode smoothingMode; graphics = getImageGraphics (&image); // Default get. status = GdipGetSmoothingMode (graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, SmoothingModeNone); // Default -> None status = GdipSetSmoothingMode (graphics, SmoothingModeDefault); assertEqualInt (status, Ok); status = GdipGetSmoothingMode (graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, SmoothingModeNone); // HighSpeed -> None status = GdipSetSmoothingMode(graphics, SmoothingModeHighSpeed); assertEqualInt (status, Ok); status = GdipGetSmoothingMode(graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, SmoothingModeNone); // HighQuality -> AntiAlias status = GdipSetSmoothingMode (graphics, SmoothingModeHighQuality); assertEqualInt (status, Ok); status = GdipGetSmoothingMode (graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, SmoothingModeAntiAlias); // SmoothingModeNone. status = GdipSetSmoothingMode(graphics, SmoothingModeNone); assertEqualInt (status, Ok); status = GdipGetSmoothingMode(graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, SmoothingModeNone); // SmoothingModeAntiAlias. status = GdipSetSmoothingMode(graphics, SmoothingModeAntiAlias); assertEqualInt (status, Ok); status = GdipGetSmoothingMode(graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, SmoothingModeAntiAlias); // SmoothingModeAntiAlias8x8. status = GdipSetSmoothingMode(graphics, (SmoothingMode) (SmoothingModeAntiAlias + 1)); assertEqualInt (status, Ok); status = GdipGetSmoothingMode(graphics, &smoothingMode); assertEqualInt (status, Ok); assertEqualInt (smoothingMode, (SmoothingMode) (SmoothingModeAntiAlias + 1)); // Negative tests. status = GdipGetSmoothingMode (NULL, &smoothingMode); assertEqualInt (status, InvalidParameter); status = GdipGetSmoothingMode (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetSmoothingMode (NULL, SmoothingModeAntiAlias); assertEqualInt (status, InvalidParameter); status = GdipSetSmoothingMode (graphics, SmoothingModeInvalid); assertEqualInt (status, InvalidParameter); status = GdipSetSmoothingMode (graphics, (SmoothingMode) (SmoothingModeAntiAlias + 2)); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetSmoothingMode (graphics, &smoothingMode); assertEqualInt (status, ObjectBusy); status = GdipGetSmoothingMode (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetSmoothingMode (graphics, SmoothingModeHighQuality); assertEqualInt (status, ObjectBusy); status = GdipSetSmoothingMode (graphics, SmoothingModeInvalid); assertEqualInt (status, ObjectBusy); status = GdipSetSmoothingMode (graphics, (SmoothingMode) (SmoothingModeInvalid - 1)); assertEqualInt (status, ObjectBusy); status = GdipSetSmoothingMode (graphics, (SmoothingMode) (SmoothingModeAntiAlias + 2)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_pixelOffsetMode () { GpStatus status; GpImage *image; GpGraphics *graphics; PixelOffsetMode pixelOffsetMode; graphics = getImageGraphics (&image); // Default get. status = GdipGetPixelOffsetMode (graphics, &pixelOffsetMode); assertEqualInt (status, Ok); assertEqualInt (pixelOffsetMode, PixelOffsetModeDefault); // PixelOffsetModeDefault. status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeDefault); assertEqualInt (status, Ok); status = GdipGetPixelOffsetMode (graphics, &pixelOffsetMode); assertEqualInt (status, Ok); assertEqualInt (pixelOffsetMode, PixelOffsetModeDefault); // PixelOffsetModeHighSpeed. status = GdipSetPixelOffsetMode(graphics, PixelOffsetModeHighSpeed); assertEqualInt (status, Ok); status = GdipGetPixelOffsetMode(graphics, &pixelOffsetMode); assertEqualInt (status, Ok); assertEqualInt (pixelOffsetMode, PixelOffsetModeHighSpeed); // PixelOffsetModeHighQuality. status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeHighQuality); assertEqualInt (status, Ok); status = GdipGetPixelOffsetMode (graphics, &pixelOffsetMode); assertEqualInt (status, Ok); assertEqualInt (pixelOffsetMode, PixelOffsetModeHighQuality); // PixelOffsetModeNone. status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeNone); assertEqualInt (status, Ok); status = GdipGetPixelOffsetMode (graphics, &pixelOffsetMode); assertEqualInt (status, Ok); assertEqualInt (pixelOffsetMode, PixelOffsetModeNone); // PixelOffsetModeHalf. status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeHalf); assertEqualInt (status, Ok); status = GdipGetPixelOffsetMode (graphics, &pixelOffsetMode); assertEqualInt (status, Ok); assertEqualInt (pixelOffsetMode, PixelOffsetModeHalf); // Negative tests. status = GdipGetPixelOffsetMode (NULL, &pixelOffsetMode); assertEqualInt (status, InvalidParameter); status = GdipGetPixelOffsetMode (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPixelOffsetMode(NULL, PixelOffsetModeDefault); assertEqualInt (status, InvalidParameter); status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeInvalid); assertEqualInt (status, InvalidParameter); status = GdipSetPixelOffsetMode (graphics, (PixelOffsetMode)(PixelOffsetModeInvalid - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetPixelOffsetMode (graphics, (PixelOffsetMode)(PixelOffsetModeHalf + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetPixelOffsetMode (graphics, &pixelOffsetMode); assertEqualInt (status, ObjectBusy); status = GdipGetPixelOffsetMode (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeDefault); assertEqualInt (status, ObjectBusy); status = GdipSetPixelOffsetMode (graphics, (PixelOffsetMode)(PixelOffsetModeInvalid - 1)); assertEqualInt (status, ObjectBusy); status = GdipSetPixelOffsetMode (graphics, PixelOffsetModeInvalid); assertEqualInt (status, ObjectBusy); status = GdipSetPixelOffsetMode (graphics, (PixelOffsetMode)(PixelOffsetModeHalf + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_interpolationMode () { GpStatus status; GpImage *image; GpGraphics *graphics; InterpolationMode interpolationMode; graphics = getImageGraphics (&image); // Default get status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeBilinear); // Default -> Bilinear status = GdipSetInterpolationMode (graphics, InterpolationModeDefault); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeBilinear); // LowQuality -> NearestNeighbor status = GdipSetInterpolationMode(graphics, InterpolationModeLowQuality); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeBilinear); // HighQuality -> HighQualityBicubic status = GdipSetInterpolationMode (graphics, InterpolationModeHighQuality); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeHighQualityBicubic); // InterpolationModeBilinear. status = GdipSetInterpolationMode (graphics, InterpolationModeBilinear); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeBilinear); // InterpolationModeBicubic. status = GdipSetInterpolationMode (graphics, InterpolationModeBicubic); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeBicubic); // InterpolationModeNearestNeighbor. status = GdipSetInterpolationMode (graphics, InterpolationModeNearestNeighbor); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeNearestNeighbor); // InterpolationModeHighQualityBilinear. status = GdipSetInterpolationMode (graphics, InterpolationModeHighQualityBilinear); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeHighQualityBilinear); // InterpolationModeHighQualityBicubic. status = GdipSetInterpolationMode (graphics, InterpolationModeHighQualityBicubic); assertEqualInt (status, Ok); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, Ok); assertEqualInt (interpolationMode, InterpolationModeHighQualityBicubic); // Negative tests. status = GdipGetInterpolationMode (NULL, &interpolationMode); assertEqualInt (status, InvalidParameter); // This causes an access violation in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetInterpolationMode (graphics, NULL); assertEqualInt (status, InvalidParameter); #endif status = GdipSetInterpolationMode (NULL, InterpolationModeBicubic); assertEqualInt (status, InvalidParameter); status = GdipSetInterpolationMode (graphics, InterpolationModeInvalid); assertEqualInt (status, InvalidParameter); status = GdipSetInterpolationMode (graphics, (InterpolationMode)(InterpolationModeInvalid - 1)); assertEqualInt (status, InvalidParameter); status = GdipSetInterpolationMode (graphics, (InterpolationMode)(InterpolationModeHighQualityBicubic + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetInterpolationMode (graphics, &interpolationMode); assertEqualInt (status, ObjectBusy); status = GdipGetInterpolationMode (graphics, NULL); assertEqualInt (status, ObjectBusy); status = GdipSetInterpolationMode (graphics, InterpolationModeBicubic); assertEqualInt (status, ObjectBusy); status = GdipSetInterpolationMode (graphics, InterpolationModeInvalid); assertEqualInt (status, ObjectBusy); status = GdipSetInterpolationMode (graphics, (InterpolationMode)(InterpolationModeInvalid - 1)); assertEqualInt (status, ObjectBusy); status = GdipSetInterpolationMode (graphics, (InterpolationMode)(InterpolationModeHighQualityBicubic + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_transform () { GpStatus status; GpImage *image; GpGraphics *graphics; GpMatrix *matrix; GpMatrix *setMatrix; GpMatrix *nonInvertibleMatrix; graphics = getImageGraphics (&image); status = GdipCreateMatrix2 (0, 0, 0, 0, 0, 0, &matrix); assertEqualInt (status, Ok); status = GdipCreateMatrix2 (146, 66, 158, 104, 42, 150, &setMatrix); assertEqualInt (status, Ok); status = GdipCreateMatrix2 (123, 24, 82, 16, 47, 30, &nonInvertibleMatrix); assertEqualInt (status, Ok); // Default get. status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); verifyMatrix (matrix, 1, 0, 0, 1, 0, 0); status = GdipSetWorldTransform (graphics, setMatrix); assertEqualInt (status, Ok); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); BOOL result; GdipIsMatrixEqual (matrix, setMatrix, &result); assertEqualInt (result, 1); // Negative tests. status = GdipGetWorldTransform (NULL, matrix); assertEqualInt (status, InvalidParameter); status = GdipGetWorldTransform (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetWorldTransform (NULL, matrix); assertEqualInt (status, InvalidParameter); status = GdipSetWorldTransform (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetWorldTransform (graphics, nonInvertibleMatrix); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, ObjectBusy); status = GdipGetWorldTransform (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetWorldTransform (graphics, matrix); assertEqualInt (status, ObjectBusy); status = GdipSetWorldTransform (graphics, NULL); assertEqualInt (status, ObjectBusy); status = GdipSetWorldTransform (graphics, nonInvertibleMatrix); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteMatrix (matrix); GdipDeleteMatrix (setMatrix); GdipDeleteMatrix (nonInvertibleMatrix); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_pageUnit () { GpStatus status; GpImage *image; GpGraphics *graphics; Unit pageUnit; graphics = getImageGraphics (&image); // UnitDisplay. status = GdipSetPageUnit (graphics, UnitDisplay); assertEqualInt (status, Ok); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, Ok); assertEqualInt (pageUnit, UnitDisplay); // UnitPixel. status = GdipSetPageUnit (graphics, UnitPixel); assertEqualInt (status, Ok); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, Ok); assertEqualInt (pageUnit, UnitPixel); // UnitPoint. status = GdipSetPageUnit (graphics, UnitPoint); assertEqualInt (status, Ok); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, Ok); assertEqualInt (pageUnit, UnitPoint); // UnitInch. status = GdipSetPageUnit (graphics, UnitInch); assertEqualInt (status, Ok); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, Ok); assertEqualInt (pageUnit, UnitInch); // UnitDocument. status = GdipSetPageUnit (graphics, UnitDocument); assertEqualInt (status, Ok); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, Ok); assertEqualInt (pageUnit, UnitDocument); // UnitMillimeter. status = GdipSetPageUnit (graphics, UnitMillimeter); assertEqualInt (status, Ok); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, Ok); assertEqualInt (pageUnit, UnitMillimeter); // Negative tests. status = GdipGetPageUnit (NULL, &pageUnit); assertEqualInt (status, InvalidParameter); status = GdipGetPageUnit (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPageUnit (NULL, UnitDisplay); assertEqualInt (status, InvalidParameter); status = GdipSetPageUnit (graphics, (Unit)(UnitWorld - 1)); assertEqualInt (status, InvalidParameter); #if defined(USE_WINDOWS_GDIPLUS) status = GdipSetPageUnit (graphics, (Unit)(UnitMillimeter + 1)); assertEqualInt (status, InvalidParameter); #else status = GdipSetPageUnit (graphics, (Unit)(UnitCairoPoint + 1)); assertEqualInt (status, InvalidParameter); #endif status = GdipSetPageUnit (graphics, UnitWorld); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetPageUnit (graphics, &pageUnit); assertEqualInt (status, ObjectBusy); status = GdipGetPageUnit (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPageUnit (graphics, UnitDisplay); assertEqualInt (status, ObjectBusy); status = GdipSetPageUnit (graphics, UnitWorld); assertEqualInt (status, ObjectBusy); #if defined(USE_WINDOWS_GDIPLUS) status = GdipSetPageUnit (graphics, (Unit)(UnitMillimeter + 1)); assertEqualInt (status, ObjectBusy); #else status = GdipSetPageUnit (graphics, (Unit)(UnitCairoPoint + 1)); assertEqualInt (status, ObjectBusy); #endif GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_pageScale () { GpStatus status; GpImage *image; GpGraphics *graphics; REAL pageScale; graphics = getImageGraphics (&image); status = GdipSetPageScale (graphics, 1); assertEqualInt (status, Ok); status = GdipGetPageScale (graphics, &pageScale); assertEqualInt (status, Ok); assertEqualFloat (pageScale, 1); status = GdipSetPageScale (graphics, (REAL) 1000000032); assertEqualInt (status, Ok); status = GdipGetPageScale (graphics, &pageScale); assertEqualInt (status, Ok); assertEqualFloat (pageScale, (REAL) 1000000032); // Negative tests. status = GdipGetPageScale (NULL, &pageScale); assertEqualInt (status, InvalidParameter); status = GdipGetPageScale (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPageScale (NULL, UnitDisplay); assertEqualInt (status, InvalidParameter); status = GdipSetPageScale (graphics, -INFINITY); assertEqualInt (status, InvalidParameter); status = GdipSetPageScale (graphics, -1); assertEqualInt (status, InvalidParameter); status = GdipSetPageScale (graphics, 0); assertEqualInt (status, InvalidParameter); status = GdipSetPageScale (graphics, FLT_MAX); assertEqualInt (status, InvalidParameter); // 1000000032 appears to be the max value accepted by GDI+. status = GdipSetPageScale (graphics, (REAL) 1000000033); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetPageScale (graphics, &pageScale); assertEqualInt (status, ObjectBusy); status = GdipGetPageScale (graphics, NULL); assertEqualInt (status, InvalidParameter); status = GdipSetPageScale (graphics, 1); assertEqualInt (status, ObjectBusy); status = GdipSetPageScale (graphics, 1); assertEqualInt (status, ObjectBusy); status = GdipSetPageScale (graphics, 0); assertEqualInt (status, ObjectBusy); status = GdipSetPageScale (graphics, (REAL) 1000000033); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_dpiX () { GpStatus status; GpImage *image; GpGraphics *graphics; REAL dpiX; graphics = getImageGraphics (&image); status = GdipGetDpiX (graphics, &dpiX); assertEqualInt (status, Ok); assert (dpiX > 0); // Negative tests. status = GdipGetDpiX (NULL, &dpiX); assertEqualInt (status, InvalidParameter); status = GdipGetDpiX (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC (graphics, &hdc); status = GdipGetDpiX (graphics, &dpiX); assertEqualInt (status, ObjectBusy); status = GdipGetDpiX (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC(graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_dpiY () { GpStatus status; GpImage *image; GpGraphics *graphics; REAL dpiY; graphics = getImageGraphics (&image); status = GdipGetDpiY (graphics, &dpiY); assertEqualInt (status, Ok); assert (dpiY > 0); // Negative tests. status = GdipGetDpiY (NULL, &dpiY); assertEqualInt (status, InvalidParameter); status = GdipGetDpiY (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; GdipGetDC(graphics, &hdc); status = GdipGetDpiY (graphics, &dpiY); assertEqualInt (status, ObjectBusy); status = GdipGetDpiY (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_flush () { GpStatus status; GpImage *image; GpGraphics *graphics; graphics = getImageGraphics (&image); status = GdipFlush (graphics, FlushIntentionFlush); assertEqualInt (status, Ok); status = GdipFlush (graphics, FlushIntentionSync); assertEqualInt (status, Ok); status = GdipFlush (graphics, (FlushIntention)(FlushIntentionFlush - 1)); assertEqualInt (status, Ok); status = GdipFlush (graphics, (FlushIntention)(FlushIntentionSync + 1)); assertEqualInt (status, Ok); // Negative tests. status = GdipFlush (NULL, FlushIntentionFlush); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipFlush (graphics, FlushIntentionSync); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_delete () { GpStatus status; GpImage *image; GpGraphics *graphics; graphics = getImageGraphics (&image); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDeleteGraphics (graphics); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); status = GdipDeleteGraphics (graphics); assertEqualInt (status, Ok); status = GdipDeleteGraphics (NULL); assertEqualInt (status, InvalidParameter); GdipDisposeImage (image); } static void test_rotateWorldTransform () { GpStatus status; GpMatrix *transform; GpMatrix *matrix; GpImage *image; GpGraphics *graphics; GpRegion *clip; GpRectF visibleClipBounds; GpRectF rect = {0, 0, 32, 32}; GdipCreateRegionRect (&rect, &clip); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); GdipCreateMatrix (&matrix); // MatrixOrderPrepend. graphics = getImageGraphics (&image); GdipSetWorldTransform (graphics, transform); status = GdipRotateWorldTransform (graphics, 90, MatrixOrderPrepend); GdipGetWorldTransform (graphics, matrix); verifyMatrix (matrix, 3, 4, -1, -2, 5, 6); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // MatrixOrderAppend. graphics = getImageGraphics (&image); GdipSetWorldTransform (graphics, transform); status = GdipRotateWorldTransform (graphics, 90, MatrixOrderAppend); GdipGetWorldTransform (graphics, matrix); verifyMatrix (matrix, -2, 1, -4, 3, -6, 5); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // With clip region. graphics = getImageGraphics (&image); GdipSetClipRegion (graphics, clip, CombineModeReplace); status = GdipRotateWorldTransform (graphics, 90, MatrixOrderPrepend); assertEqualInt (status, Ok); status = GdipGetVisibleClipBounds (graphics, &visibleClipBounds); assertEqualInt (status, Ok); assertEqualFloat (0, visibleClipBounds.X); assertEqualFloat (-32, visibleClipBounds.Y); assertEqualFloat (32, visibleClipBounds.Width); assertEqualFloat (32, visibleClipBounds.Height); // Negative tests. status = GdipRotateWorldTransform (NULL, 0, MatrixOrderAppend); assertEqualInt (status, InvalidParameter); status = GdipRotateWorldTransform (graphics, 0, (MatrixOrder) (MatrixOrderAppend + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipRotateWorldTransform (graphics, 0, MatrixOrderAppend); assertEqualInt (status, ObjectBusy); status = GdipRotateWorldTransform (graphics, 0, (MatrixOrder) (MatrixOrderAppend + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDeleteRegion (clip); GdipDeleteMatrix (transform); GdipDeleteMatrix (matrix); } static void test_resetClip () { GpStatus status; GpImage *image; GpGraphics *graphics; GpRectF bounds; graphics = getImageGraphics (&image); GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipResetClip (graphics); assertEqualInt (status, Ok); GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -4194304); assertEqualFloat (bounds.Y, -4194304); assertEqualFloat (bounds.Width, 8388608); assertEqualFloat (bounds.Height, 8388608); // Negative tests. status = GdipResetClip (NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipResetClip (graphics); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); } static void test_getClip () { GpStatus status; GpImage *image; GpGraphics *graphics; GpMatrix *transform; GpRegion *clip; GpRectF bounds = {1, 2, 3, 4}; GdipCreateRegionRect (&bounds, &clip); graphics = getImageGraphics (&image); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); // Default get - no transform. status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, -4194304); assertEqualFloat (bounds.Y, -4194304); assertEqualFloat (bounds.Width, 8388608); assertEqualFloat (bounds.Height, 8388608); // Default get - translate transform. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, -4194304); assertEqualFloat (bounds.Y, -4194304); assertEqualFloat (bounds.Width, 8388608); assertEqualFloat (bounds.Height, 8388608); GdipResetWorldTransform (graphics); // Default get - complex transform. GdipSetWorldTransform (graphics, transform); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, -4194304); assertEqualFloat (bounds.Y, -4194304); assertEqualFloat (bounds.Width, 8388608); assertEqualFloat (bounds.Height, 8388608); GdipResetWorldTransform (graphics); // Empty clip - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Empty clip - translate transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip - complex transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Custom clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Custom clip - translate transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, 20); assertEqualFloat (bounds.Y, 40); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); GdipResetWorldTransform (graphics); // Custom clip - complex transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClip (graphics, clip); assertEqualInt (status, Ok); GdipGetRegionBounds (clip, graphics, &bounds); assertEqualFloat (bounds.X, -49); assertEqualFloat (bounds.Y, -22); assertEqualFloat (bounds.Width, 120); assertEqualFloat (bounds.Height, 50); // Negative tests. status = GdipGetClip (NULL, clip); assertEqualInt (status, InvalidParameter); status = GdipGetClip (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipGetClip (graphics, clip); assertEqualInt (status, ObjectBusy); status = GdipGetClip (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteMatrix (transform); } static void test_getClipBounds () { GpStatus status; GpImage *image; GpGraphics *graphics; GpMatrix *transform; GpRegion *emptyRegion; GpRectF bounds; graphics = getImageGraphics (&image); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); // Default get - no transform. status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -4194304); assertEqualFloat (bounds.Y, -4194304); assertEqualFloat (bounds.Width, 8388608); assertEqualFloat (bounds.Height, 8388608); // Default get - translate transform. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/437 #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (bounds.X, -4194294); assertEqualFloat (bounds.Y, -4194284); #endif assertEqualFloat (bounds.Width, 8388608); assertEqualFloat (bounds.Height, 8388608); GdipResetWorldTransform (graphics); // Default get - complex transform. GdipSetWorldTransform (graphics, transform); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/437 #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (bounds.X, -14680063); assertEqualFloat (bounds.Y, -6291458); assertEqualFloat (bounds.Width, 29360128); assertEqualFloat (bounds.Height, 12582912); #endif GdipResetWorldTransform (graphics); // Empty clip - no transform. GdipSetClipRegion (graphics, emptyRegion, CombineModeReplace); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Empty clip - translate transform. GdipSetClipRegion (graphics, emptyRegion, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip - complex transform. GdipSetClipRegion (graphics, emptyRegion, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 1); assertEqualFloat (bounds.Y, -2); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip rect - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Empty clip rect - translate transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip rect - complex transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 1); assertEqualFloat (bounds.Y, -2); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Custom clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Custom clip - translate transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 20); assertEqualFloat (bounds.Y, 40); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); GdipResetWorldTransform (graphics); // Custom clip - complex transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -49); assertEqualFloat (bounds.Y, -22); assertEqualFloat (bounds.Width, 120); assertEqualFloat (bounds.Height, 50); // Negative tests. status = GdipGetClipBounds (NULL, &bounds); assertEqualInt (status, InvalidParameter); status = GdipGetClipBounds (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, ObjectBusy); status = GdipGetClipBounds (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteMatrix (transform); GdipDeleteRegion (emptyRegion); } static void test_getClipBoundsI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpMatrix *transform; GpRegion *emptyRegion; GpRect bounds; graphics = getImageGraphics (&image); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); GdipCreateRegion (&emptyRegion); GdipSetEmpty (emptyRegion); // Default get - no transform. status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, -4194304); assertEqualInt (bounds.Y, -4194304); assertEqualInt (bounds.Width, 8388608); assertEqualInt (bounds.Height, 8388608); // Default get - translate transform. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/437 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (bounds.X, -4194294); assertEqualInt (bounds.Y, -4194284); #endif assertEqualInt (bounds.Width, 8388608); assertEqualInt (bounds.Height, 8388608); GdipResetWorldTransform (graphics); // Default get - complex transform. GdipSetWorldTransform (graphics, transform); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/437 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (bounds.X, -14680063); assertEqualInt (bounds.Y, -6291458); assertEqualInt (bounds.Width, 29360128); assertEqualInt (bounds.Height, 12582912); #endif GdipResetWorldTransform (graphics); // Empty clip - no transform. GdipSetClipRegion (graphics, emptyRegion, CombineModeReplace); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 0); assertEqualInt (bounds.Y, 0); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); // Empty clip - translate transform. GdipSetClipRegion (graphics, emptyRegion, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 10); assertEqualInt (bounds.Y, 20); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip - complex transform. GdipSetClipRegion (graphics, emptyRegion, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 1); assertEqualInt (bounds.Y, -2); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip rect - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 0); assertEqualInt (bounds.Y, 0); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); // Empty clip rect - translate transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 10); assertEqualInt (bounds.Y, 20); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip rect - complex transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 1); assertEqualInt (bounds.Y, -2); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); GdipResetWorldTransform (graphics); // Custom clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 10); assertEqualInt (bounds.Y, 20); assertEqualInt (bounds.Width, 30); assertEqualInt (bounds.Height, 40); // Custom clip - translate transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 20); assertEqualInt (bounds.Y, 40); assertEqualInt (bounds.Width, 30); assertEqualInt (bounds.Height, 40); GdipResetWorldTransform (graphics); // Custom clip - complex transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, -49); assertEqualInt (bounds.Y, -22); assertEqualInt (bounds.Width, 120); assertEqualInt (bounds.Height, 50); // Negative tests. status = GdipGetClipBoundsI (NULL, &bounds); assertEqualInt (status, InvalidParameter); status = GdipGetClipBoundsI (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipGetClipBoundsI (graphics, &bounds); assertEqualInt (status, ObjectBusy); status = GdipGetClipBoundsI (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteMatrix (transform); GdipDeleteRegion (emptyRegion); } static void test_getVisibleClipBounds () { GpStatus status; GpImage *image; GpGraphics *graphics; GpMatrix *transform; GpRectF bounds; graphics = getImageGraphics (&image); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); // Default get - no transform. status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 100); assertEqualFloat (bounds.Height, 68); // Default get - translate transform. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 100); assertEqualFloat (bounds.Height, 68); GdipResetWorldTransform (graphics); // Default get - complex transform. GdipSetWorldTransform (graphics, transform); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/309 #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (bounds.X, -199); assertEqualFloat (bounds.Y, -36); assertEqualFloat (bounds.Width, 302); assertEqualFloat (bounds.Height, 134); #endif GdipResetWorldTransform (graphics); // Empty clip - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Empty clip - translate transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip - complex transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 1); assertEqualFloat (bounds.Y, -2); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); GdipResetWorldTransform (graphics); // Custom clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Custom clip - translate transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 20); assertEqualFloat (bounds.Y, 40); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); GdipResetWorldTransform (graphics); // Custom clip - complex transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/309 #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (bounds.X, -49); assertEqualFloat (bounds.Y, -22); assertEqualFloat (bounds.Width, 120); assertEqualFloat (bounds.Height, 50); #endif GdipResetWorldTransform (graphics); // Negative tests. status = GdipGetVisibleClipBounds (NULL, &bounds); assertEqualInt (status, InvalidParameter); status = GdipGetVisibleClipBounds (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipGetVisibleClipBounds (graphics, &bounds); assertEqualInt (status, ObjectBusy); status = GdipGetVisibleClipBounds (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteMatrix (transform); } static void test_getVisibleClipBoundsI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpMatrix *transform; GpRect bounds; graphics = getImageGraphics (&image); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &transform); // Default get - no transform status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 0); assertEqualInt (bounds.Y, 0); assertEqualInt (bounds.Width, 100); assertEqualInt (bounds.Height, 68); // Default get - translate transform. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 10); assertEqualInt (bounds.Y, 20); assertEqualInt (bounds.Width, 100); assertEqualInt (bounds.Height, 68); GdipResetWorldTransform (graphics); // Default get - complex transform. GdipSetWorldTransform (graphics, transform); status = GdipGetVisibleClipBoundsI (graphics, &bounds); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/309 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (bounds.X, -199); assertEqualInt (bounds.Y, -36); assertEqualInt (bounds.Width, 302); assertEqualInt (bounds.Height, 134); #endif GdipResetWorldTransform (graphics); // Empty clip - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 0); assertEqualInt (bounds.Y, 0); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); // Empty clip - translate transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 10); assertEqualInt (bounds.Y, 20); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); GdipResetWorldTransform (graphics); // Empty clip - complex transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 1); assertEqualInt (bounds.Y, -2); assertEqualInt (bounds.Width, 0); assertEqualInt (bounds.Height, 0); GdipResetWorldTransform (graphics); // Custom clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 10); assertEqualInt (bounds.Y, 20); assertEqualInt (bounds.Width, 30); assertEqualInt (bounds.Height, 40); // Custom clip - translate transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); assertEqualInt (bounds.X, 20); assertEqualInt (bounds.Y, 40); assertEqualInt (bounds.Width, 30); assertEqualInt (bounds.Height, 40); GdipResetWorldTransform (graphics); // Custom clip - complex transform. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipSetWorldTransform (graphics, transform); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: should be transformed: https://github.com/mono/libgdiplus/issues/309 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (bounds.X, -49); assertEqualInt (bounds.Y, -22); assertEqualInt (bounds.Width, 120); assertEqualInt (bounds.Height, 50); #endif // Negative tests. status = GdipGetVisibleClipBoundsI (NULL, &bounds); assertEqualInt (status, InvalidParameter); status = GdipGetVisibleClipBoundsI (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipGetVisibleClipBoundsI (graphics, &bounds); assertEqualInt (status, ObjectBusy); status = GdipGetVisibleClipBoundsI (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteMatrix (transform); } static void test_isClipEmpty () { GpStatus status; GpImage *image; GpGraphics *graphics; BOOL isEmpty; graphics = getImageGraphics (&image); // Default clip. status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, FALSE); // Empty clip - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Empty width clip - no transform. GdipSetClipRect (graphics, 10, 20, 0, 40, CombineModeReplace); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Empty height clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 0, CombineModeReplace); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Empty clip - transformed. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Custom clip - no transform. GdipResetWorldTransform (graphics); GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, FALSE); // Custom clip - transformed. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, FALSE); // Negative tests. status = GdipIsClipEmpty (NULL, &isEmpty); assertEqualInt (status, InvalidParameter); status = GdipIsClipEmpty (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipIsClipEmpty (graphics, &isEmpty); assertEqualInt (status, ObjectBusy); status = GdipIsClipEmpty (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); } static void test_isVisibleClipEmpty () { GpStatus status; GpImage *image; GpGraphics *graphics; BOOL isEmpty; graphics = getImageGraphics (&image); // Default clip. status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, FALSE); // Empty clip - no transform. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Empty width clip - no transform. GdipSetClipRect (graphics, 10, 20, 0, 40, CombineModeReplace); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Empty height clip - no transform. GdipSetClipRect (graphics, 10, 20, 30, 0, CombineModeReplace); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Empty clip - transformed. GdipSetClipRect (graphics, 0, 0, 0, 0, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, TRUE); // Custom clip - no transform. GdipResetWorldTransform (graphics); GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, FALSE); // Custom clip - transformed. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, Ok); assertEqualInt (isEmpty, FALSE); // Negative tests. status = GdipIsVisibleClipEmpty (NULL, &isEmpty); assertEqualInt (status, InvalidParameter); status = GdipIsVisibleClipEmpty (graphics, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipIsVisibleClipEmpty (graphics, &isEmpty); assertEqualInt (status, ObjectBusy); status = GdipIsVisibleClipEmpty (graphics, NULL); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); } static void test_setClipGraphics () { GpStatus status; GpImage *image; GpGraphics *graphics; GpGraphics *otherGraphics; GpRegion *clip; GpRectF bounds; graphics = getImageGraphics (&image); otherGraphics = getImageGraphics (&image); GdipCreateRegion (&clip); // No transform. GdipSetClipRect (otherGraphics, 10, 20, 30, 40, CombineModeReplace); status = GdipSetClipGraphics (graphics, otherGraphics, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Source graphics transformed. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipSetClipGraphics (graphics, otherGraphics, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); // FIXME this is incorrect: https://github.com/mono/libgdiplus/issues/308 #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (bounds.X, 20); assertEqualFloat (bounds.Y, 40); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); #endif // Target graphics transformed. GdipResetWorldTransform (graphics); GdipTranslateWorldTransform (otherGraphics, -10, -20, MatrixOrderAppend); status = GdipSetClipGraphics (graphics, otherGraphics, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipSetClipGraphics (NULL, otherGraphics, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipGraphics (graphics, NULL, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipGraphics (graphics, otherGraphics, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipSetClipGraphics (graphics, otherGraphics, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipGraphics (graphics, NULL, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipGraphics (graphics, NULL, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); status = GdipGetDC (otherGraphics, &hdc); status = GdipSetClipGraphics (graphics, otherGraphics, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipGraphics (NULL, otherGraphics, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipGraphics (graphics, otherGraphics, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (otherGraphics, hdc); GdipDeleteGraphics (graphics); GdipDeleteGraphics (otherGraphics); GdipDisposeImage (image); } static void test_setClipHrgn () { GpStatus status; GpImage *image; GpRegion *region; GpGraphics *graphics; HRGN hrgn; GpRectF bounds; graphics = getImageGraphics (&image); GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); GdipGetRegionHRgn (region, graphics, &hrgn); // No transform. status = GdipSetClipHrgn (graphics, hrgn, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Target graphics transformed. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipSetClipHrgn (graphics, hrgn, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); // FIXME: no transformation applied. #if defined(USE_WINDOWS_GDIPLUS) assertEqualFloat (bounds.X, 20); assertEqualFloat (bounds.Y, 40); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); #endif // Negative tests. status = GdipSetClipHrgn (NULL, hrgn, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipHrgn (graphics, NULL, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipHrgn (graphics, hrgn, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipSetClipHrgn (graphics, hrgn, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipHrgn (graphics, NULL, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipHrgn (graphics, hrgn, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDeleteRegion (region); } static void test_setClipRect () { GpStatus status; GpImage *image; GpGraphics *graphics; GpRectF bounds; UINT scansCount; GpRegion *region; GpMatrix *matrix; graphics = getImageGraphics (&image); GdipCreateRegion (®ion); GdipCreateMatrix (&matrix); // Positive width, positive height. status = GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Positive width, zero height. status = GdipSetClipRect (graphics, 10, 20, 30, 0, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Positive width, negative height. status = GdipSetClipRect (graphics, 10, 20, 30, -40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 1); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, -20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Zero width, positive height. status = GdipSetClipRect (graphics, 10, 20, 0, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Zero width, zero height. status = GdipSetClipRect (graphics, 10, 20, 0, 0, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Zero width, negative height. status = GdipSetClipRect (graphics, 10, 20, 0, -40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Negative width, positive height. status = GdipSetClipRect (graphics, 10, 20, -30, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 1); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -20); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative width, zero height. status = GdipSetClipRect (graphics, 10, 20, -30, 0, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Negative width, negative height. status = GdipSetClipRect (graphics, 10, 20, -30, -40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 1); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -20); assertEqualFloat (bounds.Y, -20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Target graphics transformed. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipSetClipRect (NULL, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipRect (graphics, 10, 20, 30, 40, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipRect (graphics, 10, 20, 30, 40, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteRegion (region); GdipDeleteMatrix (matrix); } static void test_setClipRectI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpRectF bounds; UINT scansCount; GpRegion *region; GpMatrix *matrix; graphics = getImageGraphics (&image); GdipCreateRegion (®ion); GdipCreateMatrix (&matrix); // Positive width, positive height. status = GdipSetClipRectI (graphics, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Positive width, zero height. status = GdipSetClipRectI (graphics, 10, 20, 30, 0, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Positive width, negative height. status = GdipSetClipRectI (graphics, 10, 20, 30, -40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 1); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, -20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Zero width, positive height. status = GdipSetClipRectI (graphics, 10, 20, 0, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Zero width, zero height. status = GdipSetClipRectI (graphics, 10, 20, 0, 0, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Zero width, negative height. status = GdipSetClipRectI (graphics, 10, 20, 0, -40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Negative width, positive height. status = GdipSetClipRectI (graphics, 10, 20, -30, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 1); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -20); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative width, zero height. status = GdipSetClipRectI (graphics, 10, 20, -30, 0, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 0); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 0); assertEqualFloat (bounds.Height, 0); // Negative width, negative height. status = GdipSetClipRectI (graphics, 10, 20, -30, -40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClip (graphics, region); assertEqualInt (status, Ok); status = GdipGetRegionScansCount (region, &scansCount, matrix); assertEqualInt (status, Ok); assertEqualInt (scansCount, 1); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, -20); assertEqualFloat (bounds.Y, -20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Target graphics transformed. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipSetClipRectI (graphics, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipSetClipRectI (NULL, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipRectI (graphics, 10, 20, 30, 40, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipSetClipRectI (graphics, 10, 20, 30, 40, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipRectI (graphics, 10, 20, 30, 40, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeleteRegion (region); GdipDeleteMatrix (matrix); } static void test_setClipRegion () { GpStatus status; GpImage *image; GpRegion *region; GpGraphics *graphics; GpRectF bounds; graphics = getImageGraphics (&image); GpRectF rect = {10, 20, 30, 40}; GdipCreateRegionRect (&rect, ®ion); // No transform. status = GdipSetClipRegion (graphics, region, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Target graphics transformed. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipSetClipRegion (graphics, region, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipSetClipRegion (NULL, region, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipRegion (graphics, NULL, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipRegion (graphics, region, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipSetClipRegion (graphics, region, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipRegion (graphics, NULL, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipRegion (graphics, region, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDeleteRegion (region); GdipDisposeImage (image); } static void test_setClipPath () { GpStatus status; GpImage *image; GpGraphics *graphics; GpRectF bounds; GpPath *path; graphics = getImageGraphics (&image); GdipCreatePath (FillModeAlternate, &path); GdipAddPathRectangle (path, 10, 20, 30, 40); // No transform. status = GdipSetClipPath (graphics, path, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Target graphics transformed. GdipTranslateWorldTransform (graphics, -10, -20, MatrixOrderAppend); status = GdipSetClipPath (graphics, path, CombineModeReplace); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipSetClipPath (NULL, path, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipPath (graphics, NULL, CombineModeReplace); assertEqualInt (status, InvalidParameter); status = GdipSetClipPath (graphics, path, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipSetClipPath (graphics, path, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipPath (graphics, NULL, CombineModeReplace); assertEqualInt (status, ObjectBusy); status = GdipSetClipPath (graphics, path, (CombineMode) (CombineModeComplement + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePath (path); } static void test_translateClip () { GpStatus status; GpImage *image; GpGraphics *graphics; GpRectF bounds; graphics = getImageGraphics (&image); // Non-infinite. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipTranslateClip (graphics, 0, 0); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative. status = GdipTranslateClip (graphics, -10, -20); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Positive. status = GdipTranslateClip (graphics, 10, 20); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipTranslateClip (NULL, 10, 20); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipTranslateClip (graphics, 10, 20); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); } static void test_translateClipI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpRectF bounds; graphics = getImageGraphics (&image); // Non-infinite. GdipSetClipRect (graphics, 10, 20, 30, 40, CombineModeReplace); status = GdipTranslateClipI (graphics, 0, 0); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative. status = GdipTranslateClipI (graphics, -10, -20); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 0); assertEqualFloat (bounds.Y, 0); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Positive. status = GdipTranslateClipI (graphics, 10, 20); assertEqualInt (status, Ok); status = GdipGetClipBounds (graphics, &bounds); assertEqualInt (status, Ok); assertEqualFloat (bounds.X, 10); assertEqualFloat (bounds.Y, 20); assertEqualFloat (bounds.Width, 30); assertEqualFloat (bounds.Height, 40); // Negative tests. status = GdipTranslateClipI (NULL, 10, 20); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipTranslateClipI (graphics, 10, 20); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); } static void test_region_mask() { ARGB color; GpStatus status; GpBitmap* bitmap = NULL; GpGraphics* graphics = NULL; GpPath* rectPath = NULL; GpPath* polyPath = NULL; GpRegion* region = NULL; GpSolidFill* brush = NULL; static GpPoint polyPoints[] = { { 100, 100 }, { 200, 75 }, { 300, 100 }, { 325, 200 }, { 300, 300 }, { 200, 325 }, { 100, 300 }, { 75, 200 } }; status = GdipCreateBitmapFromScan0 (400, 400, 0, PixelFormat32bppARGB, NULL, &bitmap); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext (bitmap, &graphics); assertEqualInt (status, Ok); GdipGraphicsClear (graphics, 0xFF808080); status = GdipCreatePath (FillModeAlternate, &rectPath); assertEqualInt (status, Ok); GdipAddPathRectangleI (rectPath, 50, 50, 300, 300); status = GdipCreatePath (FillModeAlternate, &polyPath); assertEqualInt (status, Ok); GdipAddPathPolygonI (polyPath, polyPoints, sizeof(polyPoints) / sizeof(polyPoints[0])); status = GdipCreateRegion (®ion); assertEqualInt (status, Ok); GdipSetEmpty (region); GdipCombineRegionPath (region, rectPath, CombineModeUnion); GdipCombineRegionPath (region, polyPath, CombineModeExclude); status = GdipCreateSolidFill (0xFF00FF00, &brush); assertEqualInt (status, Ok); GdipFillRegion (graphics, brush, region); status = GdipBitmapGetPixel (bitmap, 0, 0, &color); assertEqualInt(status, Ok); assertEqualInt(color, 0xFF808080); status = GdipBitmapGetPixel (bitmap, 50, 50, &color); assertEqualInt(status, Ok); assertEqualInt(color, 0xFF00FF00); status = GdipBitmapGetPixel (bitmap, 200, 200, &color); assertEqualInt(status, Ok); assertEqualInt(color, 0xFF808080); //GdipSaveImageToFile (bitmap, (const WCHAR*)createWchar( "test-image.png" ), &png_clsid, NULL); GdipDeleteGraphics (graphics); GdipDeletePath (rectPath); GdipDeletePath (polyPath); GdipDeleteRegion (region); GdipDeleteBrush (brush); GdipDisposeImage (bitmap); } static void test_premultiplication () { GpStatus status; GpBitmap *bitmap; GpBitmap *bitmapBackground; GpGraphics *graphicsBackground; BYTE bpp32ArgbData[] = { 0xFF, 0xFF, 0xFF, 0x80 }; ARGB bpp32ArgbPixels[] = { 0x80FFFFFF }; ARGB bpp32RgbPixelsPre[] = { 0xFF000000 }; ARGB bpp32RgbPixels[] = { 0xFF808080 }; status = GdipCreateBitmapFromScan0 (1, 1, 4, PixelFormat32bppARGB, bpp32ArgbData, &bitmap); assertEqualInt (status, Ok); verifyBitmap (bitmap, memoryBmpRawFormat, PixelFormat32bppARGB, 1, 1, ImageFlagsHasAlpha, 0, TRUE); verifyPixels (bitmap, bpp32ArgbPixels); status = GdipCreateBitmapFromScan0 (1, 1, 4, PixelFormat32bppRGB, NULL, &bitmapBackground); assertEqualInt (status, Ok); status = GdipBitmapSetPixel (bitmapBackground, 0, 0, 0); assertEqualInt (status, Ok); verifyPixels (bitmapBackground, bpp32RgbPixelsPre); GdipGetImageGraphicsContext (bitmapBackground, &graphicsBackground); status = GdipDrawImage (graphicsBackground, (GpImage *)bitmap, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphicsBackground); verifyPixels (bitmapBackground, bpp32RgbPixels); GdipDisposeImage ((GpImage *) bitmapBackground); GdipDisposeImage ((GpImage *) bitmap); } static void test_world_transform_in_container () { GpStatus status; GpImage *image; GpGraphics *graphics; GraphicsContainer state; GpMatrix *matrix; GpMatrix *setMatrix; graphics = getImageGraphics (&image); status = GdipCreateMatrix2 (0, 0, 0, 0, 0, 0, &matrix); assertEqualInt (status, Ok); status = GdipCreateMatrix2 (2, 0, 0, 2, 10, 20, &setMatrix); assertEqualInt (status, Ok); status = GdipSetWorldTransform (graphics, setMatrix); assertEqualInt (status, Ok); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); BOOL result; GdipIsMatrixEqual (matrix, setMatrix, &result); assertEqualInt (result, 1); status = GdipBeginContainer2 (graphics, &state); assertEqualInt (status, Ok); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); GdipIsMatrixIdentity (matrix, &result); assertEqualInt (result, 1); status = GdipSetWorldTransform (graphics, setMatrix); assertEqualInt (status, Ok); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); GdipIsMatrixEqual (matrix, setMatrix, &result); assertEqualInt (result, 1); status = GdipResetWorldTransform (graphics); assertEqualInt (status, Ok); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); GdipIsMatrixIdentity (matrix, &result); assertEqualInt (result, 1); status = GdipEndContainer (graphics, state); assertEqualInt (status, Ok); status = GdipGetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); GdipIsMatrixEqual (matrix, setMatrix, &result); assertEqualInt (result, 1); GdipDeleteMatrix (matrix); GdipDeleteMatrix (setMatrix); GdipDisposeImage (image); GdipDeleteGraphics (graphics); } static void test_world_transform_respects_page_unit_document () { GpStatus status; GpBitmap *bitmap; GpGraphics *graphics; GpMatrix *matrix; GpSolidFill *brush; // Test Graphics with UnitDocument and 72 dpi status = GdipCreateBitmapFromScan0 (612, 792, 0, PixelFormat32bppARGB, NULL, &bitmap); assertEqualInt (status, Ok); status = GdipBitmapSetResolution (bitmap, 72, 72); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext (bitmap, &graphics); assertEqualInt (status, Ok); status = GdipSetPageUnit (graphics, UnitDocument); assertEqualInt (status, Ok); const ARGB FillColor = 0xFF000000; status = GdipCreateSolidFill (FillColor, &brush); assertEqualInt (status, Ok); int rectX = 360; int rectY = 111; GdipCreateMatrix2 (1, 0, 0, 1, rectX, rectY, &matrix); status = GdipSetWorldTransform (graphics, matrix); assertEqualInt (status, Ok); int rectWidth = 74; int rectHeight = 72; status = GdipFillRectangleI (graphics, brush, 0, 0, rectWidth, rectHeight); assertEqualInt (status, Ok); //CLSID png_clsid = { 0x557cf406, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; //WCHAR *filePath = createWchar ("test_world_transform_respects_page_unit_document.png"); //status = GdipSaveImageToFile (bitmap, filePath, &png_clsid, NULL); int points[] = { rectX + 2, rectY + 2, rectX + rectWidth / 2, rectY + rectHeight / 2, rectX + rectWidth - 1, rectY + rectHeight - 1 }; for (int i = 0; i < sizeof (points) / sizeof (points[0]); i += 2) { ARGB color; status = GdipBitmapGetPixel (bitmap, (int)(points[i] * 72 / 300.0f), (int)(points[i + 1] * 72 / 300.0f), &color); assertEqualInt (status, Ok); assertEqualInt (color, FillColor); } GdipDisposeImage ((GpImage *)bitmap); GdipDeleteGraphics (graphics); GdipDeleteBrush (brush); } static void test_world_transform_respects_page_unit_point () { GpStatus status; GpBitmap *bitmap; GpGraphics *graphics; GpSolidFill *brush; const float TargetResolution = 300; double scaleFactor = TargetResolution / 72; // Test Graphics with UnitPoint and 72 dpi status = GdipCreateBitmapFromScan0 ((int)(612 * scaleFactor), (int)(792 * scaleFactor), 0, PixelFormat32bppARGB, NULL, &bitmap); assertEqualInt (status, Ok); status = GdipBitmapSetResolution (bitmap, TargetResolution, TargetResolution); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext (bitmap, &graphics); assertEqualInt (status, Ok); status = GdipSetPageUnit (graphics, UnitPoint); assertEqualInt (status, Ok); const ARGB FillColor = 0xFF000000; status = GdipCreateSolidFill (FillColor, &brush); assertEqualInt (status, Ok); int rectX = 360; int rectY = 111; int rectWidth = 74; int rectHeight = 72; status = GdipTranslateWorldTransform (graphics, rectX, rectY, MatrixOrderPrepend); assertEqualInt (status, Ok); status = GdipFillRectangleI (graphics, brush, 0, 0, rectWidth, rectHeight); assertEqualInt (status, Ok); //CLSID png_clsid = { 0x557cf406, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; //WCHAR *filePath = createWchar ("test_world_transform_respects_page_unit_point.png"); //status = GdipSaveImageToFile (bitmap, filePath, &png_clsid, NULL); int points[] = { rectX, rectY, rectX + rectWidth / 2, rectY + rectHeight / 2, rectX + rectWidth - 1, rectY + rectHeight - 1 }; for (int i = 0; i < sizeof (points) / sizeof (points[0]); i += 2) { ARGB color; status = GdipBitmapGetPixel (bitmap, points[i], points[i + 1], &color); assertEqualInt (status, Ok); assertEqualInt (color, 0); status = GdipBitmapGetPixel (bitmap, (int)(points[i] * scaleFactor) + 1, (int)(points[i + 1] * scaleFactor) + 1, &color); assertEqualInt (status, Ok); assertEqualInt (color, FillColor); } GdipDisposeImage ((GpImage *)bitmap); GdipDeleteGraphics (graphics); GdipDeleteBrush (brush); } int main (int argc, char**argv) { STARTUP; #if defined(USE_WINDOWS_GDIPLUS) WNDCLASS wc; HINSTANCE hInstance = GetModuleHandle (NULL); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = L"Window_Class"; RegisterClass (&wc); hwnd = CreateWindow (L"Window_Class", L"Window_Title", WS_OVERLAPPEDWINDOW, 20, 30, 500, 100, NULL, NULL, hInstance, NULL); #endif test_createFromHDC (); test_createFromHDC2 (); test_createFromHWND (); test_createFromHWNDICM (); test_hdc (); test_compositingMode (); test_compositingQuality (); test_renderingOrigin (); test_textRenderingHint (); test_textContrast (); test_smoothingMode (); test_pixelOffsetMode (); test_interpolationMode (); test_transform (); test_pageUnit (); test_pageScale (); test_dpiX (); test_dpiY (); test_flush (); test_delete (); test_rotateWorldTransform (); test_resetClip (); test_getClip (); test_getClipBounds (); test_getClipBoundsI (); test_getVisibleClipBounds (); test_getVisibleClipBoundsI (); test_isClipEmpty (); test_isVisibleClipEmpty (); test_setClipGraphics (); test_setClipHrgn (); test_setClipRect (); test_setClipRectI (); test_setClipRegion (); test_setClipPath (); test_translateClip (); test_translateClipI (); test_region_mask (); test_premultiplication (); test_world_transform_in_container (); test_world_transform_respects_page_unit_document (); test_world_transform_respects_page_unit_point (); #if defined(USE_WINDOWS_GDIPLUS) DestroyWindow (hwnd); #endif SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/testgraphicspath.c0000644000175000017500000033720313545154623022221 0ustar directhexdirecthex#ifdef _WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include "testhelpers.h" #if !defined(USE_WINDOWS_GDIPLUS) #include "../config.h" #endif static void verifyPathImpl (GpPath *path, FillMode expectedFillMode, float expectedX, float expectedY, float expectedWidth, float expectedHeight, const PointF *expectedPoints, const BYTE *expectedTypes, INT expectedCount, const char *message, const char *file, const char *function, int line) { GpStatus status; FillMode fillMode; RectF bounds; RectF expectedBounds = {expectedX, expectedY, expectedWidth, expectedHeight}; GpPathData pathData; pathData.Count = 16; pathData.Points = (PointF *) malloc (sizeof (PointF) * 16); pathData.Types = (BYTE *) malloc (sizeof (BYTE) * 16); status = GdipGetPathFillMode (path, &fillMode); assertEqualIntImpl (status, Ok, message, file, function, line); assertEqualIntImpl (fillMode, expectedFillMode, message, file, function, line); status = GdipGetPathWorldBounds (path, &bounds, NULL, NULL); assertEqualIntImpl (status, Ok, message, file, function, line); assertEqualRectImpl (bounds, expectedBounds, message, file, function, line); status = GdipGetPathData (path, &pathData); assertEqualIntImpl (status, Ok, message, file, function, line); assertEqualIntImpl (pathData.Count, expectedCount, message, file, function, line); assertEqualPointsFImpl (pathData.Points, expectedPoints, expectedCount, file, function, line); for (int i = 0; i < pathData.Count; i++) { char iChar[] = {(char) i + '0', '\0'}; assertEqualIntImpl (pathData.Types[i], expectedTypes[i], iChar, file, function, line); } #if !defined(USE_WINDOWS_GDIPLUS) free (pathData.Points); free (pathData.Types); #endif } #define verifyPath(path, expectedFillMode, expectedX, expectedY, expectedWidth, expectedHeight, expectedPoints, expectedTypes, expectedCount) \ verifyPathImpl (path, expectedFillMode, expectedX, expectedY, expectedWidth, expectedHeight, expectedPoints, expectedTypes, expectedCount, NULL, __FILE__, __func__, __LINE__) // A debug helper that simply saves the path out to an image for viewing and comparison with GDI+. ATTRIBUTE_USED static void dumpPath (GpPath *path) { GpStatus status; GpImage *image; GpGraphics *graphics; GpSolidFill *brush; WCHAR *fileName = createWchar ("test-image.bmp"); GdipCreateBitmapFromScan0 (256, 256, 0, PixelFormat32bppARGB, NULL, (GpBitmap **) &image); GdipGetImageGraphicsContext (image, &graphics); GdipCreateSolidFill (0xFF0000FF, &brush); GdipFillPath (graphics, brush, path); status = GdipSaveImageToFile (image, fileName, &bmpEncoderClsid, NULL); assertEqualInt (status, Ok); int systemResult = system ("test-image.bmp"); (void) systemResult; GdipDisposeImage (image); GdipDeleteGraphics (graphics); GdipDeleteBrush ((GpBrush *) brush); freeWchar (fileName); } static void test_createPath () { GpStatus status; GpPath *path; // FillModeAlternate. status = GdipCreatePath (FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // FillModeWinding. status = GdipCreatePath (FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid FillMode - positive. status = GdipCreatePath ((FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, Ok); verifyPath (path, (FillMode)(FillModeWinding + 1), 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid FillMode - negative. status = GdipCreatePath ((FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, Ok); verifyPath (path, (FillMode)(FillModeAlternate - 1), 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Negative tests. status = GdipCreatePath (FillModeWinding, NULL); assertEqualInt (status, InvalidParameter); } static void test_createPath2 () { GpStatus status; GpPath *path; PointF rectPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {14, 2}, {14, 6}, {11, 6}, {21, 2}, {24, 2}, {24, 6}, {21, 6}, }; BYTE rectTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE openRectTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; BYTE multiOpenAndClosedRectTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; PointF bezierPoints[] = { {1, 2}, {2, 4}, {3, 6}, {4, 8}, {11, 2}, {12, 4}, {13, 6}, {14, 8}, {21, 2}, {22, 4}, {23, 6}, {24, 8}, }; BYTE bezierTypes[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE openBezierTypes[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier }; BYTE multiOpenAndClosedBezierTypes[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier }; PointF rectBezierPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {12, 4}, {13, 6}, {14, 8}, {21, 2}, {24, 2}, {24, 6}, {21, 6}, {31, 2}, {32, 4}, {33, 6}, {34, 8} }; BYTE rectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE openRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier }; BYTE multiRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE multiOpenRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; BYTE multiOpenAndClosedRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE allStartTypes[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeStart, PathPointTypeStart | PathPointTypeCloseSubpath }; BYTE invalidMidType[] = { PathPointTypeStart, (PathPointType)4, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE invalidEndType[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, (PathPointType)4 | PathPointTypeCloseSubpath }; BYTE invalidPostEndType[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, (PathPointType)4 }; BYTE invalidBezierType2[] = { PathPointTypeStart, PathPointTypeBezier, (PathPointType)4, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE invalidBezierType3[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, (PathPointType)4 | PathPointTypeCloseSubpath }; BYTE midStartType1[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine }; BYTE midStartType2[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeStart, PathPointTypeStart }; BYTE invalidStartType[] = { (PathPointType)4, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE endStartType[] = { PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart }; BYTE openEndStartType[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeStart }; // Closed lines. status = GdipCreatePath2 (rectPoints, rectTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, rectPoints, rectTypes, 4); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, rectTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, rectPoints, rectTypes, 4); GdipDeletePath (path); // Open lines. status = GdipCreatePath2 (rectPoints, rectTypes, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, rectPoints, rectTypes, 2); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, rectTypes, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 0, rectPoints, rectTypes, 2); GdipDeletePath (path); // Multiple closed lines. status = GdipCreatePath2 (rectPoints, rectTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 4, rectPoints, rectTypes, 8); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, rectTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 4, rectPoints, rectTypes, 8); GdipDeletePath (path); // Multiple open lines. status = GdipCreatePath2 (rectPoints, openRectTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 4, rectPoints, openRectTypes, 8); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, openRectTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 4, rectPoints, openRectTypes, 8); GdipDeletePath (path); // Multiple open and closed lines. status = GdipCreatePath2 (rectPoints, multiOpenAndClosedRectTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 4, rectPoints, multiOpenAndClosedRectTypes, 12); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, multiOpenAndClosedRectTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 4, rectPoints, multiOpenAndClosedRectTypes, 12); GdipDeletePath (path); // Closed beziers. status = GdipCreatePath2 (bezierPoints, bezierTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 6, bezierPoints, bezierTypes, 4); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, bezierTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 6, bezierPoints, bezierTypes, 4); GdipDeletePath (path); // Open beziers. status = GdipCreatePath2 (bezierPoints, openBezierTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 6, bezierPoints, openBezierTypes, 4); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, openBezierTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 6, bezierPoints, openBezierTypes, 4); GdipDeletePath (path); // Multiple closed beziers. status = GdipCreatePath2 (bezierPoints, bezierTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 6, bezierPoints, bezierTypes, 8); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, bezierTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 6, bezierPoints, bezierTypes, 8); GdipDeletePath (path); // Multiple open beziers. status = GdipCreatePath2 (bezierPoints, openBezierTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 6, bezierPoints, openBezierTypes, 8); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, openBezierTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 6, bezierPoints, openBezierTypes, 8); GdipDeletePath (path); // Multiple open and closed beziers. status = GdipCreatePath2 (bezierPoints, multiOpenAndClosedBezierTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 6, bezierPoints, multiOpenAndClosedBezierTypes, 12); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, multiOpenAndClosedBezierTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 6, bezierPoints, multiOpenAndClosedBezierTypes, 12); GdipDeletePath (path); // Closed lines and rects. status = GdipCreatePath2 (rectBezierPoints, rectBezierTypes, 7, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 12, 4, rectBezierPoints, rectBezierTypes, 7); GdipDeletePath (path); status = GdipCreatePath2 (rectBezierPoints, rectBezierTypes, 7, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 12, 4, rectBezierPoints, rectBezierTypes, 7); GdipDeletePath (path); // Open lines and rects. status = GdipCreatePath2 (rectBezierPoints, openRectBezierTypes, 7, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 12, 4, rectBezierPoints, openRectBezierTypes, 7); GdipDeletePath (path); status = GdipCreatePath2 (rectBezierPoints, openRectBezierTypes, 7, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 12, 4, rectBezierPoints, openRectBezierTypes, 7); GdipDeletePath (path); // Multiple closed lines and rects. status = GdipCreatePath2 (rectBezierPoints, multiRectBezierTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 6, rectBezierPoints, multiRectBezierTypes, 12); GdipDeletePath (path); status = GdipCreatePath2 (rectBezierPoints, multiRectBezierTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 6, rectBezierPoints, multiRectBezierTypes, 12); GdipDeletePath (path); // Multiple open lines and rects. status = GdipCreatePath2 (rectBezierPoints, multiOpenRectBezierTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 6, rectBezierPoints, multiOpenRectBezierTypes, 12); GdipDeletePath (path); status = GdipCreatePath2 (rectBezierPoints, multiOpenRectBezierTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 6, rectBezierPoints, multiOpenRectBezierTypes, 12); GdipDeletePath (path); // Multiple open and closed lines and rects. status = GdipCreatePath2 (rectBezierPoints, multiOpenAndClosedRectBezierTypes, 16, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 33, 6, rectBezierPoints, multiOpenAndClosedRectBezierTypes, 16); GdipDeletePath (path); status = GdipCreatePath2 (rectBezierPoints, multiOpenAndClosedRectBezierTypes, 16, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 33, 6, rectBezierPoints, multiOpenAndClosedRectBezierTypes, 16); GdipDeletePath (path); // Only start. status = GdipCreatePath2 (rectPoints, rectTypes, 1, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPoints, rectTypes, 1); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, rectTypes, 1, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPoints, rectTypes, 1); GdipDeletePath (path); // Invalid start type multiple - normalizes. status = GdipCreatePath2 (rectPoints, invalidStartType, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, rectPoints, rectTypes, 4); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, invalidStartType, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, rectPoints, rectTypes, 4); GdipDeletePath (path); // Invalid start type single - normalizes. status = GdipCreatePath2 (rectPoints, invalidStartType, 1, FillModeAlternate, &path); assertEqualInt (status, Ok); BYTE zeroType[] = {0}; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPoints, zeroType, 1); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, invalidStartType, 1, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPoints, zeroType, 1); GdipDeletePath (path); // End start type closed - sets to empty. status = GdipCreatePath2 (rectPoints, endStartType, 3, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, endStartType, 3, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // End start type open - sets to empty. status = GdipCreatePath2 (rectPoints, openEndStartType, 3, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, openEndStartType, 3, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid mid type - sets to empty. status = GdipCreatePath2 (rectPoints, invalidMidType, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, invalidMidType, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid end type - sets to empty. status = GdipCreatePath2 (rectPoints, invalidEndType, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, invalidEndType, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid post end type - sets to empty. status = GdipCreatePath2 (rectPoints, invalidPostEndType, 5, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, invalidPostEndType, 5, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Missing 2 bezier points - sets to empty. status = GdipCreatePath2 (bezierPoints, bezierTypes, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, bezierTypes, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Missing 1 bezier point - sets to empty. status = GdipCreatePath2 (bezierPoints, bezierTypes, 3, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, bezierTypes, 3, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid second bezier point - sets to empty. status = GdipCreatePath2 (bezierPoints, invalidBezierType2, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, invalidBezierType2, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid third bezier point - sets to empty. status = GdipCreatePath2 (bezierPoints, invalidBezierType3, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (bezierPoints, invalidBezierType3, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Only start - sets to empty. status = GdipCreatePath2 (rectPoints, allStartTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPoints, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, allStartTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPoints, NULL, 0); GdipDeletePath (path); // Only start open - sets to empty. status = GdipCreatePath2 (rectPoints, midStartType1, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPoints, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, midStartType2, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPoints, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, midStartType1, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPoints, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2 (rectPoints, midStartType2, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPoints, NULL, 0); GdipDeletePath (path); // Negative tests. status = GdipCreatePath2 (NULL, rectTypes, 2, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (NULL, rectTypes, 0, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (NULL, rectTypes, -1, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (NULL, rectTypes, 2, (FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (NULL, rectTypes, 2, (FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (NULL, NULL, 0, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, NULL, 2, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, NULL, 0, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, NULL, -1, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, NULL, 2, (FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, NULL, 2, (FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, rectTypes, 0, FillModeAlternate, &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2 (rectPoints, rectTypes, -1, FillModeAlternate, &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2 (rectPoints, rectTypes, 2, (FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2 (rectPoints, rectTypes, 2, (FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2 (rectPoints, rectTypes, 2, FillModeAlternate, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, rectTypes, -1, FillModeAlternate, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, rectTypes, 2, (FillMode)(FillModeWinding + 1), NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2 (rectPoints, rectTypes, 2, (FillMode)(FillModeAlternate - 1), NULL); assertEqualInt (status, InvalidParameter); } static void test_createPath2I () { GpStatus status; GpPath *path; Point rectPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {14, 2}, {14, 6}, {11, 6}, {21, 2}, {24, 2}, {24, 6}, {21, 6}, }; PointF rectPointsF[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {14, 2}, {14, 6}, {11, 6}, {21, 2}, {24, 2}, {24, 6}, {21, 6}, }; BYTE rectTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE openRectTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; BYTE multiOpenAndClosedRectTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; Point bezierPoints[] = { {1, 2}, {2, 4}, {3, 6}, {4, 8}, {11, 2}, {12, 4}, {13, 6}, {14, 8}, {21, 2}, {22, 4}, {23, 6}, {24, 8}, }; PointF bezierPointsF[] = { {1, 2}, {2, 4}, {3, 6}, {4, 8}, {11, 2}, {12, 4}, {13, 6}, {14, 8}, {21, 2}, {22, 4}, {23, 6}, {24, 8}, }; BYTE bezierTypes[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE openBezierTypes[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier }; BYTE multiOpenAndClosedBezierTypes[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier }; Point rectBezierPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {12, 4}, {13, 6}, {14, 8}, {21, 2}, {24, 2}, {24, 6}, {21, 6}, {31, 2}, {32, 4}, {33, 6}, {34, 8} }; PointF rectBezierPointsF[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {12, 4}, {13, 6}, {14, 8}, {21, 2}, {24, 2}, {24, 6}, {21, 6}, {31, 2}, {32, 4}, {33, 6}, {34, 8} }; BYTE rectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE openRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier }; BYTE multiRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE multiOpenRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; BYTE multiOpenAndClosedRectBezierTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE allStartTypes[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeStart, PathPointTypeStart | PathPointTypeCloseSubpath }; BYTE invalidMidType[] = { PathPointTypeStart, (PathPointType)4, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE invalidEndType[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, (PathPointType)4 | PathPointTypeCloseSubpath }; BYTE invalidPostEndType[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, (PathPointType)4 }; BYTE invalidBezierType2[] = { PathPointTypeStart, PathPointTypeBezier, (PathPointType)4, PathPointTypeBezier | PathPointTypeCloseSubpath }; BYTE invalidBezierType3[] = { PathPointTypeStart, PathPointTypeBezier, PathPointTypeBezier, (PathPointType)4 | PathPointTypeCloseSubpath }; BYTE midStartType1[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine }; BYTE midStartType2[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeStart, PathPointTypeStart }; BYTE invalidStartType[] = { (PathPointType)4, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE endStartType[] = { PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart }; BYTE openEndStartType[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeStart }; // Closed lines. status = GdipCreatePath2I (rectPoints, rectTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, rectPointsF, rectTypes, 4); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, rectTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, rectPointsF, rectTypes, 4); GdipDeletePath (path); // Open lines. status = GdipCreatePath2I (rectPoints, rectTypes, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, rectPointsF, rectTypes, 2); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, rectTypes, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 0, rectPointsF, rectTypes, 2); GdipDeletePath (path); // Multiple closed lines. status = GdipCreatePath2I (rectPoints, rectTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 4, rectPointsF, rectTypes, 8); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, rectTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 4, rectPointsF, rectTypes, 8); GdipDeletePath (path); // Multiple open lines. status = GdipCreatePath2I (rectPoints, openRectTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 4, rectPointsF, openRectTypes, 8); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, openRectTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 4, rectPointsF, openRectTypes, 8); GdipDeletePath (path); // Multiple open and closed lines. status = GdipCreatePath2I (rectPoints, multiOpenAndClosedRectTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 4, rectPointsF, multiOpenAndClosedRectTypes, 12); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, multiOpenAndClosedRectTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 4, rectPointsF, multiOpenAndClosedRectTypes, 12); GdipDeletePath (path); // Closed beziers. status = GdipCreatePath2I (bezierPoints, bezierTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 6, bezierPointsF, bezierTypes, 4); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, bezierTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 6, bezierPointsF, bezierTypes, 4); GdipDeletePath (path); // Open beziers. status = GdipCreatePath2I (bezierPoints, openBezierTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 6, bezierPointsF, openBezierTypes, 4); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, openBezierTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 6, bezierPointsF, openBezierTypes, 4); GdipDeletePath (path); // Multiple closed beziers. status = GdipCreatePath2I (bezierPoints, bezierTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 6, bezierPointsF, bezierTypes, 8); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, bezierTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 6, bezierPointsF, bezierTypes, 8); GdipDeletePath (path); // Multiple open beziers. status = GdipCreatePath2I (bezierPoints, openBezierTypes, 8, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 6, bezierPointsF, openBezierTypes, 8); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, openBezierTypes, 8, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 6, bezierPointsF, openBezierTypes, 8); GdipDeletePath (path); // Multiple open and closed beziers. status = GdipCreatePath2I (bezierPoints, multiOpenAndClosedBezierTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 6, bezierPointsF, multiOpenAndClosedBezierTypes, 12); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, multiOpenAndClosedBezierTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 6, bezierPointsF, multiOpenAndClosedBezierTypes, 12); GdipDeletePath (path); // Closed lines and rects. status = GdipCreatePath2I (rectBezierPoints, rectBezierTypes, 7, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 12, 4, rectBezierPointsF, rectBezierTypes, 7); GdipDeletePath (path); status = GdipCreatePath2I (rectBezierPoints, rectBezierTypes, 7, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 12, 4, rectBezierPointsF, rectBezierTypes, 7); GdipDeletePath (path); // Open lines and rects. status = GdipCreatePath2I (rectBezierPoints, openRectBezierTypes, 7, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 12, 4, rectBezierPointsF, openRectBezierTypes, 7); GdipDeletePath (path); status = GdipCreatePath2I (rectBezierPoints, openRectBezierTypes, 7, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 12, 4, rectBezierPointsF, openRectBezierTypes, 7); GdipDeletePath (path); // Multiple closed lines and rects. status = GdipCreatePath2I (rectBezierPoints, multiRectBezierTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 6, rectBezierPointsF, multiRectBezierTypes, 12); GdipDeletePath (path); status = GdipCreatePath2I (rectBezierPoints, multiRectBezierTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 6, rectBezierPointsF, multiRectBezierTypes, 12); GdipDeletePath (path); // Multiple open lines and rects. status = GdipCreatePath2I (rectBezierPoints, multiOpenRectBezierTypes, 12, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 23, 6, rectBezierPointsF, multiOpenRectBezierTypes, 12); GdipDeletePath (path); status = GdipCreatePath2I (rectBezierPoints, multiOpenRectBezierTypes, 12, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 23, 6, rectBezierPointsF, multiOpenRectBezierTypes, 12); GdipDeletePath (path); // Multiple open and closed lines and rects. status = GdipCreatePath2I (rectBezierPoints, multiOpenAndClosedRectBezierTypes, 16, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 33, 6, rectBezierPointsF, multiOpenAndClosedRectBezierTypes, 16); GdipDeletePath (path); status = GdipCreatePath2I (rectBezierPoints, multiOpenAndClosedRectBezierTypes, 16, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 33, 6, rectBezierPointsF, multiOpenAndClosedRectBezierTypes, 16); GdipDeletePath (path); // Only start. status = GdipCreatePath2I (rectPoints, rectTypes, 1, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPointsF, rectTypes, 1); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, rectTypes, 1, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPointsF, rectTypes, 1); GdipDeletePath (path); // Invalid start type multiple - normalizes. status = GdipCreatePath2I (rectPoints, invalidStartType, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, rectPointsF, rectTypes, 4); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, invalidStartType, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, rectPointsF, rectTypes, 4); GdipDeletePath (path); // Invalid start type single - normalizes. status = GdipCreatePath2I (rectPoints, invalidStartType, 1, FillModeAlternate, &path); assertEqualInt (status, Ok); BYTE zeroType[] = {0}; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPointsF, zeroType, 1); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, invalidStartType, 1, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPointsF, zeroType, 1); GdipDeletePath (path); // End start type closed - sets to empty. status = GdipCreatePath2I (rectPoints, endStartType, 3, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, endStartType, 3, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // End start type open - sets to empty. status = GdipCreatePath2I (rectPoints, openEndStartType, 3, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, openEndStartType, 3, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid mid type - sets to empty. status = GdipCreatePath2I (rectPoints, invalidMidType, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, invalidMidType, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid end type - sets to empty. status = GdipCreatePath2I (rectPoints, invalidEndType, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, invalidEndType, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid post end type - sets to empty. status = GdipCreatePath2I (rectPoints, invalidPostEndType, 5, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, invalidPostEndType, 5, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Missing 2 bezier points - sets to empty. status = GdipCreatePath2I (bezierPoints, bezierTypes, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, bezierTypes, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Missing 1 bezier point - sets to empty. status = GdipCreatePath2I (bezierPoints, bezierTypes, 3, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, bezierTypes, 3, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid second bezier point - sets to empty. status = GdipCreatePath2I (bezierPoints, invalidBezierType2, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, invalidBezierType2, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Invalid third bezier point - sets to empty. status = GdipCreatePath2I (bezierPoints, invalidBezierType3, 2, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (bezierPoints, invalidBezierType3, 2, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Only start - sets to empty. status = GdipCreatePath2I (rectPoints, allStartTypes, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPointsF, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, allStartTypes, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPointsF, NULL, 0); GdipDeletePath (path); // Only start open - sets to empty. status = GdipCreatePath2I (rectPoints, midStartType1, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPointsF, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, midStartType2, 4, FillModeAlternate, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, rectPointsF, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, midStartType1, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPointsF, NULL, 0); GdipDeletePath (path); status = GdipCreatePath2I (rectPoints, midStartType2, 4, FillModeWinding, &path); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, rectPointsF, NULL, 0); GdipDeletePath (path); // Negative tests. status = GdipCreatePath2I (NULL, rectTypes, 2, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (NULL, rectTypes, 0, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (NULL, rectTypes, -1, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (NULL, rectTypes, 2, (FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (NULL, rectTypes, 2, (FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (NULL, NULL, 0, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, NULL, 2, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, NULL, 0, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, NULL, -1, FillModeAlternate, &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, NULL, 2, (FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, NULL, 2, (FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, rectTypes, 0, FillModeAlternate, &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2I (rectPoints, rectTypes, -1, FillModeAlternate, &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2I (rectPoints, rectTypes, 2, (FillMode)(FillModeWinding + 1), &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2I (rectPoints, rectTypes, 2, (FillMode)(FillModeAlternate - 1), &path); assertEqualInt (status, OutOfMemory); status = GdipCreatePath2I (rectPoints, rectTypes, 2, FillModeAlternate, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, rectTypes, -1, FillModeAlternate, NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, rectTypes, 2, (FillMode)(FillModeWinding + 1), NULL); assertEqualInt (status, InvalidParameter); status = GdipCreatePath2I (rectPoints, rectTypes, 2, (FillMode)(FillModeAlternate - 1), NULL); assertEqualInt (status, InvalidParameter); } static void test_clonePath () { GpStatus status; GpPath *path; GpPath *clonePath; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; // Empty - FillModeAlternate. GdipCreatePath (FillModeAlternate, &path); status = GdipClonePath (path, &clonePath); assertEqualInt (status, Ok); verifyPath (clonePath, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); GdipDeletePath (clonePath); // Empty - FillModeWinding. GdipCreatePath (FillModeWinding, &path); status = GdipClonePath (path, &clonePath); assertEqualInt (status, Ok); verifyPath (clonePath, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); GdipDeletePath (clonePath); // Empty - invalid FillMode. GdipCreatePath ((FillMode)(FillModeWinding + 1), &path); status = GdipClonePath (path, &clonePath); assertEqualInt (status, Ok); verifyPath (clonePath, (FillMode)(FillModeWinding + 1), 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); GdipDeletePath (clonePath); // Non Empty - FillModeAlternate. GdipCreatePath2 (points, types, 4, FillModeAlternate, &path); status = GdipClonePath (path, &clonePath); assertEqualInt (status, Ok); verifyPath (clonePath, FillModeAlternate, 1, 2, 3, 4, points, types, 4); GdipDeletePath (path); GdipDeletePath (clonePath); // Non Empty - FillModeWinding. GdipCreatePath2 (points, types, 4, FillModeWinding, &path); status = GdipClonePath (path, &clonePath); assertEqualInt (status, Ok); verifyPath (clonePath, FillModeWinding, 1, 2, 3, 4, points, types, 4); GdipDeletePath (path); GdipDeletePath (clonePath); // Negative tests. status = GdipClonePath (NULL, &clonePath); assertEqualInt (status, InvalidParameter); status = GdipClonePath (path, NULL); assertEqualInt (status, InvalidParameter); } static void test_deletePath () { GpStatus status; GpPath *path; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipDeletePath (path); assertEqualInt (status, Ok); // Non Empty - FillModeAlternate. GdipCreatePath2 (points, types, 4, FillModeAlternate, &path); status = GdipDeletePath (path); assertEqualInt (status, Ok); // Negative tests. status = GdipDeletePath (NULL); assertEqualInt (status, InvalidParameter); } static void test_resetPath () { GpStatus status; GpPath *path; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; // Empty. GdipCreatePath (FillModeWinding, &path); status = GdipResetPath (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Non Empty. GdipCreatePath2 (points, types, 4, FillModeWinding, &path); status = GdipResetPath (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Negative tests. status = GdipResetPath (NULL); assertEqualInt (status, InvalidParameter); } static void test_getPointCount () { GpStatus status; GpPath *emptyPath; GpPath *path; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; INT count; GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (points, types, 4, FillModeWinding, &path); // Empty. status = GdipGetPointCount (emptyPath, &count); assertEqualInt (status, Ok); assertEqualInt (count, 0); // Non Empty. GdipCreatePath2 (points, types, 4, FillModeWinding, &path); status = GdipGetPointCount (path, &count); assertEqualInt (status, Ok); assertEqualInt (count, 4); // Negative tests. status = GdipGetPointCount (NULL, &count); assertEqualInt (status, InvalidParameter); status = GdipGetPointCount (path, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (emptyPath); GdipDeletePath (path); } static void test_getPathTypes () { GpStatus status; GpPath *emptyPath; GpPath *path; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; BYTE buffer[] = {0, 0, 0, 0, 0, 0}; GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (points, types, 4, FillModeWinding, &path); // Empty - greater than. status = GdipGetPathTypes (emptyPath, buffer, 1); assertEqualInt (status, Ok); BYTE emptyExpected[] = {0, 0, 0, 0, 0, 0}; assertEqualBytes (buffer, emptyExpected, sizeof (emptyExpected)); // Non empty - exact. status = GdipGetPathTypes (path, buffer, 4); assertEqualInt (status, Ok); BYTE nonEmptyExpected[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, 0, 0 }; assertEqualBytes (buffer, nonEmptyExpected, sizeof (nonEmptyExpected)); // Non empty - greater. status = GdipGetPathTypes (path, buffer, 10); assertEqualInt (status, Ok); assertEqualBytes (buffer, nonEmptyExpected, sizeof (nonEmptyExpected)); // Negative tests. status = GdipGetPathTypes (NULL, buffer, 4); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (NULL, buffer, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (path, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (path, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (emptyPath, buffer, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (emptyPath, buffer, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (path, buffer, 3); assertEqualInt (status, InsufficientBuffer); status = GdipGetPathTypes (path, buffer, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathTypes (path, buffer, -1); assertEqualInt (status, InvalidParameter); GdipDeletePath (emptyPath); GdipDeletePath (path); } static void test_getPathPoints () { GpStatus status; GpPath *emptyPath; GpPath *path; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6} }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; PointF buffer[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }; GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (points, types, 4, FillModeWinding, &path); // Empty - greater than. status = GdipGetPathPoints (emptyPath, buffer, 1); assertEqualInt (status, Ok); PointF emptyExpected[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }; assertEqualPointsF (buffer, emptyExpected, sizeof (emptyExpected) / sizeof (PointF)); // Non empty - exact. status = GdipGetPathPoints (path, buffer, 4); assertEqualInt (status, Ok); PointF nonEmptyExpected[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {0, 0}, {0, 0} }; assertEqualPointsF (buffer, nonEmptyExpected, sizeof (nonEmptyExpected) / sizeof (PointF)); // Non empty - greater. status = GdipGetPathPoints (path, buffer, 10); assertEqualInt (status, Ok); assertEqualPointsF (buffer, nonEmptyExpected, sizeof (nonEmptyExpected) / sizeof (PointF)); // Negative tests. status = GdipGetPathPoints (NULL, buffer, 4); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (NULL, buffer, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (path, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (path, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (emptyPath, buffer, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (emptyPath, buffer, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (path, buffer, 3); assertEqualInt (status, InsufficientBuffer); status = GdipGetPathPoints (path, buffer, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathPoints (path, buffer, -1); assertEqualInt (status, InvalidParameter); GdipDeletePath (emptyPath); GdipDeletePath (path); } static void test_getPathPointsI () { GpStatus status; GpPath *emptyPath; GpPath *path; PointF pointsZero[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6} }; PointF pointsLessThanPointFive[] = { {1.4f, 2.4f}, {4.4f, 2.4f}, {4.4f, 6.4f}, {1.4f, 6.4f} }; PointF pointsPointFive[] = { {1.5f, 2.5f}, {4.5f, 2.5f}, {4.5f, 6.5f}, {1.5f, 6.5f} }; PointF pointsGreaterThanPointFive[] = { {1.6f, 2.6f}, {4.6f, 2.6f}, {4.6f, 6.6f}, {1.6f, 6.6f} }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; Point buffer[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }; GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (pointsZero, types, 4, FillModeWinding, &path); // Empty - greater than. // Causes an overflow in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetPathPointsI (emptyPath, buffer, 1); assertEqualInt (status, Ok); Point emptyExpected[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }; assertEqualPoints (buffer, emptyExpected, sizeof (emptyExpected) / sizeof (Point)); #endif // Non empty - exact. status = GdipGetPathPointsI (path, buffer, 4); assertEqualInt (status, Ok); Point nonEmptyExpected[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {0, 0}, {0, 0} }; assertEqualPoints (buffer, nonEmptyExpected, sizeof (nonEmptyExpected) / sizeof (Point)); // Non empty - greater. // Causes an overflow in GDI+. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipGetPathPointsI (path, buffer, 10); assertEqualInt (status, Ok); assertEqualPoints (buffer, nonEmptyExpected, sizeof (nonEmptyExpected) / sizeof (Point)); #endif GdipDeletePath (path); // Non empty < 0.5. GdipCreatePath2 (pointsLessThanPointFive, types, 4, FillModeWinding, &path); status = GdipGetPathPointsI (path, buffer, 4); assertEqualInt (status, Ok); Point lessThanPointFiveExpected[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {0, 0}, {0, 0} }; assertEqualPoints (buffer, lessThanPointFiveExpected, sizeof (lessThanPointFiveExpected) / sizeof (Point)); GdipDeletePath (path); // Non empty = 0.5. GdipCreatePath2 (pointsPointFive, types, 4, FillModeWinding, &path); status = GdipGetPathPointsI (path, buffer, 4); assertEqualInt (status, Ok); Point pointFiveExpected[] = { {2, 3}, {5, 3}, {5, 7}, {2, 7}, {0, 0}, {0, 0} }; assertEqualPoints (buffer, pointFiveExpected, sizeof (pointFiveExpected) / sizeof (Point)); GdipDeletePath (path); // Non empty < 0.5. GdipCreatePath2 (pointsGreaterThanPointFive, types, 4, FillModeWinding, &path); status = GdipGetPathPointsI (path, buffer, 4); assertEqualInt (status, Ok); Point pointsGreaterThanPointFiveExpected[] = { {2, 3}, {5, 3}, {5, 7}, {2, 7}, {0, 0}, {0, 0} }; assertEqualPoints (buffer, pointsGreaterThanPointFiveExpected, sizeof (pointsGreaterThanPointFiveExpected) / sizeof (Point)); // Negative tests. status = GdipGetPathPointsI (NULL, buffer, 4); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (NULL, buffer, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (path, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (path, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (emptyPath, buffer, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (emptyPath, buffer, -1); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (path, buffer, 3); assertEqualInt (status, InsufficientBuffer); status = GdipGetPathPointsI (path, buffer, 0); assertEqualInt (status, InvalidParameter); status = GdipGetPathPointsI (path, buffer, -1); assertEqualInt (status, InvalidParameter); GdipDeletePath (emptyPath); GdipDeletePath (path); } static void test_getPathData () { GpStatus status; GpPath *emptyPath; GpPath *path; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; GpPathData data; GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (points, types, 4, FillModeWinding, &path); // Empty - equal. data.Count = 0; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (emptyPath, &data); assertEqualInt (status, Ok); PointF emptyExpectedPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }; BYTE emptyExpectedTypes[] = {0, 0, 0, 0, 0, 0}; assertEqualInt (0, data.Count); assertEqualPointsF (data.Points, emptyExpectedPoints, sizeof (emptyExpectedPoints) / sizeof (PointF)); assertEqualBytes (data.Types, emptyExpectedTypes, sizeof (emptyExpectedTypes)); free (data.Points); free (data.Types); // Empty - greater than. data.Count = 10; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (emptyPath, &data); assertEqualInt (status, Ok); assertEqualInt (0, data.Count); assertEqualPointsF (data.Points, emptyExpectedPoints, sizeof (emptyExpectedPoints) / sizeof (PointF)); assertEqualBytes (data.Types, emptyExpectedTypes, sizeof (emptyExpectedTypes)); free (data.Points); free (data.Types); // Non empty - exact. data.Count = 4; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (path, &data); assertEqualInt (status, Ok); PointF nonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {0, 0}, {0, 0} }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, 0, 0 }; assertEqualInt (4, data.Count); assertEqualPointsF (data.Points, nonEmptyExpectedPoints, sizeof (nonEmptyExpectedPoints) / sizeof (PointF)); assertEqualBytes (data.Types, nonEmptyExpectedTypes, sizeof (nonEmptyExpectedTypes)); free (data.Points); free (data.Types); // Non empty - greater. data.Count = 10; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (path, &data); assertEqualInt (status, Ok); assertEqualInt (4, data.Count); assertEqualPointsF (data.Points, nonEmptyExpectedPoints, sizeof (nonEmptyExpectedPoints) / sizeof (PointF)); assertEqualBytes (data.Types, nonEmptyExpectedTypes, sizeof (nonEmptyExpectedTypes)); free (data.Points); free (data.Types); // Negative tests. status = GdipGetPathData (NULL, &data); assertEqualInt (status, InvalidParameter); status = GdipGetPathData (path, NULL); assertEqualInt (status, InvalidParameter); data.Count = 10; data.Points = NULL; data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (path, &data); assertEqualInt (status, InvalidParameter); free (data.Types); data.Count = 10; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = NULL; status = GdipGetPathData (emptyPath, &data); assertEqualInt (status, InvalidParameter); status = GdipGetPathData (path, &data); assertEqualInt (status, InvalidParameter); free (data.Points); data.Count = 1; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (path, &data); assertEqualInt (status, OutOfMemory); free (data.Points); free (data.Types); data.Count = 0; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (path, &data); assertEqualInt (status, OutOfMemory); free (data.Points); free (data.Types); data.Count = -1; data.Points = (PointF *) calloc (6, sizeof (PointF)); data.Types = (BYTE *) calloc (6, sizeof (BYTE)); status = GdipGetPathData (emptyPath, &data); assertEqualInt (status, InvalidParameter); status = GdipGetPathData (path, &data); assertEqualInt (status, InvalidParameter); #if !defined(USE_WINDOWS_GDIPLUS) free (data.Points); free (data.Types); #endif GdipDeletePath (emptyPath); GdipDeletePath (path); } static void test_getPathFillMode () { GpStatus status; GpPath *path; FillMode fillMode; GdipCreatePath (FillModeAlternate, &path); // Negative tests. status = GdipGetPathFillMode (NULL, &fillMode); assertEqualInt (status, InvalidParameter); status = GdipGetPathFillMode (path, NULL); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); } static void test_setPathFillMode () { GpStatus status; GpPath *path; FillMode fillMode; GdipCreatePath (FillModeWinding, &path); // FillModeAlternate. status = GdipSetPathFillMode (path, FillModeAlternate); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, FillModeAlternate); status = GdipSetPathFillMode (path, FillModeAlternate); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, FillModeAlternate); // FillModeWinding. status = GdipSetPathFillMode (path, FillModeWinding); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, FillModeWinding); status = GdipSetPathFillMode (path, FillModeWinding); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, FillModeWinding); // Invalid FillMode - positive. status = GdipSetPathFillMode (path, (FillMode)(FillModeWinding + 1)); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, (FillMode)(FillModeWinding + 1)); status = GdipSetPathFillMode (path, (FillMode)(FillModeWinding + 1)); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, (FillMode)(FillModeWinding + 1)); // Invalid FillMode - negative. status = GdipSetPathFillMode (path, (FillMode)(FillModeAlternate - 1)); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, (FillMode)(FillModeAlternate - 1)); status = GdipSetPathFillMode (path, (FillMode)(FillModeAlternate - 1)); assertEqualInt (status, Ok); GdipGetPathFillMode (path, &fillMode); assertEqualInt (fillMode, (FillMode)(FillModeAlternate - 1)); // Negative tests. status = GdipSetPathFillMode (NULL, FillModeAlternate); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); } static void test_startPathFigure () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipStartPathFigure (path); assertEqualInt (status, Ok); PointF emptyExpectedPoints[] = { {1, 2}, {4, 2} }; BYTE emptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, emptyExpectedPoints, emptyExpectedTypes, 0); GdipAddPathLine (path, 1, 2, 4, 2); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, emptyExpectedPoints, emptyExpectedTypes, 2); GdipDeletePath (path); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipStartPathFigure (path); assertEqualInt (status, Ok); PointF singleExpectedPoints[] = { {1, 2}, {1, 2}, {4, 2} }; BYTE singleExpectedTypes[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, singleExpectedPoints, singleExpectedTypes, 1); GdipAddPathLine (path, 1, 2, 4, 2); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, singleExpectedPoints, singleExpectedTypes, 3); GdipDeletePath (path); // Non Empty. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); status = GdipStartPathFigure (path); assertEqualInt (status, Ok); PointF nonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 2}, {4, 6} }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 1, 2, 3, 0, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 2); GdipAddPathLine (path, 4, 2, 4, 6); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 4); GdipDeletePath (path); // Negative tests. status = GdipStartPathFigure (NULL); assertEqualInt (status, InvalidParameter); } static void test_closePathFigure () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipClosePathFigure (path); assertEqualInt (status, Ok); PointF emptyExpectedPoints[] = { {1, 2}, {4, 2} }; BYTE emptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, emptyExpectedPoints, emptyExpectedTypes, 0); GdipAddPathLine (path, 1, 2, 4, 2); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, emptyExpectedPoints, emptyExpectedTypes, 2); GdipDeletePath (path); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipClosePathFigure (path); assertEqualInt (status, Ok); PointF singleExpectedPoints[] = { {1, 2}, {1, 2}, {4, 2} }; BYTE singleExpectedTypes[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, singleExpectedPoints, singleExpectedTypes, 1); GdipAddPathLine (path, 1, 2, 4, 2); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, singleExpectedPoints, singleExpectedTypes, 3); GdipDeletePath (path); // Non Empty - single open. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); status = GdipClosePathFigure (path); assertEqualInt (status, Ok); PointF nonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 2}, {4, 6} }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 1, 2, 3, 0, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 2); GdipAddPathLine (path, 4, 2, 4, 6); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 4); GdipDeletePath (path); // Non Empty - several open. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); GdipStartPathFigure (path); GdipAddPathLine (path, 4, 2, 4, 6); GdipStartPathFigure (path); GdipAddPathLine (path, 4, 6, 1, 6); status = GdipClosePathFigure (path); assertEqualInt (status, Ok); PointF severalNonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 2}, {4, 6}, {4, 6}, {1, 6}, }; BYTE severalNonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine, PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeAlternate, 1, 2, 3, 4, severalNonEmptyExpectedPoints, severalNonEmptyExpectedTypes, 6); GdipDeletePath (path); // Negative tests. status = GdipClosePathFigure (NULL); assertEqualInt (status, InvalidParameter); } static void test_closePathFigures () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipClosePathFigures (path); assertEqualInt (status, Ok); PointF emptyExpectedPoints[] = { {1, 2}, {4, 2} }; BYTE emptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, emptyExpectedPoints, emptyExpectedTypes, 0); GdipAddPathLine (path, 1, 2, 4, 2); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, emptyExpectedPoints, emptyExpectedTypes, 2); GdipDeletePath (path); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipClosePathFigures (path); assertEqualInt (status, Ok); PointF singleExpectedPoints[] = { {1, 2}, {1, 2}, {4, 2} }; BYTE singleExpectedTypes[] = { PathPointTypeStart, PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, singleExpectedPoints, singleExpectedTypes, 1); GdipAddPathLine (path, 1, 2, 4, 2); verifyPath (path, FillModeAlternate, 1, 2, 3, 0, singleExpectedPoints, singleExpectedTypes, 3); GdipDeletePath (path); // Non Empty - single open GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); status = GdipClosePathFigures (path); assertEqualInt (status, Ok); PointF nonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 2}, {4, 6} }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 1, 2, 3, 0, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 2); GdipAddPathLine (path, 4, 2, 4, 6); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 4); GdipDeletePath (path); // Non Empty - several open. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); GdipStartPathFigure (path); GdipAddPathLine (path, 4, 2, 4, 6); GdipStartPathFigure (path); GdipAddPathLine (path, 4, 6, 1, 6); status = GdipClosePathFigures (path); assertEqualInt (status, Ok); PointF severalNonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 2}, {4, 6}, {4, 6}, {1, 6}, }; BYTE severalNonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeAlternate, 1, 2, 3, 4, severalNonEmptyExpectedPoints, severalNonEmptyExpectedTypes, 6); GdipDeletePath (path); // Negative tests. status = GdipClosePathFigures (NULL); assertEqualInt (status, InvalidParameter); } static void test_setPathMarker () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipSetPathMarker (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipSetPathMarker (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Non Empty. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); status = GdipSetPathMarker (path); assertEqualInt (status, Ok); PointF nonEmptyExpectedPoints[] = { {1, 2}, {4, 2} }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine | PathPointTypePathMarker }; verifyPath (path, FillModeAlternate, 1, 2, 3, 0, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 2); GdipDeletePath (path); // Negative tests. status = GdipSetPathMarker (NULL); assertEqualInt (status, InvalidParameter); } static void test_clearPathMarkers () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipClearPathMarkers (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipClearPathMarkers (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Non Empty - none. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); GdipAddPathLine (path, 4, 2, 4, 6); status = GdipClearPathMarkers (path); assertEqualInt (status, Ok); PointF nonEmptyExpectedPoints[] = { {1, 2}, {4, 2}, {4, 6} }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine }; verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 3); GdipDeletePath (path); // Non Empty - several. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); GdipSetPathMarker (path); GdipAddPathLine (path, 4, 2, 4, 6); GdipSetPathMarker (path); status = GdipClearPathMarkers (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 3); GdipDeletePath (path); // Negative tests. status = GdipClearPathMarkers (NULL); assertEqualInt (status, InvalidParameter); } static void test_reversePath () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; PointF simplePoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6} }; BYTE simpleTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, }; PointF nonEmptyPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6}, {11, 2}, {14, 2}, {14, 6}, {11, 6}, {21, 2}, {22, 4}, {23, 6}, {24, 8}, {31, 2}, {32, 4}, {33, 6}, {34, 8}, }; BYTE nonEmptyTypes[] = { PathPointTypeStart | PathPointTypeDashMode, PathPointTypeLine, PathPointTypeLine | PathPointTypePathMarker, PathPointTypeLine | PathPointTypePathMarker | PathPointTypeCloseSubpath, PathPointTypeStart | PathPointTypeDashMode, PathPointTypeLine, PathPointTypeLine | PathPointTypePathMarker, PathPointTypeLine | PathPointTypeDashMode, PathPointTypeStart, PathPointTypeBezier | PathPointTypePathMarker, PathPointTypeBezier | PathPointTypePathMarker, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeBezier | PathPointTypeDashMode, PathPointTypeBezier | PathPointTypePathMarker, PathPointTypeBezier | PathPointTypePathMarker, }; // Empty. GdipCreatePath (FillModeAlternate, &path); status = GdipReversePath (path); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipReversePath (path); assertEqualInt (status, Ok); PointF singleExpectedPoints[] = { {1, 2} }; BYTE singleExpectedTypes[] = { PathPointTypeStart, }; verifyPath (path, FillModeAlternate, 0, 0, 0, 0, singleExpectedPoints, singleExpectedTypes, 1); GdipDeletePath (path); // Empty - closed simple. GdipCreatePath2 (simplePoints, simpleTypes, 4, FillModeAlternate, &path); status = GdipReversePath (path); assertEqualInt (status, Ok); PointF simpleExpectedPoints[] = { {1, 6}, {4, 6}, {4, 2}, {1, 2}, }; BYTE simpleExpectedTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeAlternate, 1, 2, 3, 4, simpleExpectedPoints, simpleExpectedTypes, 4); GdipDeletePath (path); // Non Empty - advanced. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 16, FillModeAlternate, &path); status = GdipReversePath (path); assertEqualInt (status, Ok); #if defined(USE_WINDOWS_GDIPLUS) PointF nonEmptyExpectedPoints[] = { {34, 8}, {33, 6}, {32, 4}, {31, 2}, {24, 8}, {23, 6}, {22, 4}, {21, 2}, {11, 6}, {14, 6}, {14, 2}, {11, 2}, {1, 6}, {4, 6}, {4, 2}, {1, 2}, }; BYTE nonEmptyExpectedTypes[] = { PathPointTypeStart | PathPointTypePathMarker, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeBezier, PathPointTypeStart | PathPointTypePathMarker, PathPointTypeBezier | PathPointTypePathMarker, PathPointTypeBezier, PathPointTypeBezier | PathPointTypeCloseSubpath, PathPointTypeStart | PathPointTypeDashMode | PathPointTypePathMarker, PathPointTypeLine | PathPointTypeDashMode, PathPointTypeLine, PathPointTypeLine | PathPointTypeDashMode | PathPointTypePathMarker, PathPointTypeStart | PathPointTypePathMarker, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeAlternate, 1, 2, 33, 6, nonEmptyExpectedPoints, nonEmptyExpectedTypes, 16); #endif GdipDeletePath (path); // Negative tests. status = GdipReversePath (NULL); assertEqualInt (status, InvalidParameter); } static void test_getPathLastPoint () { GpStatus status; GpPath *emptyPath; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; PointF lastPoint; GdipCreatePath (FillModeAlternate, &emptyPath); // Single. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeAlternate, &path); status = GdipGetPathLastPoint (path, &lastPoint); assertEqualInt (status, Ok); assertEqualFloat (lastPoint.X, 1); assertEqualFloat (lastPoint.Y, 2); GdipDeletePath (path); // Non Empty. GdipCreatePath (FillModeAlternate, &path); GdipAddPathLine (path, 1, 2, 4, 2); GdipAddPathLine (path, 4, 2, 4, 6); status = GdipGetPathLastPoint (path, &lastPoint); assertEqualInt (status, Ok); assertEqualFloat (lastPoint.X, 4); assertEqualFloat (lastPoint.Y, 6); // Negative tests. status = GdipGetPathLastPoint (NULL, &lastPoint); assertEqualInt (status, InvalidParameter); status = GdipGetPathLastPoint (path, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPathLastPoint (emptyPath, NULL); assertEqualInt (status, InvalidParameter); status = GdipGetPathLastPoint (emptyPath, &lastPoint); assertEqualInt (status, InvalidParameter); GdipDeletePath (emptyPath); GdipDeletePath (path); } static void test_flattenPath () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; PointF nonEmptyPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6} }; BYTE nonEmptyTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; GpMatrix *identityMatrix; GpMatrix *customMatrix; GdipCreateMatrix (&identityMatrix); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &customMatrix); // Empty - null. GdipCreatePath (FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - identity. GdipCreatePath (FillModeWinding, &path); status = GdipFlattenPath (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - custom. GdipCreatePath (FillModeWinding, &path); status = GdipFlattenPath (path, customMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - zero flatness. GdipCreatePath (FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single - null. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Single - identity. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipFlattenPath (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Single - custom. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipFlattenPath (path, customMatrix, 1); assertEqualInt (status, Ok); PointF singlePointsExpected[] = { {12, 16} }; verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePointsExpected, singleTypes, 1); GdipDeletePath (path); // Single - zero flatness. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Non Empty Lines - null. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - identity. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipFlattenPath (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - custom. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipFlattenPath (path, customMatrix, 1); assertEqualInt (status, Ok); PointF nonEmptyPointsExpected[] = { {12, 16}, {15, 22}, {27, 38}, {24, 32} }; verifyPath (path, FillModeWinding, 12, 16, 15, 22, nonEmptyPointsExpected, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - zero flatness. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); // Non empty ellipse - null, one flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipFlattenPath (path, NULL, 1); assertEqualInt (status, Ok); PointF circleOneFlatnessPointsExpected[] = { {4, 4}, #if defined(USE_WINDOWS_GDIPLUS) {2.5, 6}, {1, 4}, {2.5, 2}, #else {2.5, 2}, {1, 4}, {2.5, 6}, #endif {4, 4}, {11, 12}, {14, 12}, {14, 16}, {11, 16} }; BYTE circleOneFlatnessTypesExpected[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, #if defined(USE_WINDOWS_GDIPLUS) PathPointTypeLine | PathPointTypeCloseSubpath, #else PathPointTypeLine, #endif PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeWinding, 1, 2, 13, 14, circleOneFlatnessPointsExpected, circleOneFlatnessTypesExpected, 9); GdipDeletePath (path); // Non empty ellipse - identity, one flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipFlattenPath (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 13, 14, circleOneFlatnessPointsExpected, circleOneFlatnessTypesExpected, 9); GdipDeletePath (path); // Non empty ellipse - custom, one flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipFlattenPath (path, customMatrix, 1); assertEqualInt (status, Ok); PointF circleOneFlatnessTransformedPointsExpected[] = { {21, 30}, #if defined(USE_WINDOWS_GDIPLUS) {25, 34.75}, {25.5, 35}, {22.75, 30.75}, {18, 24}, {14.25, 19.25}, {13.5, 19}, {16.5, 23.5}, {21, 30}, #else {13.5, 19}, {14.1967, 19.2218}, {18, 24}, {25.5, 35}, {24.8033, 34.7782}, {21, 30}, #endif {52, 76}, {55, 82}, {67, 98}, {64, 92}, }; BYTE circleOneFlatnessTransformedTypesExpected[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, #if defined(USE_WINDOWS_GDIPLUS) PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, #endif PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeWinding, 13.5, 19, 53.5, 79, circleOneFlatnessTransformedPointsExpected, circleOneFlatnessTransformedTypesExpected, WINDOWS_GDIPLUS ? 13 : 11); GdipDeletePath (path); // Non empty ellipse - zero flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipFlattenPath (path, NULL, 0); assertEqualInt (status, Ok); PointF circleZeroFlatnessPointsExpected[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }; BYTE circleZeroFlatnessTypesExpected[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeWinding, 0, 0, 0, 0, circleZeroFlatnessPointsExpected, circleZeroFlatnessTypesExpected, WINDOWS_GDIPLUS ? 9 : 4); GdipDeletePath (path); // Negative tests. status = GdipFlattenPath (NULL, identityMatrix, 1); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (identityMatrix); GdipDeleteMatrix (customMatrix); } static void test_windingModeOutline () { GpStatus status; GpPath *path; #if defined(USE_WINDOWS_GDIPLUS) PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; PointF nonEmptyPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6} }; BYTE nonEmptyTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; BYTE openNonEmptyTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine }; #endif GpMatrix *identityMatrix; GpMatrix *customMatrix; GdipCreateMatrix (&identityMatrix); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &customMatrix); // Empty - null. GdipCreatePath (FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - identity. GdipCreatePath (FillModeWinding, &path); status = GdipWindingModeOutline (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - custom. GdipCreatePath (FillModeWinding, &path); status = GdipWindingModeOutline (path, customMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - zero flatness. GdipCreatePath (FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); #if defined(USE_WINDOWS_GDIPLUS) // Single - null. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single - identity. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipWindingModeOutline (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single - custom. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipWindingModeOutline (path, customMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single - zero flatness. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Non Empty Lines - null. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - identity. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipWindingModeOutline (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - custom. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipWindingModeOutline (path, customMatrix, 1); assertEqualInt (status, Ok); PointF nonEmptyPointsExpected[] = { {12, 16}, {15, 22}, {27, 38}, {24, 32} }; verifyPath (path, FillModeAlternate, 12, 16, 15, 22, nonEmptyPointsExpected, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - zero flatness. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); // Non Empty Lines - open. GdipCreatePath2 (nonEmptyPoints, openNonEmptyTypes, 4, FillModeWinding, &path); status = GdipWindingModeOutline (path, NULL, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non empty ellipse - null, one flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipWindingModeOutline (path, NULL, 1); assertEqualInt (status, Ok); PointF circleOneFlatnessPointsExpected[] = { {4, 4}, {2.5, 6}, {1, 4}, {2.5, 2}, {11, 12}, {14, 12}, {14, 16}, {11, 16}, }; BYTE circleOneFlatnessTypesExpected[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeAlternate, 1, 2, 13, 14, circleOneFlatnessPointsExpected, circleOneFlatnessTypesExpected, 8); GdipDeletePath (path); // Non empty ellipse - identity, one flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipWindingModeOutline (path, identityMatrix, 1); assertEqualInt (status, Ok); verifyPath (path, FillModeAlternate, 1, 2, 13, 14, circleOneFlatnessPointsExpected, circleOneFlatnessTypesExpected, 8); GdipDeletePath (path); // Non empty ellipse - custom, one flatness. GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); GdipAddPathRectangle (path, 11, 12, 3, 4); status = GdipWindingModeOutline (path, customMatrix, 1); assertEqualInt (status, Ok); PointF circleOneFlatnessTransformedPointsExpected[] = { {21, 30}, {25, 34.75}, {25.5, 35}, {22.75, 30.75}, {18, 24}, {14.25, 19.25}, {13.5, 19}, {16.5, 23.5}, {52, 76}, {55, 82}, {67, 98}, {64, 92}, }; BYTE circleOneFlatnessTransformedTypesExpected[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath, PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; verifyPath (path, FillModeAlternate, 13.5, 19, 53.5, 79, circleOneFlatnessTransformedPointsExpected, circleOneFlatnessTransformedTypesExpected, 12); GdipDeletePath (path); #endif // Negative tests. status = GdipWindingModeOutline (NULL, identityMatrix, 1); assertEqualInt (status, InvalidParameter); #if defined(USE_WINDOWS_GDIPLUS) GdipCreatePath (FillModeWinding, &path); GdipAddPathEllipse (path, 1, 2, 3, 4); status = GdipWindingModeOutline (path, NULL, 0); assertEqualInt (status, GenericError); status = GdipWindingModeOutline (NULL, NULL, 0); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); #endif GdipDeleteMatrix (identityMatrix); GdipDeleteMatrix (customMatrix); } static void test_transformPath () { GpStatus status; GpPath *path; PointF singlePoints[] = { {1, 2} }; BYTE singleTypes[] = { PathPointTypeStart }; PointF nonEmptyPoints[] = { {1, 2}, {4, 2}, {4, 6}, {1, 6} }; BYTE nonEmptyTypes[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine, PathPointTypeLine | PathPointTypeCloseSubpath }; GpMatrix *identityMatrix; GpMatrix *customMatrix; GdipCreateMatrix (&identityMatrix); GdipCreateMatrix2 (1, 2, 3, 4, 5, 6, &customMatrix); // Empty - null. GdipCreatePath (FillModeWinding, &path); status = GdipTransformPath (path, NULL); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - identity. GdipCreatePath (FillModeWinding, &path); status = GdipTransformPath (path, identityMatrix); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - custom. GdipCreatePath (FillModeWinding, &path); status = GdipTransformPath (path, customMatrix); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Empty - zero flatness. GdipCreatePath (FillModeWinding, &path); status = GdipFlattenPath (path, NULL, 0); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, NULL, NULL, 0); GdipDeletePath (path); // Single - null. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipTransformPath (path, NULL); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Single - identity. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipTransformPath (path, identityMatrix); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePoints, singleTypes, 1); GdipDeletePath (path); // Single - custom. GdipCreatePath2 (singlePoints, singleTypes, 1, FillModeWinding, &path); status = GdipTransformPath (path, customMatrix); assertEqualInt (status, Ok); PointF singlePointsExpected[] = { {12, 16} }; verifyPath (path, FillModeWinding, 0, 0, 0, 0, singlePointsExpected, singleTypes, 1); GdipDeletePath (path); // Non Empty Lines - null. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipTransformPath (path, NULL); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - identity. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipTransformPath (path, identityMatrix); assertEqualInt (status, Ok); verifyPath (path, FillModeWinding, 1, 2, 3, 4, nonEmptyPoints, nonEmptyTypes, 4); GdipDeletePath (path); // Non Empty Lines - custom. GdipCreatePath2 (nonEmptyPoints, nonEmptyTypes, 4, FillModeWinding, &path); status = GdipTransformPath (path, customMatrix); assertEqualInt (status, Ok); PointF nonEmptyPointsExpected[] = { {12, 16}, {15, 22}, {27, 38}, {24, 32} }; verifyPath (path, FillModeWinding, 12, 16, 15, 22, nonEmptyPointsExpected, nonEmptyTypes, 4); GdipDeletePath (path); // Negative tests. status = GdipTransformPath (NULL, identityMatrix); assertEqualInt (status, InvalidParameter); GdipDeleteMatrix (identityMatrix); GdipDeleteMatrix (customMatrix); } static void test_addPathString () { GpStatus status; GpPath *path; const WCHAR string[] = {'H', 'e', 'l', 'l', 'o', '\0'}; const WCHAR emptyString[] = {'\0'}; GpFontFamily *family; GpStringFormat *format; RectF layoutRect = {10, 20, 236, 226}; GdipGetGenericFontFamilySerif (&family); GdipCreateStringFormat (0, 0, &format); // Valid size. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, 5, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Smaller size. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, 3, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Minus one length - not empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, -1, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Minus one length - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, emptyString, -1, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero length - not empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, 0, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero length - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, emptyString, 0, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // No such style. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, 5, family, -1, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero emSize - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, emptyString, 0, family, 0, 0, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative emSize - non-empty string. RectF largeLayoutRect = {100, 200, 236, 226}; GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, 5, family, 0, -72, &largeLayoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative emSize - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, emptyString, 0, family, 0, -72, &largeLayoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero layout rect width. GdipCreatePath (FillModeAlternate, &path); RectF zeroWidth = {0, 0, 0, 100}; status = GdipAddPathString (path, string, 5, family, 0, 72, &zeroWidth, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero layout rect height. GdipCreatePath (FillModeAlternate, &path); RectF zeroHeight = {0, 0, 100, 0}; status = GdipAddPathString (path, string, 5, family, 0, 72, &zeroHeight, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative layout rect width. GdipCreatePath (FillModeAlternate, &path); RectF negativeWidth = {0, 0, -100, 100}; status = GdipAddPathString (path, string, 5, family, 0, 72, &negativeWidth, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative layout rect height. GdipCreatePath (FillModeAlternate, &path); RectF negativeHeight = {0, 0, 100, -100}; status = GdipAddPathString (path, string, 5, family, -1, 72, &negativeHeight, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Null format. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, string, 5, family, 0, 72, &layoutRect, NULL); assertEqualInt (status, Ok); // Negative tests. status = GdipAddPathString (NULL, string, 5, family, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, NULL, 5, family, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, -2, family, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, 5, NULL, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, 5, family, 0, 0, &layoutRect, format); assertEqualInt (status, GenericError); status = GdipAddPathString (NULL, string, 5, family, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, NULL, 5, family, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, -2, family, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, 5, NULL, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, 5, family, 0, 0, NULL, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathString (path, string, 5, family, 0, 72, NULL, format); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); #if defined USE_PANGO_RENDERING || defined(USE_WINDOWS_GDIPLUS) const WCHAR longString[] = {'H', 'e', 'l', 'l', 'o', ' ', 't', 'h', 'e', 'r', 'e', ',', ' ', 't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 'l', 'o', 'n', 'g', ' ', 's', 't', 'r', 'i', 'n', 'g', '.', '\0'}; const int fontSize = 20; GpImage *image; GpGraphics *graphics; GpFont *font; RectF longLayoutRect = {30, 40, 700, 100}; RectF rect1, rect2; // Set up Graphics stuff to use MeasureString (copied from testtext.c) status = GdipCreateFont (family, fontSize, FontStyleRegular, UnitPixel, &font); assertEqualInt (status, Ok); status = GdipCreateBitmapFromScan0 (2000, 100, 0, PixelFormat32bppRGB, NULL, (GpBitmap **) &image); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext (image, &graphics); assertEqualInt (status, Ok); // Check the path bounds GdipSetStringFormatAlign (format, StringAlignmentFar); GdipSetStringFormatLineAlign (format, StringAlignmentFar); GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathString (path, longString, -1, family, 0, fontSize, &longLayoutRect, format); assertEqualInt (status, Ok); status = GdipGetPathWorldBounds (path, &rect1, NULL, NULL); assertEqualInt (status, Ok); status = GdipMeasureString (graphics, longString, -1, font, &longLayoutRect, format, &rect2, NULL, NULL); assertEqualInt (status, Ok); assertSimilarFloat (rect1.X, rect2.X, 10.0); assertSimilarFloat (rect1.Y, rect2.Y, 10.0); assertSimilarFloat (rect1.X + rect1.Width, rect2.X + rect2.Width, 5.0); assertSimilarFloat (rect1.Y + rect1.Height, rect2.Y + rect2.Height, 5.0); GdipDeletePath (path); // Dispose the Graphics stuff GdipDeleteGraphics (graphics); GdipDeleteFont (font); GdipDisposeImage (image); #endif GdipDeleteFontFamily (family); GdipDeleteStringFormat (format); } static void test_addPathStringI () { GpStatus status; GpPath *path; const WCHAR string[] = {'H', 'e', 'l', 'l', 'o', '\0'}; const WCHAR emptyString[] = {'\0'}; GpFontFamily *family; GpStringFormat *format; Rect layoutRect = {10, 20, 236, 226}; GdipGetGenericFontFamilySerif (&family); GdipCreateStringFormat (0, 0, &format); // Valid size. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, string, 5, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Minus one length - not empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, string, -1, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); // Minus one length - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, emptyString, -1, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero length - not empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, string, 0, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero length - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, emptyString, 0, family, 0, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // No such style. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, string, 5, family, -1, 72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero emSize - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, emptyString, 0, family, 0, 0, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative emSize - non-empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, string, 5, family, 0, -72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative emSize - empty string. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, emptyString, 0, family, 0, -72, &layoutRect, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero layout rect width. GdipCreatePath (FillModeAlternate, &path); Rect zeroWidth = {0, 0, 0, 100}; status = GdipAddPathStringI (path, string, 5, family, 0, 72, &zeroWidth, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Zero layout rect height. GdipCreatePath (FillModeAlternate, &path); Rect zeroHeight = {0, 0, 100, 0}; status = GdipAddPathStringI (path, string, 5, family, 0, 72, &zeroHeight, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative layout rect width. GdipCreatePath (FillModeAlternate, &path); Rect negativeWidth = {0, 0, -100, 100}; status = GdipAddPathStringI (path, string, 5, family, 0, 72, &negativeWidth, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Negative layout rect height. GdipCreatePath (FillModeAlternate, &path); Rect negativeHeight = {0, 0, 100, -100}; status = GdipAddPathStringI (path, string, 5, family, -1, 72, &negativeHeight, format); assertEqualInt (status, Ok); GdipDeletePath (path); // Null format. GdipCreatePath (FillModeAlternate, &path); status = GdipAddPathStringI (path, string, 5, family, 0, 72, &layoutRect, NULL); assertEqualInt (status, Ok); // Negative tests. status = GdipAddPathStringI (NULL, string, 5, family, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, NULL, 5, family, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, -2, family, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, 5, NULL, 0, 72, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, 5, family, 0, 0, &layoutRect, format); assertEqualInt (status, GenericError); status = GdipAddPathStringI (NULL, string, 5, family, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, NULL, 5, family, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, -2, family, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, 5, NULL, 0, 0, &layoutRect, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, 5, family, 0, 0, NULL, format); assertEqualInt (status, InvalidParameter); status = GdipAddPathStringI (path, string, 5, family, 0, 72, NULL, format); assertEqualInt (status, InvalidParameter); GdipDeletePath (path); GdipDeleteFontFamily (family); GdipDeleteStringFormat (format); } int main (int argc, char**argv) { STARTUP; test_createPath (); test_createPath2 (); test_createPath2I (); test_clonePath (); test_deletePath (); test_resetPath (); test_getPointCount (); test_getPathTypes (); test_getPathPoints (); test_getPathPointsI (); test_getPathData (); test_getPathFillMode (); test_setPathFillMode (); test_startPathFigure (); test_closePathFigure (); test_closePathFigures (); test_setPathMarker (); test_clearPathMarkers (); test_reversePath (); test_getPathLastPoint (); test_flattenPath (); test_windingModeOutline (); test_transformPath (); test_addPathString (); test_addPathStringI (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/tests/test.ttf0000644000175000017500000144513013542672033020173 0ustar directhexdirecthex FFTMvƋtJ<GDEF>F?@GPOSyc*GSUB +`A!OS/2}x`cmapvu, cvt Е\*fpgm&.8 gasp#?glyfb-head͘w,6hhea @ d$hmtxK*locaZaD*maxp name;dpost.pprep5aCp (_<6vl:c^Qc  ;Ns/o f33f   P TST @ ^\` fXffff+foff9fffffTffffsfXffff+ff{fufwfdffffff/f f ff\fmfffBfofffff1fwf9ff9ffofVfmff-fffofYff fyfffmfffmfuf^effffffZff\ffmfff?ffBf%fFf;fffff@ff}f\fVf7ffff fffufjfffhfffffmfffffffffffffffff\fffffffffffffffff9ffffffffffffffffffffffffdfffffffTf\ffffffffffff fmf=f)f=f)f=f)f=f=ffffbffffffffufff=ff=ff=ffBffffffffffffffffofjfffffff)fff fsfff-ffffwfffffwfffffffff'fffffffffffoffffVf?ffJfVf?fffffffffffmfffffffffffff!fffff f ff\ffffZfmfmff;fmff+fBffZffffffBfZfff9f9fHfffdffffffofIf?ff?fVflfmf+fmff;fofffffff0fffff>fffOfOf,f}f}f*f<f<f<fffffffffffffffffvfffffffBfffff2f9f\ff ffffOfOf,fffZfgf2f4fffffffffffffffffffffffffffffffoffVf?fffffwfmfhfhfofffffufffffffffffff?ff<f<fffNf0ffff"f/fffff*fff9fmff'ffffmfffffmfmfvfvfAffffeffmfmffBfyffffffff'fffZfZfZffff\f\fCf)f^f^f^ffffaffff{f{f{f7ff?ffIffBf%f;fEfffftf"f"f"ff9ffefff3f?ffmff"f,f,f,ffff ff7fffffff.ff ff fffSfcfffrfff/fYffffffffffffffffff`f`f`f`fffffffXfqff=f-ffTfAfAfAfAfAf@f@fff9fdfdfffnffffffvfvfvfvfffHffrffffffffffffffffffffffrf`f`fvfff`f`f`f`fsfsfffnffffffffffff-ffffff*ffffmffqffffrffffsffffvffffFfzfffffqfffffflffvfff'f'f@fffKf<fWf.fQfWfEfQffKf;f!ffffffofffff fffmfff>fff fff7ffofof2ffff1fwff9fuffofVffff?f+ffff)f)fffPff?fmffffbfffBffFff\f+fff\f?ff)f7fVf'fffffflf fSfffCff2f9f\f\ffffFfufFf;fZfZflflffNfffffCf}fYfnf2ffff9fffff\fZffff\ffffffZfofffffRfffff{f ffff fffmfwffff1fof9fuff\fVf9ffffefTfJf#fRfffTf^fmf}ffffuffffff!f1ff\ffff^f;f)fFfffZfLf#fRfffTfVfffffffffffZffffffFfRff#fTfVf f(fPf2fffKfKf<fxf?fVf9f\ffBfffJf]f9f\fFfRfff\ff6ffffffffff#ffffffBfffffmffffff$ff#f#foffoffdfdf9f\f\ffVf^ffBffBffFff+feffeffnffffffffffff!foffoffeff;f1fffffXfffff;fvfffffffffffffff9f\ffffffffff;ff)ffffffBffFffFfZfmfSf_f+f>fffffoffBffVfTfmfff!ff6fffGf}ffHffffff9f1ffHf}f?f?ff'ff?f?ffkfkfwff4f4fMfBf%ffffZff1fffgf ffffff8f6fff,f#ff[ffffff(f(ffffffff)ffff*f*fRf9f@ffff'fff)ffffffffffff,fJfffff)fffFffmfffffff$fffff^f fffffffmfffffZfffff{fBfFffmfmfmfufffvfff{fff f'fff*fffRf4f1f!f9f9ff7ff_ffff4ffff3ffffffff-f-f-fOffffffffff#f$fKfff fmffFfffffffffmfmfffmfmffffffff(ff%fffff2fffMfoffff4fafffffffffffffff(ff2ff2ffffff1fZfffwffffffffffffffffffffffffffffoffffffffffVf?fffffmfffffffffffffBfffffffff-f%fffffffffoffffffff$fPff fmf fmf fmfff fmf fmfff fmf fmf fmf fmffffuffuffffuffffuffufffffff9f\f9f\f9f\fff9f\f9f\fffffff9fHfff9fHfmffmfffffflfmffflfmffff;ff;ffffffffffflf`fffffdf_fffff'ffff7f6f?f7fffffffffxfyfffffwfwfffffffffff6f6f,f,fffffffffffffOfOfffffffff6fff,fffffffffffffTfTffffffffffXffff2ff'ffffffffflf`fffffnf_fffffffffxfyfffffwfwfffffffffffffTfTffffffPffffffhfrf ffffffffffffrfOfofffffffffffffffffffffffffffafffffff'ffffffvff+ffffffffffffff%Qfffff>ffffffhf9f9f9ffff;fffSff fYfffffffff@ff%ffffffffXffffffff%ffffffffXfffffff1fRf\f\fjf+ffDfFffXfbf3ffVff-ffBf2f2f\fVff.f ff=f%f f f+fffffffffffffffffffffff fffqf7f)fufff=f f2frf{ffffffifff{fffffffffffffffffffffffffffffffffffffffffffffRffRfRfffffRfRfffffRfRfffffffffffffffff3fffff[fff2ffff2ffff2fRf8f2fzfff8f.fNf>fdff)f$ff!fff+ffffffffffffffff*f*foffffoffefffCffffff<f<ffffffffPfPfffffffffffffffffffffHfHff5fRff5fPfffRfffff^fff^fffffbfffbf9fffffffffffffffff fYffffffffYf fffbfsf)fmffmffff}fXfXfXfXfXffff+ff{fufwfdffffff%fffff(ffffffffff;f)fff;f)ffffwfwfwfffUf#f7flflf f0fUfOf_ff f2ffUff_f-f(f/ff fff2fffffffffffvffff*ffqffffffffffffffvff'f@ffKf<fWf.fQfWfEfQffKf;f!ffffffff#f$ff+fJfffffffffffffffHffHfIf'fDfPfPffffff5fffffffffff^ffbffffxfffSfffffffSffffffCfCfCfCfCfCfCf/f/f/f/f/f/f%f%f%f%f%fffffffBfBfBfBfBfBfffffBfBfBfBfBfBfBf/f/f/f/f/f/f/f/f/f/f/f&f&f&f&f&f&fBfBfBfBfBfBfffffBfBfBfBfBfBf&f&f&f&f&f&f#f#f#f#f#f#f/f/f/f/f/f/fKfKfKfKfKfKfffffBfBfBfBfBfBfffffff$f$f$f$f$f$f/f/f/f/f/f/fNfNfNfNfNfNfffffffffffffffffffffffffffffffffffffffffffffffsfff!ffffffffUf>ffUfUfUffffffffffffffffzffffff*ffffffffffffffffffffffff  z~ou~?EMWY[]}  " & 4 : > D _ q !!!!"!&!.!2!N!^!!!"""""""")"+"H"a"e###!$s$%%% %%%%%$%,%4%<%l%%%%%%%%%%%%%%%%%%%&<&@&B&`&c&f&k'6',l,w.!# tz? HPY[]_  & / 9 < C ^ p t !!!!"!&!.!2!M!S!!!"""""""")"+"H"`"d### $`$$%% %%%%%$%,%4%<%P%%%%%%%%%%%%%%%%%%%&:&@&B&`&c&e&j'6'v,`,t.  ~}|{zxusrpoli\[W>.,+ mbP7-,#  743F' ځaa}( fxhbcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~o      !"#$%&'()*+,-.-./01234156789:nopqrstuvwxyz{|}yw   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`apcdhvnjtiqfuokzXbmRl{j8wox@Gd_^]\[ZYXUTSRQPONMLKJIHGFEDCBA@?>=<;:98765/.-,(&%$#" ,E#F` &`&#HH-,E#F#a &a&#HH-,E#F` a F`&#HH-,E#F#a ` &a a&#HH-,E#F`@a f`&#HH-,E#F#a@` &a@a&#HH-, <<-, E# D# ZQX# D#Y QX# MD#Y &QX# D#Y!!-, EhD ` EFvhE`D-, C#Ce -, C#C -,(#p(>(#p(E: -, E%EadPQXED!!Y-, EC`D-,CCe -, i@a ,b`+ d#da\XaY-,E+)#D)z-,Ee,#DE+#D-,KRXED!!Y-,%# `#-,%# a#-,%-, ` <<-, a <<-,CC -,!! d#d@b-,!QX d#d b@/+Y`-,!QX d#dUb/+Y`-, d#d@b`#!-,E#E`#E`#E`#vhb -,&&%%E#E &`bch &ae#DD-, ETX@D E@aD!!Y-,E0/E#Ea``iD-,KQX/#p#B!!Y-,KQX %EiSXD!!Y!!Y-,EC`c`iD-,/ED-,E# E`D-,E#E`D-,K#QX34 34YDD-,CX&EXdf`d `f X!@YaY#XeY)#D#)!!!!!Y-,CX%Ed `f X!@Ya#XeY)#D%% XY%% F%#B<%% F%`#B< XY%%)%%)%% XY%%CH%%`CH!Y!!!!!!!-,CX%Ed `f X!@Ya#XeY)#D%% XY%% F%#B<%%%% F%`#B< XY%%)) EeD%%)%% XY%%CH%%%%`CH!Y!!!!!!!-,% F%#B%%EH!!!!-,% %%CH!!!-,E# E P X#e#Y#h @PX!@Y#XeY`D-,KS#KQZX E`D!!Y-,KTX E`D!!Y-,KS#KQZX8!!Y-,KTX8!!Y-,CTXF+!!!!Y-,CTXG+!!!Y-,CTXH+!!!!Y-,CTXI+!!!Y-, #KSKQZX#8!!Y-, @%&Ia84-,F#F`#Fa#  Fab@@pE`h:-, #Id#SX<!Y-,KRX}zY-,KKTB-,B#Q@SZX TXC`BY$QX @TXC`B$TX C`BKKRXC`BY@TXC`BY@cTXC`BY@cTXC`BY@cTX@C`BYYYYY-,Eh#KQX# E d@PX|Yh`YD-,%%#>#> #eB #B#?#? #eB#B-, b`#b-,%XY%%% TX!Y!%\%ZX +Y %J%G%G`%Gca%UX%%IcY%XY%%I %\ %ZX +Y%Fca% UXc!Ya# UXc!YY+%\XiY% H#:&XY&X%/Y#2!!-,% %% %JSX% % %%Y%% %c#%c` @cSX!&& @ceQX&e&e &&%% .%% .%%YY UX%%%% % % & TX!Y%%% %I#%% % %Y QR#xa%%% % %Iab%% %#8%%%% % %İ%% % %I%T#y!!!!!!!!!!!!-,#TX@@YTX@@Y[+-,TX@@Y [+-, TX@@Y[+-,&& && [+-, EiD-e,KPXYD_^-f, EiD`-g,f*!-h, F%FRX#Y Id F had%F hadRX#eY/ SXi TX!@Yi TX!@eYY:-i, F%FRX#Y F jad%F jadRX#Y/-j,K &PXQXD@DY!! EPXD!YY-k, EiD` E}iD`-l,k*-m,K &SX@Y &SX#!#Y &SX#!#Y &SX#!#Y &SX#!@#Y &SX%EPX#!#!%E#!#!Y!YD-n,KSXED!!Y-e+g+@:- m+I:- m+L:- m+l+ E}iD  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J ߴ J ޴ J ݴ J ܴ J ۴ J ڴ J ٴ J ش J ״ J ִ J մ J Դ J Ӵ J Ҵ J Ѵ J д J ϴ J δ J ʹ J ̴ J ˴ J ʴ J ɴ J ȴ J Ǵ J ƴ J Ŵ J Ĵ J ô J ´ J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J ~ J } J | J { J y J x J w J v J t J s J r J o J n J m J l J k J j J i J h J g J f J e J d J c J b J a J ` J _ J ^ J ] J \ J [ J Y J X J W J V J U J T J R J Q J P J O J N J M J J J I J F J B J A J @ J ? J = J ; J 9 J 8 J 7 J 6 J 5 J 4 J 3 J 2 J 1 J 0 J / J . JA7dUdU/o/pdUP@p}dAU~A{|dA,|?|o||||_zz_yyxxoxxvdwUw w@urAoAnAi-hUg-fUe-dUc-bUa2`U/`?`_2^UZZpZZV-UU?UT-SU?SSSSR-QUP-OUpO/OHpHHoH@HF-EUD-CUB-AU@n Flk2@k Ff Fлs@q17F@q!F""((((((+++++++//////////////////888߲8޲8ݲ8ܲ8۲8ڲ8ٲ8ز8ײ8ֲ8ղ8Բ8Ӳ;Ҳ;Ѳ;в;ϲ;β;Ͳ;̲;˲;ʲ;ɲ;Ȳ;Dz;Ʋ;Ų;IJ;ò;²;;;;;;;;;;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGG~G}G|G{GzGyGxGwGvGuGtGsGrGqGpGoGnGmGlGkGjGiGhGgGfGeGdGcGbGaG`G_G^G]G\G[GZGYGXUWUVUUUTUSURUQUPUOUNUMULUKUJUIUHUGUFUEUDUCUBUAU@U?U>U=U<U;U:U9U8b7b6b5b4b3P2P1b0b/b.b-","+%*%)+(+'+&+%+$+#+"+!+ 555DDDDDDDDDDDDDDDD D K K K KKKKKKKKK@KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKRRRRRRRRRRRRRRRRRRRRR@RRRRRRRRRRRRRRR b b b b b b P b b b b b b b b b b b b b b b b@s ! o o o o o o o o o o o o   pp/?O/?@Fp,0F@""Fp@>BFTS++KRKP[%S@QZUZ[XYCTKQZXYBKSXYKSX@YKSXBY+stusu++sss+sutsst+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++s+++++++sssttss++sttu+t+st+s++++++++s+sssssssst+++st+sssstss+s+CTXAddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd~d}d|A}d{dydxdwdvdtdsdrdodndmdldkdjdidhdgdfdedddcdbdad`d_d^d]d\d[dYdXdWdVdUdTdRdQdPdOdNdMdJdIdFdBdAd@d?d=d;d9d8d7d6d5d4d3d2d1d0d/d.d++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Y++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++l7\Rfs3MsL)\ f)\f)@{)f7)MR_efjflpj\]^dipqstvyz{}nw{~nswyz{ 3=MNehst\^nuovs} -%39Lb\=L\\` 0  5  Wb*f lHD 4 $ \ 8 @ 0 \4| T`h,<t\Td ` !!x"P"#P#$$8$|$%%\''(D()*0,@,-.P./<00112h234P45(6778889::;|<,=8=>H?@<ALBC8CpDDExEFFFlF|GG`GGHlHIJKLLLLLMM,MNNNNNOO,ODO\OPP,PDP\PtPQRDR\RtRRRSLTPThTTTTTWWXXX0XHX`XxXXYYZ Z$Z<ZTZl[$\H\`\x\\\]p]]]]]^`aa(a@aXapaaaaaabbbccc4cLd e4eLede|eeeeef f$f<fhgggghh(h@hXijjk@klllmm,m<mTmmmmmmnnoop p$p<pTplpqqqqqr r$r<st$t<tTtlttttttuvw4wLwdw|wwwx<xyy y8yPyhyyyyyz{{{{{{||,|D|\|t||}~~ l@` t$|l\<p\,@<0`8@Pp ,<$$$\@<`x 8Ph0H`x0\0H0H`x 8Ph(@XpP@ 8`|Ôì $hĀĘİlɈʘʰ(<t\d|ϔϬа|@pԈ(֬($x$4DT݀lh$0`@Xh@X884$4d ,\(Ph\T44H4<   @   ( l|L@$4HP`p`$T  d   !!\!!"D"#T#$<$%%t&@&'\'(L(() )P))**H***+,+t+,X,l,,--<-t--..h.///(/8/H/X/|///000001D120223T344L445 5\5566\667<77899T9d9x99::;L;;>??t??????@ @,@h@@ABBCLCCCD<DE ETEF(FFG,H HdHII<IPIJJhK KLDLMTMNtNOP<PQQxQR<RRRRSSDTTT,TDT\TtTTTTTTU0UUUUVVVWWW WWWXXxXXYYZD[[([@[X[p[[[\]^X_p`\a0abbcdd$deDfdftg(ghi\ijhkHlhmn n$n<nTnlnopq4qXqprXsltuTvvwwxxy(yz{|}h}~x|xhx8h`0@P<Lp(8Htp`Dxx@P<X 8P`DTd t\X D` t\@h(04L|”¬ȘXpʔ4T0͌ҘP L||֘Hشlژ8tpd@(H\|l| 0L(@HXphXpPh(@Xp(@`Lt8  <   4  D( Dt<``  d !","p"#\$\%$%t&&h''(()4)|)**+x,$,-.(../00\0141t12l23h45 566t789 9;X;<=d> ??ALABDCCDPDE0EF<FG4GHHIJKhLPMMNhNOO$OLOpPP,PPQTQQRSxT|TUUHVXVVVWHXLYtYYZZ[t[[[^|^^___```4`L`d`|`````a a$a<aTabbcde fffgg(ghLhiijkkklmn8no<opqr<rstltuuv$vw|x$xyzl{${{||D||}}(}|}~~(~@~X~p~~(@Xp(lx88Tp,D\|4Ld|4LdD4Ld|8|<Tl,D\t<(@\x,p0H`` 8Ph(@Xp0H`,TlLd| $<Tl4Ld,D\t$<Tl,D\t $<Tl,D\t4Ld| $<Tl,Pt4Lp$<Tl,Pt4Ld| 0Tx,D\t(Ld| 0Tx,D\4X| $<Tl <Xt(T$Dd,T0\x <d<h,H`x84Ll4L\4Ld|<L$<Tl8\@8Tl(Ld4P|¨HðĄŨh(D(  ˰Ϩϸ XФрp҄ҴԸ0DXlՀՔְר؄ِ@ڈیXܬ݀ ,LިLdH\$ 4\8P`@X@0pp   ll|<ttP|$` $p !#H$|%&')@*X+,-/02L3|4H5P6789:;=,>p?d??@@`@@A@AAB@BBCDCCDhDE$EEFPFGGxGHLHIHIJJKKtKL\LMDMNHNO,O\OOOS Y|__`(`X``aa0apaab$bhbccggTghxhjdklmpn@nopp|q qrhrstuvxw|x yHzP{\{{| |D}$}<}T}d}~|h8phxh<l,D\tX4Ld| $<hd|,D\tPh<TT,p ,<L\l|x`<txTDDHT0DXlH$H|Ġp ǨdȈd<˘X̼ ͔8DdL ӔԄlh\8Xl؀ٌؔ٠<Pڤۄ0DX܀ܨܼ$8L݄ݼ0DXޘPߔ(@Xp0H` p`X@0PpX $<TdL\X4x,pD| TL$h<PP h`,`,t(pH`0|0pD4|<|TL(l@xH@\ ( p   4 l   L    L    \  (8HXhx(8HXhxD<0X(TdL|HXt<08d 0!D!""8""#$H%%&'()L)*x*+$++,(,,--(-@-X-p----X1\#- 42@3@ (A (C??9//9/10!!##'3254.+5322#".54>JXk BgHdr*Lk@#)ie1%1  Ab-UA'-H3d3Qg3% # &RS??/10#2#".54>j0##00$$0q$10##01$d&@  SS??9/10#!#b+++;ii@   J i@,   /?ACC???^]399//]3332223332229999//9910#####53#533!33#3!!%%%%$"!"####ooo^JJ^o)09@)*0 91Ų4-@$: ** )@149 0-))NM??99//92299//9/9933}103.'#7.'5.54>7>54.'P4i-7p69CiADzg!!Q6?[;A~c>4nt}s_^?{4M4 T=SrOTZ3:QnL>ya? _JEY% dV$9.(R';KSA (_<D_2_ _@?7G-R# TSQQS??????//33//10 # #".54>324&#"32>#".54>324&#"32>Rf&Ge>=aE%&Ge>=aE%@9-@9-'Ge>=aE%&Ge>=bE%A9-@9- {AoQ/&KnH@oR.&JnMXT.?%XT.?AnR.&JoH@oR.&KnLXT.?%XT.?9fh)6G?@21C&'BB!@ 7777))*@H1'/ )&C2:S/ RQQ????9/993999999//933}10#'#".54>7'.54>326'3274&#">40XGfaf5(DY187.YTQzR)3Sk8,"?[9b"9)TH(=*(,+L9!UmJKU.>$6]8#1;GS?9/10#+\\e+ i+A & 6 F V f v ]A ]/EX/>Y01$54%kᤤ\  \de+ i+A]A)9IYiy ]  /EX/>Y016$54$'5kgf;<5G V@       S?99//9923339/332210%#'-73%D?3EFHwVuuV{T= % @   /329/10!#!5!3!wwhkB +Q?//10>54.54>32#3`I,$!3##A1=yx+@)*4,2*.&+"=--="#<--<;.=#"<--<"#=.s)@ SY?3?3/3210 #R\X-!/J" & 0&%@"&&+ce??99//993210#".54>324&'32>%.#"3T="B! 9 @  b d?2?9/9/310)5!'%3!P@$- 9 @ ! c d?2?9999//10)5>54.#"'>32!RSh:6V54.+532>54&#"5>32FԍN|6>HbX(0WyH;aE%|BP"MML#hj6sd3cO1VqA  #B^;6P6:U6i`  -TxKp-0Kf+1 D@   @   bd??39/9323/9/32333310##!533 !1߲-o9!!aG!A] @  ""b  e??9/99//10#".'532>54&+!!32TtCB?6GPZ0r^Uas@ &Ge?zo"U{!5@,  @" 6,'6b1e??99/9/210#".54>;#">324.#"32>Axglp:?`cc2>_B&NKD$GhD9_E'ZuCEڕdc78fY)%-:gatyyw-!/Ct("@   0:@! D -55-(50 0:(": %c?e??9/9993999/9999//9910#".5467.54>324&#">4.'32>Dzakn8v4ikeh4u:dJ)}qp}?^Aqn>hPD]9'D^75^E(HSX.0VvGxGAg?v\7+PrFr<FVjcYWVV'B:85s%FDD$!ACH(-E0-Ed-3</%@4/*  cd??9/929/10+532>?#".54>32"32>74.\my}B?`cc2BwdaxD68_E(=`B%OKD&Hg׿T4e])%-:hT[uD@$%GhC=`C$ i,'##*R *P??/102#".54>2#".54>38**8 7**7 8**8 7**7*8 7**7 8*#*8 7**7 8*-.) $*P+Q?/?/10>54.54>32#2#".54>3`I,$!3##A1=yx98**8 7**7+@)*4,2*.&54.+5322#".54> u=R254.#"3267#"&>32#"&5#"&54>327.#"32>7  2'$N}YDmY?#°YSRZ*Oq_wr7+NoDNL&X>^^ 2Id@&B %0%"  @T0;{SE}))&&~zŋMaIPDMG7~uY6  *FY^[$`T 4* \ d@     @ ( AC?3/3/3/?39/]983/2/332}2}10!#!#3 \[\\E)C&  @* %%A&C??9/99/910#!! 4.+32>4.+326Iuver5_H*r\+;Dz O BD??]10%# 4>32.#"3267㝬R؆[HGZ\h8TG1AKD` ')Ey'#m (Ŵ  @  AC??]10#!! 4.+3 @f}Q2-4jl^yV/v5 1 @  A C??9/910)!!!!!5k> * @  AC??9/910!!!#!XB-)D!@ !*&)O&B D??]9/910.#"32>7!5!#".54>32I[ho;0fo,,))[_^,חQZXI;'+JsxF d T]"o 3 @ AACC???9/?/10!#!#3!3۲%X) ( @  CA?2?2/10!5!!!!5!--m(@  A  D??10#".'53265!5m2fh'QKB>JmvtTpB -4} F   @  AC?33?33/99898/3/3210!##33_@ AC??10)3!;}15p@  @ @@    A  C?33/3/?3339/98888839=/3329/3329/3310!# #' #3735 ={=@Ӱ97/9w 9 @ A  ACC?2??399}/|/?//29910!##33nk/m^s9/-'$@ (B#D??/10#".54>324.#"32>/Si~{323267#".4.#"32>hf2Ri~|=Dv\nd0]0OBJPc<#N{WTyN&$MzVTzO& f㊲Q[`Xk &{6.,WtLPgwKP$K@  ij  @ %    A CCC????99//9993310!#.+#!24&+32>.5?'T^ri1$GiD7M(Nw?eG'0?%2ZM=mYA_OihP9So-5F&-ij 6&'@ H'*-!B  D??99+10#".'532>54.54>32.#"Ls4g_T"KwVyM#;`{{`;8v!MOM!MH;`{{`;b]].   5L15K;14=SpMCe> fV5L<14>UrV@ AC??2/10!#!5!}}}m$ @ A AD???10#".5332653=vozk1BiLl{C@ueoMtN(_b1@  ACA??3?3399/232310 #3bDNPRq-9   ps@   @  ACCA????9/98888839=/]99//999910#'#37379X-/Z3?{=4ѕ;N F@*        AACC?.???//232310!# # 3 3Np+-of Eٷ @ ACA???9/999/910 #37f''`X-D"o 7@   AC?28?282210 !!5!5!eyshYfF@ lU??/10!!!!FGfB)@ SSYY????3210#3R\ f @ lU??/10!5!!5! Ef*y5r@ A?299/9910# #3n ffU?/10!5!fff/@@O?]]/10#%3Vgm!?e+"//и/"и/A&6FVfv ]A]#EX / >YEX/>YEX/>YEX/>Y9A'7GWgw ]A] A]A(8HXhx ]01!'#".54>3273267.#"% XW+9w3d8^3M4BQ(e9Hol“V'T]2vt&1 @' P S"R?3??910#"&'3>324.#"32>ErY[KbVX,2N6!DIQ.3j032.#"3267DLJpN>AHCwZ4G>%wŠK"3`W m!4 @" R Q SP????999104>323#'#".73267.#"mFo0]-IcVW,kbBQ+h3ljG {jfH{vtu)@ )@*͏*$P R??9/]9/10!32>7#".54>326.#"?,XRK G`w9=ulio9 CdB9^D*+%2  FzjTByRCoP-,PpC?@    T Q??9/9329/10&#"!!#!5!5!2cHCh~7ɑse\1we+2//2и/A&6FVfv ]A]и/1и1/)1)93EX$/$>YEX(/(>YEX-/->YEX/>YEX/>YEX)/)>YA'7GWgw ]A]$ A ]A ( 8 H X h x ]-(9013267.#"3>75#".54>327#".'3M4BQ(e9\8';Nte XW+9w3d8 zzn+T]2vt8$ sHol“V'⭛<'EE/  @  PS QQ????910!#4&#"#3>32ǮWQ#=BN3)OOR,ts/PYEX/>Y i+!012#".54>;!"&5!532%%22%%2]f&12&&21&[ ')fX\h)D% **  V(@ @H O?+?910#"&'53265!52#".54>HYi+ 01!"&5!5!;]ffX8r')Z -H -% @ ./*P"P%OQ QQ????99??9/9910!4.#"#4.#"#3>32>32l"'/  '0!14;$QT.5@*/<#6YA{7D&4ZF{9P1jo4Q7%/ @ Q QPO????99103>32#4&#"#,ROR,XW =BM04E*qvq/P324.#"32> B|qlw?B|qlw?)LmCNoG!)LlDNoG!uËMC}uMC]]/=fJ]]/=ff%8  &@ & P O U#R????99/910#"&'#3>324.#"326Ki0_1 KcVX,2N6!DIQ.0j3ȄB \gSHzO^51Q<mf"4  @# $R U P P????99104>327#7#".73267.#"m9w3d8 XW+3M4BQ(e9l“V'h{HzT]2vt2@ Q PO???9/999103>32#6&#"#ɟYXSP#GKT0k`DŽw7V={5S,$$  6#$@ H$', P @  R?]?99+99//10#"&'532654.'.54>32.#"$>R]b/fRXV}x2i[DsT0'^x;NR6AY79fRYzL!5TA.D?+'*3F^@*dV9 #/,))9FX?-5 @  OR??32910%#"&5!5!7!!3267;~A=sp0r>  -lk- @ O ORQ????9910!#'#"&5332>73ǜ-QPQ- =CM04E*~/P=B9@  z@ QO?22/?398]9/332210373#B57vh%B@'     @     OQQO?2?3?3?39/98888839/3329/3393329/3333910#'#3737Bӑ!͑T+}-NflbVCF) ӱ#@## #   OOQQ?2/?3/?3/?3/3/322KRX @   #R+}Y8KRX @   #R+}YKRX @   #R+}Y8KRX  @   #R+}Y10!# # 3 3)~;`P@   Q @ 0VO?22/3?998?9989/332210 #"&'532>7375qc*40SJD o3:~<?dGh /@  OQ?28?282310)5!5!!7N}ݒ/f&1"@&  l&U??9/9/10#"&54.+532>=4>;#";J7[E++I\4([iJ;;fX1M51L4T_3ff]U??/10#3ff&1&"@  U&l??9/9/1032;#"+532547&=4+J7\E++I]4(ZiJ<<1M51L4T_3Z@X&4 @  /]10#".#"#&>323265%"HkG7XK?=<";9#GkG7XK?=<"?6L^5%8B8%^eL_5%8B8%\ff# &PU??/103".54>32k/$$/0$$0f$00##00$}$x@$  ! %M @$ MLL???99//93/2?9/23}10267##.54>73./G?:9Fk+-(L%*V,;gL+d[=1\#pKL 5YzL"\-!K!@"  # " ! BC?2?9/32/9///10!!!53#5354>32.#"bL7w;maj"ҏQel9K7o# "Ba@V=!1r " j m!n* k@2% !!-/3/93910#"''7.5467'7>3274&#"32>&\6gK#'*(&\6fM#'*(j[4J1j[4K0#%[3VN8[%[3VN8[Y/K^.0K^75b @    ɳ @ A CA??2222?99/9/99/10 !!!!#5!5!5!5!5375X44̴35^dk?kff&@  ]U??99//9/10#33fD+DX^7'@ '//'@JT@Y./2EO$7,T \??99////10%#".'532654.54>7.54>32.#"'>54.'/ .NzG3PF@"%EFK*}y1QflfQ1,B,.'^xso?o8AW61PfkfP1-B. Jr>.HqR0SwM$  SI!:8:AJYjA'PKCQ60kZ<'6 ";::AJZkB(PKBA-23=aSM*,22=aUN{}'(0#    (O?]3/102#".54>!2#".54>\)))))))) }))))))))o Z+'?[:[@ ,4?,?,?#YAY@@3471(?=*1*1* DB??99//99//102#".54>"32>54.# 4>32.#"3275̍KO|̍KO{Zj:9i\[j98isS[+OpE]K#J&RZYULE+gbgcMzrőRMzrőS!HN}Y0mfjc%f)%e+&//и/& и / A&6FVfv ]A]EX/>YEX/>Yi+i+и/#A##]A#(#8#H#X#h#x### ]01!5!/#".54>3273267.#"\e>[='SY$F(k(%6$.f:G(flf}1Y~KHd: JN9[?"PO=  A M M RR  /32/10  ڊ:mFLHum//10%#!5!˪TV'j0D~@0"A ./ 160@, ,",",EF@H 'p;;;1E 1T?9/]29/+q999//910'.+#324&+326"32>54.'2#".54>J #eXhA1 R11-).8NG}]55]}GH|]55]|H^|HH|^_|HH|Ũ@P9@""n&"%8`IJ`88`JI`8fH{^_|HH|_^{H9NO?/10!5!9 Ʌ% e e#T?/10#".54>324.#"3264^OSX-4^OSW--G2-F0.G2ZbHH}\50WyIH}\50WyO+I64J-+J6nh 9  @  Q?9/329/10!#!5!3!!5!ww\{|wsNg^N/@@O?]]/10#7Dgf5km*@  \ S??9//10".54>3!#"&'73265#р6ǍZ;occIZ5Ir;CsWWrAHio:@:.:/- @H /+/102#".54>3"=--="#<--<->""<--<"">-}XQ??/10!#VB'woNf)'F] ]@ ()# @  (c?99//^]9/10!5!#".54>324&#"32>\/ZRN}W.0ZSN{U.[W-B-aQ-B-fKa8,WWL`6,WYlj";O,ml!;P A M M QQ  /32/10%7 %7 LىPNEmjNHGHqpR d `@ b@"   Q TSQQS??????9/9322//33/2/9/333210 # '73##5!533'3RfJ7ZZ{Zt!mmzRR$+a)%b*( a$#@$('&%*S# QSQQS?????92?//33/9//210 #!57>54.#"'>323'73RfH/! 7&C.3;#,N;")A/>7{{}#3  e 0G/558!+ZtR<w*h@ 7:%70%77%0! `@%   :&%%&-4T  QQS???9/9322?9/9/3332/9///910 ###5!533'3#"&'532654&+532654&#"5>32RfZZ$GiF@=?506ZT/#%-6"K-di&*8:{mmzR*F4w%"q#! q LA4@ Bf5.E **ͳ &@ % %PU??9/9/9/10746?3#";#".".54>32˵ u=R2=lXea@0##00##0# 0E,IqN)&AXci$00##00$\{&$\{&$\{&$\&$\{&$\&$=`@  x@#    ACCC????99//2289/23}10)!#!!!!!= mF3O _1\+[l@  O BID?9??]999/10%##&4>32.#"3267㟠RBR؆[HGZ\h8TG1A')G` ')Ey'#{&({&({&({&({&,{&,{&,{&,= @   CA??9/32/9/10! #!#5332654.+3#>1#>d}q1fk^yV/Zv5k&1/{&2/{&2/{&2/&2/{&2 >@    /999/9910  ' 7 1uj-u/-Ru1k-/u-9)-&2@%)."'*+   '@3H+*."  BG G. DH?????99?99//999923}910#"&'#&54>327.#"4&'32>N{Ri8=L~|Ri>5@7?'TyN&8?(TyO&KܰQH7߮Q BQqDTQ{&8{&8{&8{&8f{&<8ô @   AC??99//1032+#4.+326PaP<~Ĉ*QtJ.cmPP?dG%єCQ=!@ 6 66 +*@+D!$1T+Q R???999///10#"&'532>54.54>54&#"#4>32'Yg3T $*,5M14N\N4':D:'e`6V>!@r\U\/':D:'4O\O45hR4 "-/H@@K_@8P=/19'RJAfGjg2(JiA0/6&&>>@Pc&DC&Dt&D&D}&Di&D?)8Cue+*i+2i+?i+29и/"?9A*&*6*F*V*f*v*** ]A**]>иEEX / >YEX/>YEX/>YEX(/(>Y?i+ 9(A'7GWgw ]A]" 9/и 6A66]A6(686H6X6h6x666 ]901%#".54>32>32!3267#"3267.'%"!6.=Z<(RP2J.,oINmE D]l9p*wk'9' 3Hok“]!:4A@tc66  T]2vt.Om?>mP. d }! ! @  PX@ pR?9/]??]99/9910#.54>32.#"3267RBJpN>AHCwZ4G>D'&wŠK"3`W &HC&Ht&H}&Hi&C&t&}&id9! &@2&@72:77777P! @H -R?S?]?99//]+9999?]99//99/9910.#"32>54&.'57'3%#".54>32*@TtG )Ie;EgD"50sR)IpL((Eg_jo:>xrT >iLW[.5_QVE#<'h=)eJ5wsiQ/GomÓV&Q &RC &Rt &R &R }&RiT++2' ,-&"&/9/10!5!2#".54>".54>32B0##00$$00$$00##0՘$10##01$$00##00$\) %1$)0".@!&'1%   @"21%&)  P Y RZ????9999//999932}9103#"'#7.54>3232>54&/.#"ےRq~A|r-+DRrA|r,/  NnF!=8 NnF!<;6zĉI7yÈJ324.#"32>Er0_1KbVX,2N6!DIQ.3j07!#3#3267 k=lo /'[\&$, +5'\H.4>&$7,' )Em(7~e+)i+$i+A$$]A$)$9$I$Y$i$y$$$ ]1$91/и/1A)&)6)F)V)f)v))) ]A))]9EX / >YEX/>YEX/>Y!i+9и/.A.'.7.G.W.g.w... ]A..] 5A55]A5(585H5X5h5x555 ]01!'#".54>3273267#"&54>3267.#"% XW+9w3d8$, +5'=lo /!3M4BQ(e9Hol“V'$7,' )q\H.4>T]2vt={&&=)&Ft)={&&=)&F)=&&=)&F)={&&==&F={&'&Gbf(I ""@)&P R  QS??9??2299/10!533##'#".54>325!3267.#"!HcVT*D~oaWdaBR+g3jfHpljG{vtP&(N&Ho&(&H&(&H#Rv # o @ $C  A C E???9/?99/910#"&54>7!!!!!!33267=lo /'5$, +5'\H.4>&k>$7,' )u7Bk+))81,@   !8B!@C8!!C=P ,*)$R4W??99?9/99//9/9910#"&54>7"#".54>32!32>732676.#"s=lo)!  w9=ulio9?,XRK 9E#+ +5'8 CdB9^D*\H+18"FzjTByk%2   $7,' )JCoP-,PpC{&(&H={&*=\&J=&*=\&J=&*=\&JBf-&*\&J{&+&K3  H S?+4HL @ A  ACC???9/2222?10#!##5353!5335!ٲnnoT;ٖ !^  @) "  0@!OSQ Q???^]99?]9/329/10>32#4&#"##5353!!N)OOR,WQ#=BN3;æ1C*Pst/P=s&,&P&,N&o&,&#Iv # o@ CA C E??2?2?9/9/10#"&54>7!5!!5!!!33267=lo /'--$, +5'\H.4>&햖$7,' ):e+:h+!.i+A..]A.).9.I.Y.i.y... ].и7ܺ3.!9!<EX/>YEX/>YEX3/3>Y$+i+ i+3и$'и'/8012#".54>;3267#"&54>7#"&5!532%%22%%2$, +5'=lo /'|]f&12&&21&[ ')$7,' )q\H.4>&fX&,Oe+h+ EX/>YEX/>Y 01;!"&5!5]f ')fXo6 ACD A????9/10%32653#"'#3+..\e-Z[eO l~GR`5j\+?R",6 @1)@;'@H' OQV???3+229/1032653#"&'#4>32#".%4>32#".V9==jv8i^Ds&6&33&&33&y&33&&33&  &ip:i4&&44&&44&&44&&4o{&-\o&f&.f'&N'i{&/)&O)= HS?+4f&/f&O &/ sF&Os^&/w)&Ow)- Q@     @    AC??99//99999/9/10%!!573%'%ѴiZjk#7e+/и/A0@P]Ap]AqAp]A0@P]Aq и /ܸ иܸи/EX/>Y i+01!"&55%!5!%;]ffXבÏ '){&1&Qtwf&1f&Q{&1&Q&Qw\G@  xx@F A AC??39??323910#33#7265{k8i^mw5ip:\8 @ VP O Q??9??9/9102654&#"#3>32#5mwXW =BM0,ROR,8i^uvq/P323!!!!!.#"3267FJj+zu9Mb>=5q5J +PrI"$WPe7Qm'B*;DX+D+$+$<5@E<E%$!(RAP0 P:R????9/99//9910%#".54>32>32!3267#"&4.#"326.#";#sMNrL%(OxPNk)*6E,BhG&Y\^9k)-s=[r$4 #7&$8&"/EBU[:}‡zÉJTZ)A->xo%/ WgZ)+\deY)NnE {&5&Utf&5f&U{&5&U{&6&Vt{&6&Vo-7l7 %4l  +IJ8$%@ H%(+B@ DI??9/?99+9/9910#.'532>54.54>32.#"wT>)\_T"KwVyM#;`{{`;8v!MOM!MH;`{{`;L   5L15K;14=SpMCe> fV5L<14>UrN]i6y| -@ %%%  7$%@ H%(-!P @  RX??9/]?99+99//999/10#.'532654.'.54>32.#"3Sl:T=TFXV}x2i[DsT0'^x;NR6AY79fRYzL!?`E+ D?+'*3F^@*dV9 #/,))9FX{&6&VV&7x?-&WxV{&7J&WJV;@  @   AC??9/322/9/9/10#!5!!5!!! }} FFX?-P@$      OR??329/329///10%#"&=#53!5!7!!!!3267;~A={sp0r> s-elk&8&XP&8N&Xo&8&X&8&Xf{&8N&Xm.P "(v# . . @/AA## D+E??9/??99//9910#"&54>7.53326533267=lo(!se.BiL)PtL$, ,4'\H+18"CtboMtN(_YtQ$7,' ),J&&  @-& !Q OOR Q)W??????9999/10#"&54>7'#"&5332>733267=lo /'-QPQ- =CM0$, +5'\H.4>&4E*~/P=$7,' )9{&:B&Zf{&<`&\f{&<{&=&]t&=&]{&=&]! @  T Q??/10.#"#4>32DEAE|iBy -vt9.H&@/ *R! PS???392210353!!>32#"&'#4.#"32>!KbVX,ErY[H2N6!DIQ.3j0Iu(2  er5_H**PsHHN+r(G3g6Q (8! @)$RPS???392310!!>32#"&'4.#"32>KbVX,ErY[2N6!DIQ.3j0;4.+326Px{?Is+'=Xe'$LwR͙9dN]h7 "@2j5V>!'| /1 /'@/0",R"PA???92104.#"32>.54>;>32#"&'H2N6!DIQ.3j032#"&'532>5#"HW֒LR؆[HH[\h8*IEC$MS '(A\3/F !/1)Ǵ0$ @ !!! B///,D?]?]10%# 4>32>32.#".#"3267㟪R؆*M%"0')Ey'#_.D .)@/!!$  P@.@H`.p..,R?]+?]10%#".54>32>32.#".#"327ELw~BJp@(>R04*'BHCwZ4|%A|wŠKBY7  4("3`W@(?)@ /o&@0)& %A&C??9/]]10+#.546; 4.+3 ?d{  z,'2fh ^yV/  &= B v5Z1@ CA??9/310!5!!".54>;;#"sI?{xSvL$7h]Nd9r}!>Vm#:  @$R S!P???992104>32!5!#'#".73267.#"mFo0]-ޜIcVW,kbBQ+h3ljG {jfH{vtm+@Q,1 ;'@1A ,, 6"T R??9/99]9/9910#"'532654./.54>32'>54.#"?:)R~KytH? 'Sa=+EfYoo7:bx4`T1&IiD@a? .H89h?0T:!"%!!$uHpuoF3sm_L*JahTN6^`N[21VqR-SYY0 1 @   CA??9/9107!!5!!5!!5–;-*)3 IJ)@*$DB??9/2910467!4&#"5>32#".732>5;41faX#OlڏFAz;0VyI@tW3g/?  %[k_r33qm+2;& Ĵ,@3 '$$/B/D??9/99910%#"&54>7.54>32.#"3!!"3267Of*H_5re9oirJXTNf>(Hd=HtQ+|K'μ>jQ5 %jO[1#:L(8R67O2y&3@A /?9///99//210!!!#".'532>5!EsX*& ';"2!XMa8 7\F+%v@*"#!!$$$ #!&&@ T \??9/999932/99//9933}10#"&'53267!5!>32.#"!d? *Qf"D#D(RRF6$&Y# T*[]'J{3bh6ia  ggߏB3<C!2)@ !=7.&&B D??9/910.#"32>7!5!#".54>32>32.#"I[ho;0fo,,))\^^,חQZ)N&"0b D@   ճ @A  CA??9399?/2/2910 ! 3 !'b1& >ds!8ShZ -=-- # @ .(R"OP SQ?????9/104.#"#3>3232>53#".5&LB*_93R9 &% =dHZm:4C'gcA4#KtPET-,H4\PZ0>`r5 RS??1033267#"&'.5 6-0O.30Eb#9+0U &}\&, @  ?   ]]]5!1@ AACC???9?/3210!##3>32.#">3:H31 (#! %'@- /!'K  @ TQQO????999//103 ##4>32&#"d),#N}Z+[$`Q,8" -1,[Y+ 6M&O B?+H'@#(#%)*%%+% 'QR T???9/3/3/923107.#"5>3273:7#".''#'ض4$7E!T $A:4EL   6*)?3*/5"St"  *"asfT",  2P8{`lZ +M#s *t0t@*,(D D# CA AA????9??]39/91032>7332>73#'#"&'#"#'/  '0!.hHQL-7B*/<#,OA7D& (QF\W]^'D3# [:  @F  CA A???99}/|/?//9910232>533##"'84;kn 9N.Qs/m ff9/- 9';?#(2@<  -B7 D??9/9910#".54>32>54&546324.#"32>! Si~{32>54&546324.#"32>B|plw?B|qp<'),20+5J)LmCNoG!)LlDNoG!:VuËMC}uMHF-23$6859X@*]]/=fJ]]/=ff(,Jt$$ t@  0  -@ (BDC???22]9/10!#".54>32%32>54&#"`'D\5Y}N$L}_$90,<4# 3,0;! hRl@KV,ņE#;,J;Ed%A%~&@ %#P RQ???229/104&#"3265##".54>3242'9'%<-7,yVxL""LxWjQ882_UZb3?HHs~EzuJ: %<$%% H@#$CA?2?99////9/2104&+3 "#.546;2+#RWG:&=+ aK7yC2$&= B +`mP|M+f#49$/!@TU!2 R)P??9??/22/9/102#"&'#4>32&#">4.#"326VX,Ki0_1#N}Z+[$`Q,9#J 2N6!DIQ.0j3HrȄB \[Y+ 6M0aOO^51Q<\&H!ij! @ ' ! ! ! A C??99//922299310#.+#3324&+32>.5?'Tri1$GiD7M(Nw?eG'0?%^2ZM=mYA_OihP9S-3.+ #@4 #(1D B??99104>54&#"5>323267#"&9]x|x]9~-RPO*KXum39]v|v]9>iOxK"\hn4bKqYD<8@M2ZK  3Z|HFlUD=:BN21L5   1.* #@2# &-R P??99104>54&#"'>323267#"./MbfbM/XbOY*OQV0dS$/LbfbL/_h\]X[Rc7=YD2*)0>*33  .I^0>^H8.*.5#323267#"&'.5#".732>54.#"I*Kj@KoH# 6-0O.30Eb#9+8)@gI'++++@jM*0UwG0U &}\H(Ji@/""/.##.?b-+> ( @(#U  OR??32?//9/32210"&5!5!7!!3267#".'532>=Ͼ=sp0q?:\B/,& H((0 -mjB[: 0++ I@  AC??29//10!##"#.5!}EM V}E9&9B ?&6@   "TOR??32?/3/99//3210!!3267#"&5!5!54>32&#"=sp0q?<|B"N}Z+[$`Q,8" -Amj  @[Y+ 6MVZ! @ A /?2/103267#".5!5! :/.>W-PqG }7-I4  *QvL옘l)9$ @ *)! A AD???210#".5332653>54&546326gak^+5T=ql08,20++Lf<l{C@ueoMtN(_~/63$685CdC&m(> ('@) (OO!RQ????99910>54&54632#'#"&5332>73l08,20++Lf<$FJN,:54.'5!##".547#+BZ6#MzXTyN&8XA{sQiz:o*mcjILe_o,QM[鏺Wm)'-  @ ("B AD???9/10#".5332654.#"5>32=vozk1BiL 9/ 6J$PpFl{C@ueoMtN(8V9  ,WVf#;@  @ AAC??9?99310#3>32.#";P)eH4  +-DbXN";`^#:@! ##$%#!OV O???99/332210>32.#"#"&'532>73' _H;  & 5qc*40SJD o3N[K#O<?dGhoA@     CA?2?29/32910!!5!!!!!5!pshyAzp==@      QO?2?29/323910!!5!3!!!5#3NIۓ};"D  @  @# D A?2?9/399//104>75!!#"3267#".KwE\EcT&"PbH?6xNЀ8dZ/~|w$Db=;^B#  Aq$C  @  @%   O?2/9/399//1074>75!!#"3267#".KwEO8cT&"PbHr>26>'Ѐ8\dZ/~xw$Db=;_C$ Aq`8T2@ +-11+1+1%. @9% +,221./OV??29/39999//910%3267#".54>54.+5!5!5VnsnV5'F8@R $-Kb94UlrlU4'Wc8O.`[O<#ToG& "!( 7YB@M-)G<9M/w.*D`-(N@ '" @ ")(#"C B?2?29/329/9210!>54.#"'>323#!!5>7!"6V54&+#5!!32TtCB?6HPZ0WY;?Z^Uas@ &Ge?zo"U%E$ @ &!!OR??9/3310]#"&'532>54.+#5!!32?̌Bi*38:YY-0Tq@FW$'`Jha[+/P?=I' BE{I)D@ ''''͵)@ R)O?32?9//99//3210353!!+532>54.=#2?C?2@Xl=/;=;/Ώ+&!/HgIKh>9S7324&#">7bR %PV[2VX,`m!DIQ.aVoy\;k3G,Dqm1Q<1hff_>f)f#//]10#3#3)fffF v@   //99//3232/3/39/332210!!5!3!!!!#!9^ǖOY{%,m#u@ @ +(,*&&ur -"s@@*&(++"$A! C A C???2?2]2/39/910+324.+32 !!5!5!373#s+2(5BP2g``6R7 m,1##ll]3" v5 `ggOX%,ku@@,)&+'#!'!!' ".r@@ -*'),"$O! Q A C???2?2229///3910+324.+32 !!5!5!%'373s+2(5BP2g``6R7 m$9čqr]3" v56Ւyy,P 18@@)852733))9:!@$ 9)*&RQS-@P7358OQ?2?22????99/|//333/9310 !!5#5!4>323#'#".73267.#"'373=@FtV& "'&Me= /'- 2< h{bdx`6ՒljG{AF{[Z,-^Eyy}9  @AC AC????9/10#52>5#5!33%Uh6K-@nVT`41R?}}\ -C).(@$O VAC????910)33#"&'53265#52#".54>n.Q #,0r^@2%%22%%2}T&  P&21&&12&*\ '1X@ ../#,@12)/1-.Q(*S(@ O V????/39///10#"&'53265#52#".54>#5!3!53.Q #,0r^,2%%22%%2z&  P&21&&12& <* L  r r@AC AACC???99???999910!##33!#52>5#5uNh6F(5TwVT`41R?<^: !5Z1'   r r6"(@,!OV AACC???99???992210!##33#"&'532>5#52#".54>u#O^0@>%9D% 2%%22%%25Tw&io9 $HjFP&21&&12&<^:)E\,DE78 EF%@DQC,18Q>1P*O(@ O V?????99?/9910#"&'532>5#52#".54>3>32#4.#"#)#O^0@>%9D% 2%%22%%2$2A,NY- ".)$&io9 $HjFP&21&&12&[f*#,QqF6!5&$-\{&$&D{&,&/{&2 &R{&8&Xo&8 :&X &8 O&X &8 &X &8 O&X v'/'@ "RP??9///310467!4&#"5>32#".732>7vY@Haw932.#"32>75!6qq)[_^,חQZXII[ho;0fo,,) T]"'+JsxF \f5we+#i+- i+ A&6FVfv ]A] и/#9-7EX(/(>YEX,/,>YEX1/1>YEX/>YEX/>YEX-/->Y1ܹ A ' 7 G W g w ]A ](A]A(8HXhx ]1,9015!3267.#"3>75#".54>327#".'f3M4BQ(e9WO!)Jte XW+9w3d8 zzn+T]2vtU!sHol“V'⭛<'EE{&*\&J{&.2'&N2(9/-&2\ &R/P&2'  N&R'o {&&R\H&OJ  @u r@ !AC AC???2?2//10+324.+32 !!5!5!s*A^~dg6R7 m,1#^yV/v5 OJ  Mu@   "r@! OC AC???2?299//10+324.+32 !!5!5!s*A^~dg6R7 m$9^yV/v56Ւ,J 1M@  3)!@ 2&RQS-POQ?2?2????10 !!5#5!4>323#'#".73267.#"=@FtV& "'&Me= /'- 2< `6ՒljG{AF{[Z,-^{&*\&JtZ !B  u@ CD OA?2??9/?//9/321032>53#".5##33 &% =dHZn;6ET-,H4\PZ0>`r5%)gf!!8 Ĵ!"A@ !DA??99/?10>32#3>54&#"=SiAcf5mΏKup?dO<1*:l`BaAዐ+32{&124&QC4\&$&D& d9[ H[@  H[0YOV HVHVVP?++44+++4={&=?&t)-{&ڜ) &t\{&$ &D\&$ &D{&( &H&( &H{&, &&, &/{&2  &R/&2  &R{&5 &U&5 &U{&8 &X&8 &Xof-&6f&VVf&7?f-&W"Cֶ@#A D??29/399//10#"&'532>54.+5!5!8ЗNx6?HbP"&TcE\EwKVuD  &Fa;=^A!w,V$;  @ % OX??29/39/10%#".'532>54.+5!5!8З'>62>rHbP"&Tc8S EwK\VqA $C_;=bD$w}l/Z{&+{&K@ @H@H++5wf-;x@  x@   BA C???99/]]104.#"#3>32J":N+ PX`0,adb,NZ1fJ?Z8/P<34E*.[\mce5CQd'D00LV*Q+<6@OSS? P'0D$*I9R?9?99?/9/9910%#".54>323>32#"&'#4>7.5327.#"32654&#"IdVW,FobX(e20RjfHpljG ,7O00O94$,88415:"ܷ-^!/++/0h9IL*!4!4!4 :D$A?@ //GDA??9/99?//99//10#".54>7.54673>54.'4.'326*Id:=sY5+ii+5Xr>:cI* "7.54673>54.'4.'32>*Id:=sY5+iYeE+5Xr>:cI* "=!5!5!e:X9&E9#shZvE ";0c^1@ O Q?2?2//10%#"&'532>=!5!5!'JjC:60(x7ӓ]P$ ";0r}ݒ/\&$&D&(xu&Hx/o&2  :&R /z&2  {&R&o-#@B@HBBB@ HBBB]]+]]+5/&2 &R/&2  [&R fP&<`N&\ocJ'5;@ ($&$6V@ 0%'S-3 /?/9910>32#"&'#4>7.5!532654&#"(e20R ,7O00O94$,88325:"!/++/0ck9G\VB/1.@ /:$@$/H(7P2-.1O: ?E .Q?9?99?9910>32#"&'#4>7.54&#"#3>3232654&#"(e20R ,7O00O94$,88325:"qvq/P32#"&'#4>7.5!5!7!32654&#"(e20RZ ,7O00O94$,88325:"J-!/++/0\H(   @ VO??10#"&'53265!5H323>32"3267.!"32654.0M"~"M0Sk?!N^**^N!?l.9D$ 9D">#'#>"D9 $D'<<'EpljGkGǀpEp-^b#[#b^-3273>267.#"!2>54&#"Rl?!N^**^N!?kS0M"~"M#>"D9 $Dw9D$ 9D">#EpljGkGǀpE'<<'#b^--^b#[T&$ T&& NT`(&F $0&/ >@ ?]]]5T&7 *`N8.@6@%O6*ER1*PV???9910267#".'.'.'53265.'.54>32.#"#': 5N;-'0<(!A XW~w5h[DsT0'^x0 D?+'*2G^@*dV9 #/,))9FX8NnF! !),'\)#2ݲ"#@$" O#Q V??2?210%23267#".'.+5!5!MoP8$.>/#5: TkF0-=R97ӓ'?Q+'F6 .IZ,!=.}ݒ/"T/3β@ OQ??9/]10#32>54.+5327dU u=[>ver5_H*Iu=*PsHƼ+327"32>7.%,@ ;Z> =I[9bwCOi[v*UZ|N#"CeC=aK6%~0:  FpQ6(SQ "QitL(>M%-m\u#18+#$@2V+/ P)R??39?107#".54>3273267#".5327.#" XW+9w3c9%,@ ;Y< 3M4(e9Hol“V'0: FoQkT]2(I#ij # @ )## "A CC???9/239910!#.+##53!24&+32>.5?'T^ri1$GiD7M(Nw?eG'0?%GF2ZM=mYA_OihP9S'=&U5 5@ p@]]]5g?@  @   CAA???9/93322/2291033!33###7!׏̘< \-`G"K@&   #$ ! VOO???9/99/322221033!33##"&'532>7##Ɛ;5qc*40SJD fg{{<?dG /? ʴ'!@0 !!!R, P??9/]910>32+3267#".532>54.#"!R]VzO%ruUX!QZb2[e6A^<(@.327#'#".73267.#"m9w3d8 XW+3M4BQ(e9l“V'HzT]2vt%3 @& !P O!R???910#"&'3>324.#"32>ErY[KbVX,2N6!DIQ.3j032#"&'4>32&#"4.#"32>N&MSY1VX,ErZ[#N}Z+[$`Q,8" 2N6!DIQ.3j032#"&'532>54&#"ELw~BEwN?BHIyW/|A|wŠK"3`W@h0;S1O& U6.@<)"P19ȿR?3]2?9/3/3210%>32#<>7.54>32.#"2>54&#"0-Hc?+F3-Z]JpN?BHCwZ4q&I9#4P&YK2*A,1VA' )*$ %)( wŠK"3`W2 " Jm`%3B,&4@VS +,/ P)R??99??10%#".54>3233267#"&'.5327.#"IdVW,FobX5& BT#Ih#&#jc+h3GpM)jfHpljGF6W'%)uJX-^m 0?!@)10.!$ .P$RQT????9910327.#"4>32.#"#'#".54>32jc+h3GpM)%PZ,,3,8" IdVW,FobX췲-^[Y+6M0ӾjfHpljGv'1 '@('R"P??9/104>32#"&'53265!.%.#"v9oilu=9waH@YB)E^9BdC +kyBTjzF2>CpP,-PoCv'5'@ ("RP??9/]210467!4&#"5>32#".732>7vY@Haw93232>5 "&(/6AJ"TlJe;! %?[?#<99 $::B*]f@1H/9H)N-4 v 6-%jT4im"7]D&  2]S5`K,0^YdfMY@ @.?7-*E@N7@ .?;4ΰ  %JR%P??9/]9/9999910732>54.+532>54.#"5>3273267#"&/#"&'XHUqCApWLa8:`G'DDL.)LLN,v`(X (/5;6\C'3tIO);%$;,&6#"5%   'F`9!A# v 6-%)%=T6BqQ.e:J@ 00)0)0#8@;)**3 PR??9/9]99//910".54>32'2>54.+532>54&#"^wEJpYd6,?%(I8!;nW8Z?"!9O-ki%E6 viCwZ4A|wŠKEmM!=5) $9P6IsP**D1*8 !:.FC3`W\A? @ VO??9/32//9///3210!!5!3##"&'53265!^:/T);7&P5Q V???999?10.#"#"&'532>=7#".54>3254>32327.#"3,8" fRXWJa9 XW+9w0]4#N}Z,,fdi(e96M0y5R9_D~ol“VQ[Y+amZ!-?'!"@.VP ('+ P%Q??99??10%7#".54>327#"&'532>5327.#" XW+9w3c9fRXWJa9 di(e9+D~ol“V'5R9 %9##!@&#$$ PR??9/]29/10%#".54>32.#"32675#5!FUs|AJpN?BHCwZ4-TvI*@- A|wŠK"3`W[\. Bb): %@*"UOO???99103 3#".54>732654.B1%~.$7W==W7"0d %!# n)QLE*K9" 7K+ DIQ-|2.& #.-$)./y BJ.B=(3  @===CB.%8R*%OO???9]]91032654&&#"5632>?>32&#"#".54>77##%!# & 80$0($  $(0$0-."4V==U6#/N2C#.-$C4 '56' &D?;*K9" 7K+ @AA!f3  @  RU OO????99]10332>73#7#"&5WQ#=BN3)OOR,ur/P<z1C*'6! @ (#TQ QP??99??10>32#4&#"#4>32&#"N)OOR,WQ#=BN3#N}Z+[$`Q,8" -A1C*qur/P32#".'532>54&#"#4>32&#"N)OOR,/,& H()WQ#=BN3#N}Z+[$`Q,8" -A1C*ℋ ":+ur/PYi+,i+%i+,ии"01!"&5!".54>32!5!!!;";.]f(I8"#29:ZH8  "$*,fXl'B21@&,?FF&')#`$  VS??//9/103267#"&'.5!5 6-0T.30Eb#9,F0U &}\b0*U$ʵ! #@+$$#"O SQ/???29/329/10%#".'532>54&+5!##5!!06s}'>62>rHHhC  I"NLF4 \VqA $C_;zwex(8NfZ -G% ,@*R"R %QO OO????9??//9/1032>7332>73#'#"&5#"#'/  '0!14;$QT.5@*//<#6YAB7D&4ZF9P1ip4Q7#Zf 3K+ 2@2"+ 0R(RUO OO??????9/]9/91032>7332>73#4>7##"&5#"#'/  '0!-2;'QT.5@*//<#6YAB7D&4ZFz|:=96O3ip4Q7#Z^ =T.*+6+@+;P$3P.6)*,O*QQ V????9??/]9/910#"&'532>54.#"#4.#"#3>32>32 53>32#4&#"M@pX#<4"1 ,QPR,WX =BM08Ma8 7\F4E*qvq/P<^'4' @ "VP  O Q??99??/104&#"#3>323267#".5WX =BM0,QPR, 1"4<#XpAvq/P322>7!"!. B|plw?B|qlw?)FgG(}CdG*@uËMC}uMC1TqA-Oi<\ "; @  QO?2?29//33/9/210!!!!!"&54>3!"3:7& 332jqN_5:\D  ZʒuG8`J]W)C:@99%/@: R::4* P4R??9/?9//9/910%#"&54>32#".32>54.#"32>=1 *@2=z|~{=2@*E' -7 Fx[]yG 7- '5'wɑRRw'5`]-UA'7^~GNnBBnNG~^7'AU-])f?u^, @ O RQ???9910!#'#"&7332>73YXSP#GLS0k`Ȅw7V=^, @ S RQ???9910!#'#"&7332>73YXSP#GLS0k`Ȅw7V=^^%3% @& VO R??99?10%#"&7332>733267#".5-TTT,SP#GLS0 1"4<#Xo@6J.Ȅw7V=FY3 5]Mf0@ U PO???99103>32#6&#"#ɟYXSP#GLS0k`Ȅw7V=^%5%@ %& V PO???99103>32#6&#"3267#".5ɟYXSP#GLS0$5"C !%$ \vDk`Ȅw7V=WFY3 1X}M#  @ Q P??104>32#6.#"#%>S\`,Xp>;X95W?#xS{V7 -]cBY5:cNa# @  PQ??10!#4.#"#&>32#?W59X;>pX-_\S>%gNc:5YBc]- 7V{S(A#̳ # @ )##" O QQ???9/9910!#'.+#!24.+32>ɇ5;C'T^ri1!A`?0-,v!@]?34.+32>t,-0?`A!1irT'C;5'Ge?<]@! ,C1! .C[=MoH"4.E6D% ">^ED<+4! @F!<70PVR???999/10#"&'3267#".=3265.'.54>32.#"NzF2Y* 1"4<#XpAXW~w5h[DsT0'^x32327#"&5YWQ`$[+XXNb#\+-_q ap 7c0>M 1 1,$7V@?.(T1:4 : U?9/9?9/9910#4&'#".54>32>454632&#".#"32>   'kG2U="!10/7',"-":52388,$49O00O7,  q'0/++/!',2 @   QB??9/32/3/9/3210>32!!#!5!4&#"<|B=sp0q? 2mj?T-0  @ O  OV???/2210#"&5!5!7!!3267<|B=sp0q?p -dmjd"X  !@# R QOO???99?9/332231033!33##'#"&=#2>75!ˮ-QPQ- =CM05WW4E*/P=I/F&" " "  +@ #0# $OR??3299//10%2>54.'5!##".54>7#5!-LmE 'D4t6D'=wppw='D6t4D' El=`x32#".54>54.'332>54&#*T% ZxF5_iUrB  (CX0Uf6:J")\jGa8-\\6rnd($?9636>'-dik4:V::y}uB'@  OQQ???/3/3910!#'#357l%B<@  Q  Q OO?3?3?9/3?/33/3/33/39103373#'#'%ӑ!͑T+}-N\fl=Q;:ӵ@  @@ Q TQ???99/33103>32.#"#';V5rc*40SJD 3:<?dGlE" + @ OQO??9?/29210 #37"kl>=p|qo|}: @OQ W??2?210%3267#".=!5!5!$9E&9X:x7ӓ08 AsZ\}ݒ/yF+q+}@ ? P@ # #0## @ , O  Q&O+Q?]]?2?2]99//]10!##>7!5!5!3>32'2654&#"]  72LjJB9%'@T#($!-&B($D}ݒ/!SJ2*I99L. "*$B ε @ % O/?29/39/10%#".'532>54.+5!5!8З'>62>rHbP"&Tc8S EwK\VqA $C_;=bD$w}l/Ztf0?sδ;@ $4,++@ $@9)/491+ 9QO?2?]99999/2999/10".54>32>54.+5!5!#.''267.#"P}V-#?Z7ChO75+&Tc8S EwK4W@ ?X3!)6#[(>#>V36O4/I[+#qC=bD$w}l/Zd54.+532+Y]LLf>;#";#."GߘYl<>fLL]Y+rtÍO$WkJ]5 W"- @ SQ??9/10+532>54.+3GߘXl<>fLL]Y+tÍO$WkJ]5q WY% @ &!VP??2104>32.#"32>7#".JqN? FGDDwZ44ZwDDGF ?NqJ#O4ݨނ5M9/-%9B5+ @ :0/00&&&&&#B#D??9/]]9910#".54>324.#"322#".54>/'FasD{}?Ufz~@#N{W$MzV!9++9!!9++9˘f@J@K~;~;+:! 9,,9 !:+)=' @ *&'O'Q??9/9910#!!24.+32>4.+328h[iĨ_U)G5.N;/L67N1*HpK'{Qs $8Mx2$"6%3 e:C 00!)6@; 1..&PR??9/99/910".54>7.54>32'2654.#";#"`n;!8I(&>,6dYpJE4ZwCiv 6E%ik-O9!"?Z*PsI6P9$ )5=!MmEKw|AW`3CF.:! 8*1D*$6F552"2*@7455/ % P/R??9/9/10%#".54>32>32.#".#"32675#5!FUs|AJp8AjO#<4"1 BHCwZ4-TvI*@- A|wŠKCoQ- 3YF"3`W[\.  - @   O Q?2?39/2210!#3!3#!M̮4g3fh8G_9 /AX'4@46'H9/> F"*>R(@ @H 57O?+?99999102#".54>#.'#".54632>5!5!.#"322%%22%%2*O@ <;CwZ5zoCcI2y %2#+00= ,&21&&12&32.#"#7#".54>323M4(e9%PZ,,3,8" XW+9w.Z2T]2[Y+6M09{Hol“V &T @ p?]]]5"'&U @ p?]]]5,B03Q3& &1 @'&3,!RQ 1 O S,P???2??99//104>323!!!'#".732>7.#"!,FtV:@ (/,Me= /'  2< ljGg6AF{[Z, -^ 7,55Jb1.+@ @#06@#1 .O-SF(P;RQ /?????9//29/10%#"&'532654&+5!#'#".54>323!32>7.#"5'U^+J#E)fS^XΈ (/,Me=FtV:'O?( /'  2< \]n<  {wAFpljGgj8X{<[Z, -^,{{.CFP{E::*K@ +P++": DzJ8"/@ MG*'QDOS?P4RFQ?2????2?/99//10!'#".54>323!3>32+#>732>7.#"!2654&#" (/,Me=FtV:=$gK*("7E") | /'  2< h!&) AFpljGgkf :/9I*8M$C[Z, -^ 7 8--+AU"== 3  ,@ B'80P@O O0Q????999/10+"&5#537!>32.#"%;2654.'.5467#2XxFåI?&-*.-()=?*8$F9#KspyTQ+8#D6" MlC-    >6 3.)7DUl^6?2-)6DU7:\g3<P):4@=.%T;OO7R V?????310#"&'532>=#"&5#537!54>32.#"3267!Q#N}Z+\#aO,;#<#: FqP2B$$,8! sp0-\^1 7M0; -/[^1 6M0/mjhb->KTB1+'($1:?KL8I??$OKD@$U5.PB+O*%'OIRRL R??299???99//92910%>32##<>7&'#".5#537!632.#"467!3.2654&#"#3E*MX)F]5 &07_T&~~+1&P+-M*5J//+5^K"g=D#((G6FP1Q: )*$ %)( *WY - 1^W6aTH-uC6P5E$5A 7n 6!7+   @80'TQ 66Q QPO????9/9??]]9/2103>32#4.#"####5354>32.#"3ޛ 'Y99R6'#% {{+]i&H!." ;O/d;6"KvT>(A/#,7ɑde2=]=-;D&; 0@;<+6Q#PS???9929/]10#5!;254.'.54>32.#"+".5ʱa+8#D6"1Qh7-*.-()=?*8$F9#2XxFFwV12-)6DU7Pj?   >6 3.)7DU7MlCClM7 <   @ OS Q?2??22210)#5!!!! 6xzg12 ~DC  C D@# CCAA???3?399//329/39/3222222922910# #33# #33FG0v,~FG0v,XM2XM=C C@   C/?399//32210!#!!#!}}}  d dg(<( @) RUO%T????9910>3232>73#7#"&54.#"> F)Nc7WQ#=BN3)OOR,)$5&/UvHur/P<{1C*9- ^8;%/8 @/9' ,R VO5T????9910>3232>733267#".=7#"&54.#"> F)Nc7WQ#=BN3 1"4<#XpA(OPR+)$5&/UvHur/P<FY3 5]M\/B)9- N 6 ; ; } x ?2??910#4&#"#3>32Nz=9+/6$zz:m?jrnEC /#=]:.kmN%H ; ; &  H}!x ?3??+9910>32#4&#"#4>32&#":m?jrz=9+/6$z7X?@D9( 7]:-jmnEB .$r6N4d -.8!. ;~ ??//10#"&'53265!5%2#"&546"*PsH4c(-k3Q\)8$)77>_B"vTSd/" /!"/Y%2; ; }~???9/2103>32#6.#"#o?y>nr{+2gD{m?8vu'3 =H V0; ;~???9/310#'#"&7332>73Vq?x?nq{+16:"}l?8vu'3  2$l%6%;; ~ ??99?/10#"&7332>733267#".5?s>nq{+16:"} "%*>N-5?3vu'3  2$l)4 j6L- Z"O; ?< ~@ /? ~ ??9/q9?/910+3326?34.+32>XQ|;9Y_3H,fw*B-'KGZSM(o %$ ?@  ~ ~??39/3?3?/2229210# #33FG0v,XM3@ ~ ~???9/3/33910#*'532>737%P]qF$":5/挲$)QsK#m 6*Mz[^Sl?//10'ڇ1yLc$l?//10''‡1yL1yLyrU T?/10".54>327Uxy=1A##3!$,I`3FvS=Z;&-)2,4**@+x" 8 H/+/21026544#-,+1]i2I.d5(*8U_Q)C2x" 8 H /+/210".5463"3/H2i]1+,-2C)Q_U8*(5/ 2;`@/?//9/]//10#32>54.+532 "Dc@~ \.>&.QpCyl1_;dJ-'5 6K0=^sY7. `@/?///9/]/104>;#";#'.Y1lyCpQ.&>.\ ~AbD"_7s^=0K6 5'-JdRR!d/2/3/33310' pn11o@_`_d/2/3/33310 7no_`_oD@ @O?]2]/9910#'#7{yygo=@ O?]]29/2210'373yyZu L@@/]//10#u?tCu@ P]]]]q59}o/'@o0 P]]]qqqq5C*HH H H++++5t<HHHH H H++++++5@ Q/?/3210#'!73xxxHzG ///10#'xxG'~@ @H@ H++5'@ @H@ H++5`!8/2//32105333`n!kk`!8//2/3210###5nkk`! * 88@  /32/3210##5#5353nnkk`///10!5Zkk+*P P@  O?]2/10#".533265+(CZ33ZC(8888]=[<<[=3>>3g#'@   O?]/102#".54>31$$10$$0$00$$00$_ %&-8!8@ &&O?^]]/102#".54>"32>54.3-N:"":N--N:"":N-$:*$$ 8L++K8 8K++L8 j%*:$%y   QW??/10#"&54>733267=lo /'$, +5'\H.4>&$7,' ))@  O?]/10>323267#".#"+mE:P>7"(=V,lE;O>7")<HI"("7+VHI!)"7+NE@@O?]]/10#7!#7gX @  //10327#"&/5./)-09"6VR/*v 2,&#q9 6@   ?_  @/]/9/]/910''7'7LuuNuuLuuNuLuvNvvLuvNv)J%// ?@   ~~???9/99/29921033#".54672>54.'ڌ͇07-@''A-60I  h56hA$<,,=$@k3 (" $+=) + ;  x??/210#5!3!53*Z[[-2&27";);@ )$} ??9/10#"&'532654.'.54>32&#"22Od1Hn9=p=XE*6(SC+?nU*Y7nO-<"/>!&L<&q/B* i)& )?0;2" e  )<} A@   0` ~ ~???9?/]]3/3910#'#373}朦(%T b* >|?/?9//104>;#";#'.T-es>hL*1G/> s8?8@ P`0@PO_]]q/]]10#".54>324&#"3264J/1I/3K0\ej+1,-)3,-)C2/A((D1_X)93),75 C@ @/32/10#'##%ϯݮ N<HHHH H H++++++5+- H+55vk8//10!#!jzxvk8//105!#vzjhvy8Q?/10%!3jhhyvy8Q?/10%!3!vjhfH%KK@ ]//10!3!5H}05efHK@ ]//10!3!H}feH@ -@  H@ /]/+23310'57!!V``HaA^*Cr*tro9Nodd /10!5!db߅+ O?/102#".54>31$$10$$0$00$$00$_{}iv*QH8 R@%0Hdt6FV///]9/]]]+/9/+10#'32654&+532LIZ2( P@ HhF!nEQ^"(-k#6C ouCLO?/10#uCC$LLO?22/]10###C#@@@HO?+//10#'##%ϯݮgY#+@   //]2/]10#".'33267'2#"&54> <[yIIy\< `bb`&&-9&SrF FrSVTTV%&<+%+2@    @ O?]]/]104>32#4&#";(CZ33ZC(7997==[<<[=3>>3#X@ O?]/103lT'٧%@  T?3//10>54.54>32?, ,3%;`Fo  !"6%,N=%9@  T?3//10.54>32F`;%3=7,?9%=N,%6"7$  1@W@@HO?]+]/10#mT'2*C/%H@ H ]]++5r*tr/%H@ H ]]++5`;'8@@ H+]/310#5!5!53n8n;k`;'8@@ H +]/2103!!#`n8nSkvC8@ ?/]/105!#vzjShj.   //10>=35$#3I.i VPRW{Q. t>/@ P?]]5`;%8@ 0]2/105333`n;kk`;%8@ 0]2/10###5nSkk`; - 8@ P ]]32/222210##5#5353nnkk`)/10!5Zkksv OR?//10#".'7326=-<#;40T%%>R0-Y%sv OR?//10326?#".=%%T04;# ;-%Y-0R>v0' /]/102#".54>31$$10$$0$00$$00${'##  (22/102#".54>!2#".54>\))))))))U))))))))nD488@ P 0]]/]10#".54>324&#"3264J/1I/3K0\ej+1,-)3,-)C2/A((D1_X)93),75fyU?/10#XBs'xuLO]/10#umkt%88@ ]2//10#5!#5!tnYnt(4@$! @" 0  )]9/910"&'#".=3326=332>=36?A52E-n1$i$1n-F'#"(4F(%5((5%(F4o/C@pO/HHP@ H ]]+]++]qqqq5o/C@pO/HHP@ H ]]+]++]qqqq5+/G@p0/HHP@ H ]]+]++]qqqqq5+/?@pO/HHP@ H ]]+]++]qqq5/C@p/HHP@ H ]]+]++]qqqq5-49 H/+/10!5!9 ̅ffBf'BB@]5]]]]5{I 9*T<( T >~/@ ?]]5t-88@@ 0]2/10!53!7t}nSm#:88@0O_ ]]]]/]10!!735#mukRukr > 8@@ 0@!]]9/910.#"#54&#"'>32>32)1$i$1)m-@,5A?6,A,#+5((5*#!9)("#')9"q9 &@/?O  0@ /]/]10''7'7LuuNuuLuuNuLuvNvvLuvNvC%K K ///10532654.546;#"#0:)2)pj%i*1)vcCv (!7>M7ZguI 7?N6]dMf'BB H+]5*Cr*tr%7svCt2 @ H+5f'BB@]5]]]]54@ p@ H/ H+]]q+qqq55vr/#@p/@]]]]qqq5;S@.  @ H  /  /]3/]32/]33/+9999/99//9103267#"''7&'&#"'>3278(=V,lE:'9w=")<V+mE:(3x7+VHIz87+VHIl+?m1@;'' 666o666@#,, @ H`p"/""/]]]q3/33/+]33/]q/9/3210>323267#".#"2#".54>2#".54>+mE:P>7"(=V,lE;O>7")<$$##$$##HI"("7+VHI!)"7+#""##""#&-  ]55F; -@    0 ]/32105!'57!<S//z&8@]]3/105#73#/C&8@ @/9/2107'5ddk4x 8 O?/10".5463"3/H2i]1+,-m2C)Q_U8*(5xH#0@  o/]2]/9/10>32#.#"".54>32 <[yIIy\; `bb`&&-9&RsF FsRVTTV%&<+%q(@`]]]]qq5@$@ /]/99/310%5%j4kd@&@ //]9/3107'5ddk4@ J@)   / ?  @   /]92/2]9107'5%#3#'⪪ok4jdddk4B'8@@/ ?  O?2]2/2102654.#52#*:$-N:"":N-9:*%j 8L++K8 Tl?@       ]]933/3229910'#7'7'7'37" G " G #;]]:LM:^_=LD+7P42,4  &4@,#/ )5P ` P  8]2/]q22929/9910#"'&'#".54>32676324&#"326%4&#"3264J/1%#"%/1I/3K0\2#&0\ej+1,-)3,-+1,-)3,-)C2  /A((D1/ _X)93),75()93),75vC-@ //9910#33#bYo:Yo)@j    ]//10!".'7!2$7jGF5q@hK[a`jc    P?//10!".'7!2$7jGF5q@hK[a`'?NO?/10!5!?Ʌ'?@&W@  @P?/10#".#"#&>323265%"HkG7XK?=<";9#GkG7XK?=<"?6I=i_5%-&LP3 -q5FG2`a[Kh@;`%@$4D]/]105!5!}wS/kK );/ )#/  &???9//10'#".546;54&#"5>32'#"3267,d1.B+yvy=?-V0#b61Q: hvF?(2 S.D*$'6M["/6T *?+3+*%(< *#6#//@   ??9//10!3267#"&54>326&#"*}/B'0c#&j3#B]:8Z?!iHG>L/ ':% N |6aH+">X)DQPEW 8 ` /   ??]?/10#5!3!532#"&546H ,, !--NONN****. 8#*/@/ ??/]10#".54>324&#"32>8&Fb<:_C$&Fb<:_C$iSH*;&SJ);%;cG("Cb?;cG'"BbB_Y2C%_Z2DQ 5/ /  ????99/10#'#"&5332>73]0Q/U]g] $)gS5(^^Mu )NW"/ ??/10#"&54>32.#"3267%Q))Je<*M"#N&$?-XU&L"( 3253#'#".732675.#"E)Id;2h^Mj/I2k85#N+7KT AfE$1ak%C^?^U8< YQ0 / /  ????/10#4&#"#3>32g.+ $)gg,Q0PbA<: )P2']]I,V. # . ,.O ,&# ???99???/]104&#"#4.#"#3>32>32 ^  `R5&'4-,!o/ -!f" .$a:0 *69%7%K*/ ??9?/103>32#6&#"#K`0R.T`h++#%*i_80geC3 );*7 / /  ???/10#"&5#53573#327*!G#fggy2FV[OOo!D+@ @???3/910373#!upuSUPG 6@     ????9/910#'#'373GƁ| T?/10>54&54632Jf@ ?6"1=rgF"HQ_8": 6G0?!Nx+DX //10#".547>7>' *H63g/.4=B!% DU63+$2#!AUmGz@ @ /]/10#"&=33267.>DN% HPk-#o&Fo]q5&]q5) ߲@O?/10#) R#'(:$ڲ'& %{&' &(O?22/102#"&54>!2#"&54>'#((-='p((-='{No''=-'''=-'3J &$Yw]&()m4&+H&,q&2=>f&<&XR&h7 \$%AC??10#!}7/6@  CA?3?92229/23231073!% 7-ɘ}/(o=o+24-'+3(² *@ ,*((B#D??9/10#".54>324.#"32>%5!4Ui~~>Ti~~?&P}WT{Q('O|VT|R(|Q[Q\sLQitLQ;,.b/@  CAC?2?39?39/23231033# PRq150w1 E@    @  C A??9/]99//9910!5!!5!5!u}; V堠9/-2u$@ ACC???10!#!#!|3o <@     AC?2?929/323210%!!5 5!!Vy\h늢;V7f<?o$/0n*%v@/$ 12$%/  /    1 ?  0/^]99//]]32329/3310#5.54>7533>54.'%pm5Ew\pn6Ex\EdBAdGEeB AeH{Ts Z݋V us [ۋV C R|Zc{M Q}Zb|M N;?'C @ AA AC??9/32??9/10!#.533>53le1vzt|8ka Bm]"/asH +;-+O*ò+'@, "B*CC??29/3?99//10)5>54.#"!53&54>323;PBZ6#MzXTyN&8XAP{sQiz:o*mcjILe_o,Q M[鏺W{&,f{&<?&`6)&d6))f&f6)&h6&t7P?1L ' @  ' ' @2"R  Q O-P???99?99//99104>32737.'#".732>=4.#"P?q^9fV@$`MPI^=# 2zb`0{y6\E' ?\;=^@!|ƋJR4  ' - @ ?>'?.--9T U"R???9/99999/910#"&'#4>3232>54.+532>54.#" AweNy13gh[`13F(=eH(D8}E;dH)EoPT>=W86N26V:_uB%3QnA7`I4bO5<_|"*!EiK9`F($=R./Q:!%Db<?f,<+# @#- $OUO??99?9/9210>'3 #54.'.#"5632%I`90]i&"+E5* 2&";42;BG^e 4?Dvvdz\*Kxm+@f@?,@???@,;  ';1@'A?A6"R T??999//9}3310.54>32&#"#".54>32>54.'?:)R~KytH? 'Sa=+EfYoo7:bx4`T1&IiD@a? .H89h?0T:!"%!!$uHpuoF3sm_L*JahTN6^`N[21VqR-SYY02_ *!@%%3 $*3'''3@P2/R??]9/]999///910%#".54>7.54632.#";#"3267dXz8(E]66N4J^`UG_;Ѣ#N}ZDf)MlD:T9! .=D%3HKNE%=,y.M % %/ /@ )) W  S?2?9/999104>7!5!#>54.'.1WqGV!EkJeP!&#0UCrd-R|q4xüaCbI09H[8'E?<99=#.$ Ntf?@  QU PO????92104.'3>32#4&#"# 9ROR,XW =BM03x|{7EE*vq/P32.#"32>7?xqlv??xqlv?-Ie>DfE'+JhAIjF$ɞnX  oY[~u7Lbǀ=Vi- @  OR??99/10%#".5!5!3267%_4HxW1[Y*R" "M{Y%ejc ' B@    @ OOOQQ???99??329/3210!##33',)51B?(?@ (&' !$$)*!!$( 'QR T???9/9/9232310.#"5>323:7#".''#!%.A !T 3UJ?E   6*)?3*/5^/=$ 5bOg",  2P8{f5&A %"%$#@%''&O$URQ O?????9991032>73;#".'#"&'#N@?G, (#2G0 +POG!4Y"-O=O3D)/D*9I*%'F 5@   QOO?2??999/3323103673#F7kMf}Fh}yyBm#$) @=8B===@3C.Q8 =)3##WBS?2?9/9999?9////99105!#";#"#>54.'.54>7.54>7otd,uOtK%%IoJeP!&#0UCri1*EX/+B,5H+6R_*Y_&D[55P:*9H[8'E?<99=#.$ HeP>nX=-@L'-ZQ?\ R+:%G @  %& OQ%Q???229///10#".4!#>5#5!#3267:53ZM/ 71;C! $*(;Gmrrm@]. f#/  @ $ P U!R???910#"&'#4>324.#"326I}[B{*4lqqe/<_Ew1}:ȆC":cKLpKa7)y/E %*+% 0%+W @ P!Q???999/104.'.54>32.#"#>6\Cod,DpN>AHC}Z. 9ahaQ&#1/ MipC"-]PMuP92R\8'E?<99=\?1<Ӷ  /%@ 2O P*R???9/9910#".54>323"&%."#"32>54&b9I4b TpD)Jh@Jf?O\9trOC}vËL CjB\]/?gGw?5@    OR??299////10%#".5!5!!3267+yA^V)=_p0l/ +WX lk #$ @ $ORO???10#"&54654'332>54&' ?vl1M88cI+ mmښSF{4̾*I:`?3jppn)f?"-T(# @" ./#"R p ?  S- PU??32?]]]?329/3310#&54>733>54.'Ew\pn6Ex\EdBAdGEeB AeHf ~H wKsG { Bc~FNa> Ac~GNb> 7\)/@F +/,-.-.)*/((.+-.O /( $PU V??3?9?399//933}339/103267#"./#.#"5>3273V%*58P>0b8:$*57Q=1O2='2 3O7z?'2 2P7}}{QVf%!C @ "# !"OSOU????9/329/10#.533>54&'3`e3ru>_?  2fkf7hkPИ =jhpnmm~ʔ\'?4^$ͳ%%2(!2 ͳ  @ 226335$O-RR O????99/9/9/9/1032654'3#".'#".547332>53A>AJ=2)8-TvH(H9$ -=H$?mO.7*4;#4".#}]bo|B6YA>X88w bbHzX29W;M}&hi}&ti &R6&t6?&x6l!8IEE29@',,1EE">T"R??9/33/]910".54>32'2>54.#"4.#">4ZeD)'GauEZ{J #:N*LjB?udDgF#5S;([[U" (?Z'B3@B>6* s14[{OvG3Un:AcI/ ?bW`uB/Qm>CnO+  !4rpeM-"<- &Ajf=IZ b>KQ=<?/G44 /% L @/?O54.#"5>3232>5".54>323%4.#" #@ii)" 48M3 goB]?%}70Rm=y%Ca=؂WrDC;1A(S".   A CA??9?/910>3"#4.#52< S}XKmA5HW`2WTȄBJuuIBȅ&6 4{&C"7D  122+@8 3R1 0R&P?2?/?9/104.#">%4>74>32#.{!7*!+ A_?2EGl30#7_H$Dc?XwI 2gloc.SY/4R:=kYywCh 7[YRrH!aU'E{gv˗\XW/,FM< -D D D( @5(E9AR0R 9'$O???99//99//10!27##".'#".5467#"'>32>54&'!32653aq; a &<0#FlH(D2  (8C$?bC##3-a ,>L6?!- & ! ."0EC[)QyoE3WA>V5;{rP&#[,!1ZPwNOvH_7vw2b4NP) $~;N+ ,E2~@OI@ ) +P R7R??3?99/999910.54>7''7>54.#"'>323267#".'532>58Q5 u)<&#,-$?=Z< )u)<&#,1:\B/,& H(( ;[?3ibV!%O(2 ;^B3ibV!{%O(2 B[: 0+9/+,4#ò @ (BC??9//10#.54>324.#"32>/EsTek7(GbsAvC)QyPLwS+*QxNLyR, }A  EjwQ0;Ƙl[(-]blZ(,]\f *1! @ P&RU???/10#.54>324.#"32> 5c[Zb3B|qlw?)LmCNoG!)LlDNoG!iWp MquMC]]/=fJ]]/=f\xN512v&@6/?_oF?/]310>54.'.54>7>7 .Pi:6pi]E(M}NmQ=(_is=AmP,;a~C0^WJ6*x&>74+1 $=ZtŊY%%%#EdOl7 "8V?5rOy'/6 &@0+ @/]]3/99104>7>7#>54.'.LYRHEGBBy\7aP"&#-EQ$na,}c5., )EiM4K`:'E?<99=#29 Q},@ AC??9/2910!!2.#!#![YP(4G6XIH|,!f, @  P U??9/22910!2.#!#4>32.#"GYP'4I65otN?BHQi=IH|+!Nxl2"%IoIF %@CA??9//2222103!#F` F%Fuz"@P/?9//222210#!3!)g%zF%+5 !@&,+ C  A??99210'.''.#"5>32#>5<.'V+-X9a6\K97Lb;a*@N$(UE,{H&B{4%$ ji|+4e ;~/0%@/  ,0  /$//9910%'.''.#"5>32#>54&'R ]Q7JbD4YL?;Pe<]&AX14;;0x~43.xx7+ * ŲURni'5Z LL0r"//<#t"M=t@<3232>=#".'#".5332>5332>53#".#"F-L&3:=(C02'"92,+3@*/ZF*!&,&"*(#-PpC()'(B<: +"i 3''3 $ImI /<##<./<# !9, Mg?Z GO? +F FH9@DR 3 ?97332>73#".#"5>3232>=#"&'#"#'/  '0!-PpC()'(B<: -L&3:=(G3-cEQL-7B*//<#,OAB7D& (QFMg? +"SN]^'D3#l4  @ A C??39/3910#"32673##".546;WZ*^*131t4 Cv_lf3 @ OUO??9/?39103##".54>3"3267-yFY{ISq@L( &Ff@:{3z2*ecxC/RqCQmB57233 )36.@ 24S#2Q??9/910>32#".#"5>3232>54.#"#34&VVR#Ha:3XvC()'(B<: -L&3:=(D16U=F?1 NmMg? +"H7J, iN Qi<=E&B̴&1X~@ 1R , B)@9 99 6!JR<6P??9///99/10.#"326"#4>3232>54&'#".54>32>73#".'.,e-+4F\L9DG9%% @hDEl-NN:T60YC(01) (14EsaQ")+-=>6" +>65+ 09DB??992104>54.#"#&54>3232>7#".5UnsnU5 %D8)C0Gm;aN 4VmqmV4.RoA1idY!QpbMkV~]D829G27*#8)% SpC9Xj0IiP<7:JcD>R1$$X=:6$ -@>- 529RP??99104>54.#"#&54>323267#".*DW[WD* !<0 6(!HsRJiG*)CVYVC).O?WXQtTZ/B`E0&!'1#/# +!,]K0+7:8;T=,'&0A. 6') (LmH!*-?*,- x@+ ,*-$A-C A???9/229910>32.#"!5'.#"5>32 M;BJ+B% .&,-4"11"2+*&. %B+H@:#HDU/!ICakaCJ$0UCB<),;)+ @)+,#O,Q O???9/9910>32.#"!5'.#"5>32 4=F*4B *#))+-1-*&&#+ :'B<7G1B)  1(GV G+3 (C23pNC"J5' 9/@9K**"AS4D??9/104.#"32>"#".#">32#".5467>32232>p1TqAMP4Vo:FxX223/?HCc~P-VV^~JShm{C?qwCHE2=Dm_*3*575g(;a~6]|F-.=ʍnKK=?jW } I5G '8@'JB7/S"R??9/104.#"32>>32#".5467>3232>7"#".#"Z'AT..PML*)Id:FjG$FmVi;E}hmn8>ow+W02=D 23/2;>ZsD!WV*6S:g(;a~lc`@{unKK=?jW DoH7Y-@ CA??9/32//9/321053!!##"5463ٳn6K6&cY"+|HIna4@O V??32//99//3210!!#".'532>5!5!53]DmO  4+6 _YU)5O624=@5'~078 ~@>5 7$+R P??999999104.#"'>323267#".54>7''7> #,-$?=Z< )u)<&#,-$?=Z< u)<&(2 ;^B3ibV!{%O(2 ;^B3ibV!%.=D /.8@.>$))84;R4P??99/]33104>32#"&'32>32.#"#".54.#"3264lqpe/I}[B{*sc?B9&n8#;:@(.2/c_.<_Ew1}:cKLlȆC"<`S   &SZKa7)F\hM9/- $1@%! P!R??9/910!#".54>32.#"!!3267=x9xќY^}3k6<~>E~eE  CfG>=-sÖz3DpTYvE $1  @% !RP??9/910732>7!5!.#"5>32#"&'=>FfC  Ee~E>~<6k3}ۢ^Yx9x= EvYTpD3zʗs-^3DF 4E?"@*3.'V!?>BR9P T???99?/9104>32&#">32#"&'#"&'532>54.#"326#N}Z+[$`Q,9#JaVX,Ki0_1ApX#<4"1 2N6!DIQ.0j3,[Y+ 6M0aOHrȄB BMa8 7\FO^51Q<\+&Z C@   v @  A ACC???3?39/33322910!###3 3 { Xwme @  } @  OOUQ???3?39/332910!###33ߞ{ʘ32#"&'!!#5#4.#"3264lqpe/I}[B{*2ήG<_Ew1}:cKLlȆC"{{#Ka7) +!:ǵ#!"@ @ DP!!B?]?]210>32#"&'532>5#"HW֒LR؆[HH[\h8*IEC$MS '(A\+&&w`@@]]]]]]5 +&ww`@""""@"""]]]]]]5{&({&(?E@   @A  C??9/2/9///1032'5>54.+##5!!b~HOT3`J-EpSN1cdk/CsY)XI/F{&Z-!I !IJ"@O B  D??9/]9/10!3267#".54>32.#" TGؔGPي[HGZ\e= '#AOX &*8leo-6,{&,m-^(\"x Dn @*)"/ A# C??99//]9/9102#!# "'76!4.+32>cV&} !3FSP'7K3 +K:X`4G+9fRu0 7}4YB%"@ZR^ !Kx # x@"AC!! C A??9/9/??9/104.+32>332#!##33+J9X`4G+B^cW&9Z?""@Z9fRb9; @ACC???9/2/99//1032#4.+##5!!mr:CnPN0iudTsGF{&.{&3f&{ 8 @ C AACI?????9/10#!3!3!  \$ 7  @   A C??9/9/1032#!!!4.+326Px{?Is$LvS͘9dN]h75V>!'}%AC??10#! JN w @AI C I??22??910!)#!#32>7!/B-B  !@<5, x#O'cd{(uw    Dzv  @  A A CCCA??????99/33299//310 3 ### 333Dͤ͸Cˮ/{Zbby{m+1b@ "% " "" 1*@ 12%/ /1/DHB?+?9/999///910732654.#!5!2>54.#"5>32#"'mK|+QtH=dH(>fNSWJrfq5_H*Iuʞ&y2O76R8(L:#j% /LgA^j97w @ @  ACCA?3??3?993/2/33103##)$%f&..x @  A CC???9/10!#! #"'7>7!ɲ '*yL H1150o+9/-2u#@ ACC???10!#!#!|}3\+&V793[@"      C@ DA A A???3??9//39/23}3310732>73373#"&' 8(E?:&^FɼwEXsK#M+7533>54.'bu@Ex[iq N;L 1 @  AA CI????10%#!3!3L ߲Ke. @ CA A???9/910#".5332673#F6Tzl1BiLO5?@veLMtN(HT 7v tv@  C AAA????29/1033333!TBttJXEA v v tv@ C I AAA?????29/103333333#JP tttV#!5 @CA??9/9/105!32#!4.+326#|y32#"&'53267!5P 7ccSGOX؏GKً[HGY fl7'# !WQ &*T?-.A %xx@/AC*D B????9/10>32#".'##34.#"32>+R|Ue~F!O``|H "@40?% #@52?$ َEZUVaȆEFǁLJFI^&P@   @#'C""C#A??9/999?3299//93310>7.54>3!##"#;#"+,/:\=3m~E'A5+ "BcA7@, xmD} ;> '22'@ '< "7-S"R??9/999/2104.#"32>>32#".54>7>7Z'AT./OLL+*Hc;FjG$FlVi;E}hmn8D{$ONH39=u\0WV*5R;f);a~lba?|unKKg Du"/G (@#0 ͠''' P+R??9/q99/910#"&'>324.#"3 4&+32>:zUY^pbc0YD)=cF?^.+1`>YsC%ErQ-  }Uz%;P#8(NO,<!@ OQ??99//10#!VDF  ~@O \ Q \??22??/9/10!)#!#32>7! +8"> $ &D:1' lVbjCwuHhd@     ~@ Q  Q QOOO?????9?9/99//10333 ###11K٠پL>l@ */***4@ ?/Π%9>@9R %P?]?]9/]q99///910732>54.+532>54.#"5>32#".',db[$UqCApWLa8:`GN])_ba,v`(2M66\C'3t%Y_\( );%$;,&6#"5%  'F`9*K<* %=T6BqQ.  5@  OQQQO?????9933103##\J==o&'i!- @  O QQ???9/10!#!&'7>7! /BTal9(F<1( lVq3=s15d@3   A I OO O  O Q QQQ?????9/93???9/9/23339/+332310!#'#'#3735 ;?@//sߜ8O 3 @ O OQQ???9/?10!#!#3!3Ǯ5ˮDh\ R$@ OQQ???10!#!#!Ǯ5'TfSF^@  OQ??29/10!#!5!VV;`\)f?"-P(# @" ./- . "#. SU??9/329/329/10#.4>733>54.'@tbno8Ex\Ej@AdGEh@#DdAf }D w?y{@ y =dHY]6 >32#"&'#5!\+]((Z*CfE"D(^/@xi]J}9XR*EkU|P& RR%D&' @$&# $O QOQ????9/999/10!34&#"32>>32#"&'3h2cl< :=P/$?"^^.6dd@J4OW0@W-QqBPyR* !2! @"!O R??9/99104.#"32>>32#"&'3DDlL0r33_9TpD24:"mU9*?++Dg "L @!#Џ!!! #@ pR  P?]?]9/]10.#"5>32#"&'53267!5+7[IQDJTŃBEXDGO DGzJ D|ƆA"T?*G!@ +ȰOQ& RP????9/]10>32#".'##34&#"32>-TzQ[zJ _zHH\)=)*=(+>(Duk3=~…@zo;XNб&ZmwV&ZV(P@ @ )  QQ$ P???39/99999/993310>7.54>32##"#;.#"!O&HC}&Hi\23[2)/,,.@ .43+$ @ H 3P,2/0S+QV???22?}+9999//10!>32#52>=4.#"##5353&KNU1P}V-3J^rA'C8+.H1#=BN3-C+9j8 (PЕl./P=s&tO @Р Pp R?]?9/q]29/10!327# 4>32.#" HRK}XBGTL}\7D?DžC" %KtGVL}&i\hM^1J!0 00(@(!0O)(QQ R????9//99//104.#"32>>32#"&'#'7>7!+J3*(6G*6[T'BG )8K^;1& 5=70C\/RrD Rr6 ;qZ^)L($%)""%@%*&O)"%Q!Q RO????9/?9/104.#"32>3>32#"&'##33+F3*(9G)B6[T'BG5'@,1B~-RrE >e'&it&C`o&\ 8 @ Q OOQ\?????9/10#!3!3!ʮRF *FW36#F+>6u3+3G&B0D5C9 DCB??99??999106232#".'#".54>3:.#"3265332>54.#"gV&DsW;4) `EWsD&Vh 8E& /):54;)/ &E8 )VS 0#E9SV=|AJWWJA|=RO@    @ OO Q  QO??9???/3393393/10# #3'3654&'*8![]奪z},5+ =uh`j&J#?9@ CA?2?9//99//10#5!!32#!4.+326y{>Ir$LvS9dN]h75V>!'}#-+H**(+%"#@#,+"(!'%(O!Q R???39/29/104.#"32>>32#"&'#537!!\BiJ8\))U*UsD/)]9uo6A{s]J=3&<*0?R.RpAMwR+ R-T++g+'x(@ %((,*A'C@ % D B??9/??910>32.#"!!3267#".5##3EoVI]4Q(@^@#v @aD(Q4_GVsCۅ9 ,arm0 :V1X'31@2'&! !,R POQ????9/2910#33>32.#"!!32>7#".5?lZ*j-2108Y@'v&A\9012573Zk;;Xrl4  Dv[~eJ   ;uu \ U ó @  @CC AC??39/2??/329=/3/3/91033####3 VUl|]]wz(> V@    ̵ Ӳ@  OQQQ????39/2/233939=/10!#####33'>ƱGL_DD^PHltH@     @CC C AACC???9/322?3???299//9910!##333####36èxx%%xQd)ddg2Ry@    V@  @  @ O  O QQQQ?????9/?3//33999/993310!#######3333R~66~ѢõZ:::^^u Q ¶ v @  A CCC????9/3/322910 ### 5)ͤ͸ _`*Dh L@  @ Q  QQO???9?/33/23/999105! ###3!Sz٠پx& J//- fKMg@ H u@A  A C CCC?????9/992?/9/23/33/3329910###!#3!5)ݣ7×G`)0K8_S@   |@ OQ QQQO??????9/32299/2299292105!###!#3!3!bϘ$ I77?cNr<gp@ 6(%/'&&"Ĵ9< ȳZA"Mx@ h[ZZU`Pe<HD2@,&6(%B?3?9/9/23999/39104>7>54.#!5!2>54.#"5>7'37>32&#"32>32.#"#"&<)Ic9>yl[B%+QtH=dH(>fNTX:Oְc4*  Nfq5_H*3Y{O(6 BA,mpj*&;30#<;;!>gcf<}r:S8 7S>2O76R8(L:#Ձ\nPj% 0KgAZX6! *3    {xlj@ 2# *"!!754.+532>54.#"5>7'37>32.#"32>32.#"#"&54>*]ZR=%ApWLa8:`GN^5/3>(}'Gct #4$$;,&6#"5% Ȁ]iG-CW2*K<* %=T6UpF% *3   {k:R6?'WVf%w9/-)3$ò %@ *%BD??9/10#".54>322>7!"!./Si~{322>7!"!. B|qlw?B|qlw?)GgE*EfG+DuËMC}uMC2VtA1Rk9`#?@   A CA??3?99/93323102&"#"#3>) $ ZL? )=U# 3'/Q<#BB@@! OOQQ O????9?9/9332310>32&"#"#37':R; ' # w53!0M6 (h`{&" B&#Jb?+)AT@=54.#"".54>32"&'732>737< %%""%$S^/ 2dWX_-"7Pс#?jY+2F Do>͏77ϙ̓><˾AA͗e=~A'Ge@j]b?'?Z@)=(99(2;:?(:(:(Ayy@ @;O=)(9Q4.U(OP#R?????99?99//9/9910#".54>324.#"32>"&'732>737I<`FC\8<`EC\9)"&))"$*#?jY+2F Dy33wz32wě\e55e\\d54eW~A'Ge@j9/!AN@5? %//%?5*:@*B2/5A%"? C?32?3393333102#"&'.54>7>2>54.'#"&'>66UWV+3Z|I +69XXU*4\KX9*E0E.+D/J--I/D--F1H:.nցסk.!?1o؂ءk2?m#`{QW}]"''!_|PY}] &\ T7N@5- ''-5$2@$8*'-O5 Q?32?3393333102#"&'.54>7>2>54&'#"&'>85R*QtKT64Q+SwLT3*E)<&QJD**F+=(TKGT:/(^\/>7-&^\1=& GYg8&$% GZi8&!(F qDXn@34MNnc\iXiNiNi#D+<4u3+@3JQMXEMffYn&B0D4A7 DAB??99??]/9999//99106232#".'#".54>3:.#"3265332>54.#"".#"'46323>54.54632gV&DsW;4) `EWsD&Vh 8E& /):53;)/ &E8 UxZC *-ad88=HY7h7%/63F3S=)VS 0#E9SV=|AJKNGA|=)2)>Gy# .8>$B3R:BVl@KL?WOW_WW0a@aaZgCg;LgLg;2*;"!!"/%@R/@6OH?OOKVCKddodddWl OR??]]??99/99999//9]]10%#".54>3:.#"3265332>54.#"56232#"&".#"'46323>54.546323jMPh<1^Y 8E& *!<11Gy# .8>$B3 6& & &O&?5\f+@ ǴU O B D??]?9/10.54>32.#"3267#ϐLR؆[HH[\h8#D S` ')Eyf7 U  @   PR??]?9/10&54>32.#"3267#JpN?BHCwZ4#C wŠK"3`W6)+4@    RS?3?39/329107%%'%7=DCCC )O׈P:~@  O?/10!4>32#!#"&54>< %8/!,a %8/!,$;0) $;0) K@  O?/102>324&#"#Cn\OHG%yv95;DPavH#yG>"f*@  @O?/10.54632=S3F36/%%7#:K*>8.!*@ @ O?/10>54.546327%%/63F3S=!.8>*K:#fY,;JYhw@Q53###33j.SsE#9*+:$|p f;X<yt/!!/).C%$Ro #V@ # @@$ OOQ Q??3??3229/910!##333##".5332>5yJM-QrEPrI"!8*+9"==ln;\A""A\;2''2 !O  @ "A C??99//]3239/221032#!#5353!!4.+326P{z=Gu, JvW͝;fObi89Z?"#+M( !*@%!,+#$($/?_$$'l R??99//]32222104.#"32>>32#"&'#5357!!\BiJ8\))U*UsD/)]9uo6A{s]JA3&<*0?R.RpAMwR+ N-&3 @ P]]]5f&S F@ P&&&&]]]5$j@ ACK???103!#!Nó[h#O@ OQ??103!#!N{ٰPh 4 @    CA??9/32//99//32103!!!!##:Ƶ-o\B 4 @    QO??9/32//99//32103!!!!##BTLFf'?' @('%UAC??9/?921032>54.#"#!!>32#"'RB^{I!9NYa/?:؜V3q~R^NpWX7 s4}Лef(:'(( @()#(QUO???9/9210!!>32#".'532>54.#"#'L#qF2o '#PsI#.V|N B%9uvr̙Y8k`X|N$5l\ v@   lv@A  A ACCC?????9933?/2222210!### 333 3#L%w bby{{Vr\@   @O  OO QQQ?????9933?/2222210%3#### 333 LLяqm+& & :J   l @ A  ACC???9?88/3//3310%3###33 _V_6G  ~ @  O  OQQ???93?10%3###33 Z,)q51]@     @ CA  AC??9/9??/3//399//993105##335333 ##88m'g'^7RY)V@   @ QO  OQ??9/29/??9//329333105##335333 ##55m%q%3l2͵$Q @ C @   C AA???988?9/32/3/32233103533#3 ###$xxm_R'\     @Q  Q OS??9/?9?29/10353!!3 ### ),1s#+ D   @ A  ACC???993?88/3/322310!###5!3+aU_#' G  @ O OQQ???9?29/10!###5!3'X}`Z51oH> v @ AAC C???9/?/2210!#!#3!33#^۲%P X)tV@  @ OOQ Q???9/?10!#!#3!33#y`5ˮV Dhqof 6  @  A CCA????9//10!##!#3ײD)}Xf 8  @  O QQO????9/210!##!#3}ϮeTDhdf0'H  @ (F%  ACC???9/?9/910!###!>32#"&'532>54.#"<N~W/@lR1#5:/D+}9ΔH@ÃwY#df0)B)!@*& OQQ???9//9/910!###!>32#"&'532>54.#"<N~W/DoR," 5:/D+  \q-q”z5,^ewK9C+7IX6 $)38B@ )))88K@G!=..!B! DD???9/9/3/99//2910%267#"&'#".54>3"3267.54>324.#">,%Eu2e~{>iK>vj\$B\5EZ# 3&06@@ &&66G@C!;+++!P! RR???9/]9/3/99//2910%267#"&'#".54>3327.54>324.#">& 7a+bwlw?=wsYqB)LlD'&CF=dJE^:<5%b $( 67).y-C}uM>dJ]a2 KdYf74^OB4UU2Y9/\+&& S&F AV ,v @  AC??/10%3##!5!!m }}}V^ ,  @ O Q??/10!#!5!!3#Qvj V9qf<Bf &@   QUOO????3/29210373#B57phffIֲ ٳ @  C AA???9/3/39210!5373!!#!/'`X'/ѴD""Bf=  @ U  QOOQ????3?/39222103!373!!#!i57phlK@     v@A A   A ACCC?????9??/3/3/3/3910%3## # 3 3z [p+-oVFJD@    O@  O  OQQ???9?/32/32910%3## # 3 3 dq~L; @ A A C???/910%#!#5!#!3L K+7; @O O Q???910%#!#5!#!37 4ڔjZ<Ve\9  v@A AC???9//10!##".53326733#r6Uzl1BiLO6d ?@veLMtN(HtV,9  @O OQ???9//10%3###"&53;3e oڰ GoOq73#k_,4S;=n**l?@Et_LEkN/H?MK @  QOO???9/3/3]9/3210%5.535333##򼯰-G21H2n+ @  A C?3?9//210>32#4.#"#3 6Tzl1BiLO5@ve>MtN(-@  OQ?3?9/21032#54.+#3Mڰ GoOg7#".'.54673>324.#"-lH|`1SJE$'JLR/q5D`< ,90gw~Z!4]I@^=/?hk7   LӇ#;R2E<&4c_~r33q1<M<(%z=@2(!<7-P R??9//10!32>7#".'.54673>326.#"FpQ,KD> $DIQ0rm8?\; *6 9fbi_-4XB9Q6+%2MwQ*   ?wn8O0E<#4\xEByRCoP-,PpC-*2=`=)&jt3>@3")=8.BI D?3??9//9/10!32>7#.'.54673>324.#"-lH|`1SJE$GQbU)D`< ,90gw~Z!4]I@^=/?hk7  !Zv#;R2E<&4c_~r33q2=`=)&z3>@3)"=8.P\ R?3??9//9/10!32>7#5.'.54673>326.#"FpQ,KD> 54.+#33{E6q{(X0*I!^{IB~s! >~Ǔ}ϓQ :l^]#_f "@!"@#!O OQ U???9/3?29210#"&'532>54.+#33?d{E2o1'#PsI#6bS#BsirF&T`XV*P5TB xA  CC???9910!! "'7>7!3#J98:@%++7S=,y|#t9F( G1t.C!X@O QQ???910%3##!&'7>7!jy /BTal9(F<1( llVq3=soe8 @AAC F???9/?/910%#"&'532>5!#3!36s{(X0*I!_|H۲%w}ňH 9eO)f8 @OOQ U???9/?/910%#"&'532>5!#3!31n1'#PsI#5ˮFr{@M`zDhoF   @A  ACC???9/?/910%3##!#3!3|p۲%.CX)aF  @ OOQ Q???9/?/910!!#3!33#5ˮjDhle9  s@CA A???9//10%#".5332673##F6Uzl1BiLO6ҟ @veLMtN(H9@QOO???9//10%5#"&53;3##ڰ GoOʝ ﮦ32#".732>5;41faX#OlڏFAz;0VyI@tW3g/?  %[k_r33qv'6 (@'"R P??9//310467!4&#"5>32#".732>7vY@Haw9@  @A D??9/]22/2/9/310#"&'532>54.+5!5!8ЗNx6?HbP"&TcE\EwKVuD  &Fa;=^A!w,V$Dܳ @% O/?9/]2229/10%#".'532>54.+5!5!8З'>62>rHbP"&Tc8OEwK\VqA $C_;=bD$w/ZP&N&o{&}&i/{&2 }&Ri9/-)1$ó *%@$$BD??9//2210#".54>322>7!"!./Si~{322>7!"!. B|qlw?B|qlw?)GgE*EfG+DuËMC}uMC2VtA1Rk9/{& }&i {&}&i3P&`N&\o3{&`}&\if{&;`&\?{&)}&i) &l@  AC??//10%3##!! ϏV &@  OQ??//10%3##!! ُq{&}&i}!Mt!@  A!C E???9//2/910%#"&'532>=##53!!!!P$B^9&E9*!:ƦZqA 2(|\-oJB}!J!@  O!Q W???9///910%#"&'532>=##53!!!!x$B^9&E9*!TZvE80o}fM@  t@AACCE????9?/32/32910%3#"&'532>=# # 3 3$B^9&E9*!Xp+-oZq? 2(|F}QJ@  @OOQQW????9?/32/32910%3#"&'532>=# # 3 3$B^9&E9*!nZvE80o~NL@     @ A ACC????9/22/3/332/33910!# #!5!3 3!#x}[+-\II3F)C@$    O OQQ????9/32/332/339210!# #!5!3 3!UN2!O~VZ*@  CA??9//3/103!".54>;;#"uG=z{WvJ 8ibPf;xv"?ZmGS!0B!** " t@ , %DDA???99///9/3910332>53#"&'#"&54>;32>5#",-$ 9bJFY$e<+auDR* A[9N9 2'GhC!-!'*ĿMwI_v{ !7*o%Ed_6C$4,@5S 1O'R$!R?9??9/?//9/39103265.#"32>53#"&'#".54>323!//2/%0 ,-$ 9bJFY%c?Vo@At\8iR"54.#"5>3232>53#"&5-RsFJF=dH((F7,5A+%@>=#WS'fq5\D' #&<H  '@ < << 2@/#0*7RP??9/9//9///104.+532>54&#"5>3232>53#".5;lW87L[0[\'2$$5/.W{M$Vcnt73' CiJ0`M/ $;,&6#DL 'F`9Trk%E6 /#{GhC!8eS1+,C%ķ( l@(  BC??9/9//9/99103##4&+532>54.#"5>32i ք:\A#4S;$DEK+KRZc4fq;]@"Vcq6R8(L:#-V|Oj%&Fk,H@ $)+(@$P*(Q??9/9//99//910!4.+532>54&#"5>323#ApWLa8_i)GHM.SQbU'2M6}u  $;,&6#DL  'F`9*K<* wmq.C#k"n@/##)DA C???9/9/10##"&'72326!32>53#".5  7=C% ?E$ )-# 5]JJc<=;H' + N9 2'GhC! ChH,?,," ~@ !!'ROQ???9///9/10##"'732>7!32>53#".5 &053#".5##33/-% 7_JJe>N9 2'GhC! ChHQ)B  @ OQRO????9///9/1032>53#".=##33,0$ >cG3[D(ѢE6 /#{GhC!8eSDhB,*5 IJ# (BD??9///9/10.#"32>=!5!#".54>32-ONS0Xf82]QRe98qstMY~; <~Æ@'KjDMʁm1TU@'3#@P R??9///9/10%26=#5!#".54>32.#"ys9kbj{CJpN?BHCwZ4/Qoeo2iY(A|zÈI".]]]Y,V2 o@ DA?2?9//2/9/10!32>53#"&5!5!'/%'4 2'|T4  @ RO?2?9///9/10!32>53#".5!5!",35,?rX4V.8 7/@kSKm+2U@ &&,@  '$$/@ HB2/D??+9/9//9///10%#"&54>7.54>32.#"3!!"3267Of*H_5re9oirJXTNf>(Hd=HtQ+|K'μ>jQ5 %jO[1#:L(8R67O2y&<P%,,2@ -**7@ H P<7R??+9//3/99//10%#".54>7.54>32.#";#"32>7']_Z$t3#>Q/]U(`v,ab_)^NG`:8`MWpACqU$[cc,  *LmB6U?* dT9dK,  %5"#6&,;$%;)  }R*B! xt*@ $EA  CC????//910!# "'7>7!3#"&'532>=J98:@%++7S=,Q$B^9&E9*!#t9F( G1ZqA 2(|!}D'A'' 'O!@ QQW????//9/103#"&'532>=##&'7>7$B^9&E9*! /CSal9(F<2' ZvE80oVq3=s>#'+6($ 3,A  3n)n) n%n@#/7 C 3)''2*A%C??9/9?]9/910#!!34.'&'6763#53#4.'&'>q9Xer5_H*I`).*P: O0K<3 1G'"# j% 0LhA^d y2P7O %9r”(G3} 6Q60 6@   OQQ???39//3329929910!#'!#3 0SUMyT@   ~~@    OQQ???99//2//29/39910)5!#!!!!!%3f43?5@Kb)F@FFG90#G@ ?@< P@)FFPAR-R?9??9/?99//9/9910"&'#".5467!4&#"5>32>32+32672654&#"2>5! [{#oINmE ]l9p*=BF5WN40*]7'9' 3;>8A@tc66  R\KwQ+Ten'#  5dSKJDXV.Om?>mP.G+P̳Ѳ& @,& % OQ??9/929/910#!#53!24&+324.+32>8h[iĨ_U)G5pc.N;/L6*HpK'{Qs $8M(K>E2$"6}6ͳ @ P p R?]?]/3/103267# 4>32.#"9,Z\OCHRK}XBHUL]4eV' DžC" )Y "@ QO??//10)!24.+32>OƁ?@Rr}gV&;z~|:VW,7)XH!=@QO??9/32//329/103!2#!#%4.+3#32>H.Ɓ?@БRr\^gV&G;z~|:EVW,)X / @  QO??9//3/29/10)!!!!!+ %8T *@ #**#@00 )**@HR88885P?]?+9/9/3/9///910>32#"&'532>54.+532>54.#"OIv5'C\66M2*bvXS]NG^96`LWo?BpUHX.QqB6T=% *32)'%=2%%22%%2[&12&&21&- O  H R?+?/3/10#".'53265!5([l$KE=:Eel7FAsV3 #(_g B  @ O OQQ???9?9/10!##33JG519 <  @      OQ??99//339//32910%!!573%VLii15H'" @ #RP??//10#".54>324.#"32>HplEHqlE/TsCNuO'/TrDNuO'uËMC}uMC]\.3 #"&'532>,Z[OCHRK}XBHUL]4dV' DžC" )Y?'''A |}#  O?///102#".54>"32>54.+uG={}uG<{]T(6^J]T'5]HplxAC~qlE/TsCNqH#*NnDNuO'?g'!# " /2//10"#.54>32#>54.1eL B~txE" N,Z[OCHRȄ@K}XBHUL]4%1k@ 1%( W)W@1& % . " p//]]/99//]3929//99/99105>32'#".547>54.#"3267#6͜o|B7͝n|B,TyLe(/,TyLi' NnF!8;'B*;D[+DD5D5D5F<@$<A!(PAR:0 R:P??99??9//99//39910>32#"&'#".5467!4&#"5>3232>54.#"3267.#sMNrL%(OxPNk)*6E,BhG&\^9k)-s=[r$4 #7&$8&I"/EBNU[:}‡zÉJTZ)A->xo%/ WQgZ)+\deY)3NnE 7GT. ) 3@ C CC I= .8@ %O@R??39/99/9///9910".54>7.54673>54.'332654.3~`&&E`:5Q96N22H.8S6:aF&&`#0LA74Ib@@rU2&2A.V__V.A2&?'"   P /2?//104>32#.#"?<{}sJ[uDwōNMx8aM?'"  R/2?//1032673#".5Du[Js}{<Ma8xōMNw*@  Q O??9///210+#!24.+3261hsj[xF#?X6~zTX-Dp6H+ek!8ʷ@QO??39/9/3/39/910>7.54>3!##"#;#")E*?Z:,[]|q1*'虥nn0GS 4FS-=dF' 0%Ӧ8Ak!9ʲ @  Q OO???9/9/2/29103;3!".54>7.';#"kƨ'*1q][,:Z?*E)bnn%0 'Fd=-SF4 TG]QA8w@ OQ??2/10!#!5!xVV  R O?3?//10#".5332>538mfpb-7]FA\:{Sj=;eM;bG()Ic9W4Y2/z    0  /]//3/9910#!5!54.'!5 4E*p/P=f-QPQ- =CM04Y2*>N@  5!+z: 00  &&  0  /]9//9///329910#!5!54.'!54>32#".4>32#". 4E*K/P=))))))))-QPQ- =CM0))))))))M-F% W"*W %  -//9//33/9107!2>54.'!5!2>54.'!5!#)M/<#6YA7D&4ZF9P1jo4Q7W"'/  '0!14;$QT.5@*B"@ QO?2?3/332210373#B57vh%BL  @  O QQO??3?3/9/3?=/3333933910#'#3737Bӑ!͑T+}-NflbVC *@ OQ?2?2/3/10)5!5!!7N}ݒ/&9&& @ &&RO?2?9/2/39/9910%!5!#".'532>54.+,_i,3t$Z_]',cc[$UqCIvWi6Tk:BwY4   1A%$?/3L .8%@3)")PR??99//9999/9/103267#".54675>54.#"5>32bD_;w~WXRgFqF^o:7YA6RN<}\#4]~J&()?8?fJe'o(&&   &D^78M8*Z 1-@#+#).QPQ???9/910%#"'532>?.54>32327#"&'4=P$%!-&$f/I3LggL3J.f$&-!&#P!Jt[0B'ig: @O  OOQ???9/?/2210!#.533653Ƶfqפ3bZ)pgl2 PN}[7  + O  QQ???/10!#!&'7>7! /BTal9(F<1( Vq3=s E@  >? z???39//393910#'!#3 <<{}ί!gh  >&>@!%?   z???399///]/9/99]2]910!5##!#3#3%FVͬ!kkMj&H !???@   z!??9/9/9/2910#!! 4.+32>4+32>jAJ"=/'A2qm'@.~s1I1t|!A].?8$ /z 0~*U%? ?%??@%$$z??9/9/9/9103! #!#4+32>4.+32>~AJ"=/~@~s1I1'A2qm'@.LA].?(t|fzz 0$ / &? ?z??/10+!24.+326(ayŕ"DhEZMgVo?!UoA80 6 ?@  z ??9//2910!!!!!!0]l!pp6. 4 ?@  z??9//3910!5!5!5!5!!6l]?ppS!4= ?@  y ??9//910.#"32675#5!#".54>32P0b;w837qJZe6  z z???9?/2232310##33~1w!t[V?z??/10!3!Vo!P L@    z z???3?39/3=/332299//333310# # #33m)RM!f` 4 ;A ; zz ?2??3?/3210#'#353`WzbzN!5^ 2<; zz??3??3/32103##]zzII!%&?? y!??/10#".54>324.#"32>9bIWU)9aHWV*2O86N3an6N3dlf28i_kf28ifFpL),Nl@+Nlr7IZ?@ 48=/ >8*?!@>%z@ =//Ez??9/99?/99//9910#".54>7.54673>54&'4.'32>6.?%(H6 HwZZwH5G(%>- &6!!4$ >0A&QU-@''?.-)?504?J-+SB('AS-+H<329B)- #3+%%+3#)"2.,,Y8)4 4(j.=?@  z??9//210+#!24&+326j!JxX{?rW4j^g\fm1`M/!:]HMCJ("C??  ?@   z ???9/9/910#'.+#!24&+326}#)6ImH#NX NTMlkQQ' !7N/Ut'J@2Gs ?z??/10###5!s~Pqe)A > > z z???/10#".5332653e+QsGNrI$&@1[NBlK))Hd</G0d\E  ?? z z??39/3?3?/32910#'#37379mg: *jPz&![Z!sx4>;!e+"//и/"и/и/A&6FVfv ]A] //i+и/ 01'#".54>3273267.#"\8U9%MyS"@%dK!2!+_5B$`coz,PpCBvY4 +4P9GG v>;!e+"//"и/и/9A]A)9IYiy ] //i+и/ 01632#"&'4.#"326z\8U9%MyS"@%d!2!+_5B$`c0oz,PpCBvY4 m4P9GG vF="7 == A   |???99/3104>32#'#".732>7.#"-StHUx]8S99:-+,F!#?/LyU. t,QpLp_$6$ 3QA)8CѸe+?i+2i+*i+29и/"?9A**]A*)*9*I*Y*i*y*** ]>иE9i+/i+>i+ и/и/(и96и6/01632#"&/#".5465!4&#"5>324.#">2>5#EV[)=*7^5"2!L13J/-@G'L)-.6 $F&*OIM& #k,RpE@xZ9# ('Gf<" ci U 2U8IG y~1C%$D1)e0 6 == | w???99/10#"&'3>324&#"32>e,SuI:;0dAoy>G*\' 1'F6  MyT,>r>2ai/9 1VF0#@ == A   w|????9/104>323#'#".732>7.#"-StH?9x]8S98@++,C! =2NzT,t,QpLp_$5$ 1R_>#J >#>#@/ |??9/]q/2/10!32>7#"&54>326&#"_:_a?=7.|>*OpFClK(NVIQ"(QW o AsW3(Ii2RSZKX>%E>%> "%@  |??9/]//310467!.#"5>32#".73267_a>=7.|>S{Q'*OpFDkK(NVIQ(QW o +RuKAsW3(Ii2RSZK*_@:F#>@  *0? *))5|5??9/9/]2910#".54>7.54>32.#";#"32>7_<<:YR',;#F? EmL96% #>28H*0Q?2;?2E)!3% M4#;* n  g !  *_@:N*>@ #*##*: ?00:*))55|??9/9/3/9///910>32#"&'532>54.+532>54.#"*<<:YR',;#F? EmL9675#".54>327#".'0(Y3?#Y]6--PG>Rv6P5"JpO?"]J_NJhC3S8HG v  RFuu,PqCCvZ4 ~k]%*)9T5 4 = | ??/103!#5!#"&54>32 *7###:lmm6&""!@0 7  =  |w????9/32210##33烃Jb|@)Y; ; );_ )A %|| | ???99???/]104#"#4&#"#3>32>32+ { {j "&4@")=Q>"6(  8+gu#1@E 2"YY@:@%:=%% =  | | ???3?/23/3/104&#"#3>32#"&'532>5%7'+1x444dg`k&   CHF 1%|gc * oq8^lu 7+b@*= = |??/]10#"&54>324&#"32>b)OsK)NtKVS/A'VR0A'HwV/HvU/hh":K)ih":K'+>"> |??/3/10>32#"&'532>54.#"'-h1-UxK3c)(_-(I7 5L0,]&IwT.z3O58M0q;@ @ /2/3/3104>32#4&#")OuLHwV/`S4D)HtR,*QtK`X0D)q@  @/2/3/31032653#".5)D4S`/VwHLuO))D0X`KtQ*,RtH)e@#>=  = !A | | !????99/10#"&'#3>324&#"326e0UtD< x0mA7T8>G%(-0 _d R{Q(bg?3*PqMai,% f 6 =@  |??32/3/9/3210#"&5#5357!!3267 &Q*{"ޒH) im-mm :53= = | |????9/10#'#".5332673:y-Z;2Q: p*V#c958T8F9l8 0@ o0 //]]]/39910#!5!2>54.'!5ac * oqnu$5$ 1%|x445dg#'+1|@)T; ;;P((% | ||????99??/]331032>7332>73#'#"&5#"&5d+ { {j"&4@")=Q@8>"6(w7  8+wu#1@E 2"YYz5  ||???3/10373#딖 !5icem@11@#*#'. ??9/910#"&'5326?.54>323267#"&'3J#O6)  3;0#4XBBY4"0;4  '9Q#^O&m :8>@!D7##7D!@>8: m&b86U+=0+0+0 =' =@ 3+,,v "?9??9/9/299//10#"&'#4>3232>54&+532654&#"b*Kh=3V #DfC;_B$!-'B.=#L28+R`2%IAB'3#54&'.'.'.#"5>32, +:" %7"- !C<$&+Jvs>SO'P((Y2 ')HH>j--iKXkZ##_8':A >5>5-=#(0 v??9//9/10.54632.#"#".54>32>54.')&nw&S-0U%/('"N&?-FvYJoI%!;P>1 ZR*;% +!*#;'6!7S;aa1C&4360!N; ; ; A |w | !??32???/]/9/3210#5.533>54.'3hz>fH(}KLzQR} 'IkE"@_Bj^[ }"?=>"BCM}]9 @/D@+/./ /+.A |$| ????9/99103267#"./#'.#"5>32?3  1#4(?#&n  1#4'3!'|xZ0"UKZ1"sMM[,)G 2 =  ^?/10#5!3!53"&54>32E!*7###$lmmV6&""!J)s(=@  ^?99/103>32#6&#"#J{:n92M3(4+.3qB:%Eb=QI!6%:l7]]5zl7]]5 bp8@ ]]55 jp 7   ]]5).e#-=  =@ ! _?9/10%#"&'#4>324.#"326e,Mg;*X#HnKKjC $9*IRL#NXhR{R)H=jP..SpF*J6]dh g"7]]5w#7...]]5F?1<S(8/7!88>@/$-R2PO!77O R??9/??9?9/99//22910".5332>73>32!3267#"'"!6.9N_4%!!2$&T0JjD D]l9p*mP.&E!-#&H- H-H-+++5m&G-!1#&H1 H1H1+++5&I.@ _/@ HP  H+]]+qqq5\/AQxK+, :Q"#A@#!> 5>Q'/NN+Q"QQ5PG PO??????9/999999///10673>32>327##"&'#.#"#4.#"3:7%4.#">32;?+-4!EO&,3#"V7A&F +P'  "((O, E+!#A9"9I+ip5Q7ݡV;#]s }&W.=#6YBn7D&_u< \%5[. !5@.)5"%// QQ) PO????9/999999//10>73>32>7#.'.'#4&#")T/(JJO,(V&S0Eu31Y,+DW =?D(Bx00X1'93E*v V):tp & vq0O:9!&S+2/)))H)H) H) H)++++]q5&U%HH H+++]5&>%HH H+++]5$%CT3""A>=+@ ":8>88.'P R??9/99/9910#"&'53265.'.'#467&54>32.#"32653NzFfRXW~w5h[8b', XQ '^x$ ''8.@-$>>3V-O??9/99//9/910!!#".54>7.54>7!32>54./b"POJ8"!7)^T':yzn22KV$QD9Zo6BkNSqE)I:!F:%39>@A)! :AQgEJj@5]~I>mXD#fE3kfZ!t6W=!*DV,0-+G4?L T\8~041(.@ +("#)(78 (74@ 7-86S1.O(*O$!"QQ QP????99??9?9//29291032#4.#"#327#"'#.5#5373#3\7J,!B'660ji%HkF )D1 t $dC,-& @  p  @ H +]]q5&h @p@ H+]]q5f&S R#@(P((p(@((((]]]]qqq5W!>  @ RO?3?9/3322/32/321033!33##".=#26=!ஆ:l`_k:$p I]]K_`11`_K~y>>y~W'> &@'!R O?3?9/3322/322210354'3!.'33##"&=#32>7! Js^=]o/VF1 -I˿&jjjjjv@K>x%LtP^&E }m^_&G }h^&I }\#Fe+5i+?i+ ?9 /?A&6FVfv ]A]-и-/.59IEX:/:>YEX>/>>YEX/>YEX / >YEX/>YEXC/C>YEX/>YEX-/->YEX0/0>YEX?/?>Yи/ >9 A ' 7 G W g w ]A ]и:"A""]A"("8"H"X"h"x""" ] *и*/.>901%!#"'532>=#3267.#"3>75#".54>327#".' z4[I*3+ 3M4BQ(e9\8';Nte XW+9w3d8 zzn+EoL) &8%uT]2vt8$ sHol“V'⭛<'EE^v&N ^&O Z^A] /y@@-8% @ BC;4V*P% "POQ Q-Q?????99??9/9/10!4.#"#4.#"#3>32>323#"&'532>=l"'/  '0!14;$QT.5@*:hS'K*8"2!.=#6YA{7D&4ZF{9P1ip4Q7Ma8 7\F%^Y&Q b^&S }^&U ,^&V {\f&C oB^&Y 1F^&[ ^&] m^*&D ~m^"& ~m^& u^&H }^& ^& v^& ^&L ~^& {}(0 "@ %T WR???//9/10#3267#".=32654632&#"!*9E&9^B$aOXX+[$`QWYfk(2 ?qZpaǷ q_^"&X ~}6I@ 66%0 ̲0@%66 &+RO?2?2/9//9/9910%!5!#"&'3267#".532>54.+,_i,3t(d4!*9E&9^B$,cc[$UqCIvWi6Tk:BwY4u(2 ?qZ  1A%$?/ X="3 ==  | |???9/10#"&'36324&#"32>X-StHUx]7T99:-+,F!#?/ LyU. Qt,QpLp_$6$ 3Q'+>"> |??/3/10#"&54>32.#"3267+-h1-UxK3c)(_-)H7 5L0,]&IwT.z3O58M0qK>/8T0 /#.3+?6@ o& |0 ??9/]/9/3210>32#<>7.54>32.#"2654&#" "1@&5C8T9gtw4ZyE_J(R-)G5 *@F 8;$?/==;0 MxR+z3O5%?1$#4X05Z@,"==@,1~ 'w???99//923/9/910.#"32654&'.''7'37#".54>32&bX*9"PIErA-}Z_BtZDiH%%IkFZ^6L0gd5Q  %`R9&`}[1p_?+PpDCmM**_s88= =@  v ??9/32/10&#"!!##5354>32sT< (Ih@@MNmUm\=\>s5< ==@    |??9/32//1032=!5!33##"'T< (Ih@ALJNmUm\=\>R^4<5. = =  ||????/10332>73#57#"&54,2%%)3^6]d5HF 1$`c3˙"5''5!?jhjjs"'55'"!D5& = |??//9/10#".5#5!3267D: /S=#T773/L6=m|B<9- , <  z??/10#5!#3!53 mmnn9-L  <<@  z??9/3/2/221035#5!#3#3!53#W mmhnnJ 0@W).@  !!<6=@19.&.| . ?99?9/9/9/9910#.'#".54632>5!5!.#"3262#"&54>;? z#&)L;$QH,A/! & "5''5!Kp**?*DG-7>*}(("'55'"7-0(=w ??//9/103267#"&5#5r#94  ii0;<rmj3W)05 ==w ??/91053#5!3#"&'5326=E`k&  '(mk ^lu-9)_;5>|??/10!3!;$Tg |@9T; ; 2);5.@ % | ???99?/9/22104#"#4&#"#3>32>32#"&'532>+ { {j "&4@")=Q.J6.! >"6(  8+gu#1@E 2"YY/Q<"u2|6)I;) ; ;  )|%????99/1032>7332>73##"&5#"&5d+ { {o"&4@")=Q68>"6(w7  8+wr#1@E 2"YY=@#6==| ??9?/10#"&'532>53>32#4&#"`k&   y-X6`q+6$%)^lu"8+cc:4oqnuHF -#4@#5== | ???9/103267#"&54&#"#3>32=   &ka+6$%)y-X6`q*7! ul^HF -#rgc:4oqO5 4;A ; ||?2??3?/2310##33Oz%z&g*a@%6"= #=@ "|??9//2210#".54>322>7!"!.a-QqEBmN+,QrEBmN++<'TL):(M SHwV/)PuMHvU/)Ou/= QX,9IT0 +I==&! 0@ + |! ?32?3/2/332210#5.54>7533>54.'kr-Le8r-Le9r*9! !9+r*9# "9, MrN, NsN,$7I+0K6!$7H+0K7!3 @DE3< * ;;<*@%6/{ ?2??99/10#"&'3267#".=32>54.'.54>32.#" 'E]77'* -6K/6}6&2 !7')M;$=^A6^03Y"(6! #>27K.v0D+41)p6L/ +>.&@. n &/9M8&=v ??//9/10#"&'532654>32.#"u#@Z79<066#AZ787668U:qE;8V:rE;'=%1@     |?2??/10"&5#5357!!3267#".'532>=^uqF&\Q -  imAYYǃ PDi I5#L!; ;@   |???9/3322/322210353!533##'#".=#2675!b``o468 #A2b=+W')whc * 3M3;0rOGGk5+P@ " "" '< <" |  |?2??2/99}/|/99102>54.'53##".5467#53./C* ) B3+NpEFoM)4B ) '?/5D%/B4,`h0|a/G0d\BV>%4 A = = "| |???/9/10#".53326=4.#"5>32V'KoHLlE #;/WI#!-diBlK)'Hd>a/G0c\b"5"]kj5|?3??/103# g-:5 '@ |?2?2/3310!5!5!!:[iamgn-58<@ | ??2?2/3210327#".=!5!5!:# "%'B.s[<3%i,E38amgn-{5(Q(1 /@!#(|?2?2?9//329/3210!5!5!3>32+#67254#"3[x 0B-4*(7 a|+2amgn83# 2%#5#),"& O C5!D@ >@ | `??9/22/9/9910#"'532>54.+57!5!C5]JSF&F,32.#"32>7_+PpEBmN++PpEBmN+*:&*:'*='->'`xD6lnaxD7m.Mf<&Ea2#".54>-!!-+!!+_I2,  ,-  -s",,!!,,"L^",,!!,,"s+,?@#O'_'o'@P`'",O /?99//33/9/9]]102#".54>'2#".54>T+  +-  - I_-,!!,,!!, s",,!!,,"tL^",,!!,,"G5$@%% / * 7/32/29/10>32".54>54.54>54&#"/,, 4)! I%        @ @ O?/2210#"&5332>7&Ηv{-'3N<+w{*:R5@ @/]/10!5!7mm@ @/]/10!%3!mm@ @/]/10#'!5!@ m@ @/]/10!#7!@ m#B @ /]/10#'#%373Bܒ$B @ /]/10#'#737BK+ Q?]5'@O?9=/33/33/310%5%AC4kdd@ @@!  ?    02]292/22]29107'5%73#3⪪dj4kddk4 D\&$mD&D&%F&EFv&%v&E&%o%'@,o,0,,,, ,P,O,,,]]]qqq5&Eo%'@)o)0)))) )P)O)))]]]qqq5{&&t&'&Gmv&'mv&G&'o%'@o0 PO]]]qqq5&Go%'@$o$0$$$$ $P$O$$$]]]qqq5m1&' )@&&&&P&P&&&& &&&]]]qqr5m1&G 21@ -5H1111P1P1111 111]]]qqr+5&'%C@pO/HHP@ H ]]+]++qqqqq5&G%C@((p(O(/((H(HP((@ H (((]]+]++qqqqq5&( l&H &( l&H &(%C@  p O /  H HP  @ H   ]]+]++qqqqq5(&H(%C@**p*O*/**H*HP**@ H ***]]+]++qqqqq5&(%6@p/HP@ H ]]+]+]qqq5%&H%%6@-p-/---HP--@ H ---]]+]+]qqq5&(&x&H&x&)&Iv@ O]]52P&*2\N&Jo&+M&KMov&+v&K{&+&KP@ /]]]554&+xa&Kx&+/E@#p0/@ H ]]+]]]]]]qqqqq5&K/E@###p#0#/########@ H ###]]+]]]]]]qqqqq5&,%6@p/HP@ H ]]+]+]qqq5&L%6@!p!/!!!HP!!@ H !!!]]+]+]qqq5&, O& {&.'{&Nv&.v'&N&.o%'@o0 PO]]]qqq5'&No%'@o0 PO]]]qqq5v&/<v&O(vP&/&<(v&O'ov   HO  ]+]]52&/o2%'@o0 PO]]]qqq5&Oo%'@ o 0   P O   ]]]qqq52&/2%C@  p O /  H HP  @ H   ]]+]++qqqqq5&O%C@  p O /  H HP  @ H   ]]+]++qqqqq55{&0 &Pt5&0 &P1v5&0Zv &P&1&Qwv&1v&Q&1o%'@o0 PO]]]qqq5&Qo%'@o0 PO]]]qqq5&1%C@pO/HHP@ H ]]+]++qqqqq5&Q%C@pO/HHP@ H ]]+]++qqqqq5/z&2  u&R /&2  &R /&2  l&R /&2  l&R {&3f&St&3f&S&5&Uv&5v&UvP&5&vN&U&o&5o%'@(o(0(((( (P(O(((]]]qqq5&Uo%'@o0 PO]]]qqq5&6&Vov-&6v&Vf&6 &V &6 &V v&6&v&V&&7&W """]5Vv&7?v-&W&7o%'@o0 PO]]]qqq5-&Wo%'@o0 PO]]]qqq5&7%C@  p O /  H HP  @ H   ]]+]++qqqqq5-&W%C@pO/HHP@ H ]]+]++qqqqq5m&8&X&8%6@p/HP@ H ]]+]+]qqq5&X%6@p/HP@ H ]]+]+]qqq5&8%C@pO/HHP@ H ]]+]++qqqqq5&X%C@pO/HHP@ H ]]+]++qqqqq5z&8 u&X &8 &X b&9&Yvb&9Bv&Y9{&:B&ZC9{&:B&Zt9{&:B}&Zi9&:B&Z-v9&:%vB&ZN&;)&[N{&;)}&[if&<`&\{&=&]ov&=v&]&=o%'@ o 0   P O   ]]]qqq5&]o%'@ o 0   P O   ]]]qqq5&Ko%'@o0 PO]]]qqq5t&Wi"@ H"+55B&Z`&\$&D$P&?P@ `0]]]5-!@ BC D???10#"'532654&'.#"#463 aClDim{xPwp1dٟysa leU8CO}lN v\&$mv&D \O&$ m*&D j&$ mj&D \&$ &D  \&$ m&D  \&$ !m&D v\{&$&v&D& \q&$ #mt&D " \p&$ %mt&D $ \&$ 'm&D & \&$ )m&D (v\&$&v&D&v&(uv&HO&( u*&H&(&Hj&( uj&H &( &H &( u&H &( !u&H v{&(&v&H&O&, *& v&,v&L9v/-&2\v &R9/O&2 \ *&R9j&2 \j&R /&2  &R 9/&2 \ &R 9/&2 !\ &R v/{&2&v &R&{&`&at{&`&aC9O&` H*&a&`&a9v&`Hv&amv&8v&XmO&8 *&X{&oڿ&pt{&o&pClO&o m*&pȱ&oݻ&plv&omv&pf{&<`&\Cvf&<;`&\.f3&< ;`*&\ f&<`&\?&`5?&`m?&`B?&`O?&`C?&`P?&`D?&`Ql\+&$5lB?5`\+&$m`B?5\+&$B B?55\+&$O B?55\+&$C B?55\+&$P B?55d\^&$Dd{ B?55_\^&$Q_{ B?55&d4&dm&dB&dO'&dC'&dP+&(4B?5+&(mB?57+&(B7 B?556+&(O6 B?55?+&(C? B?557+&(P7 B?55f&f4f&fmf&fBf&fOf&fCf&fPf&fDf&fQx+&+4xB?5y+&+myB?5+&+B B?55+&+O B?55+&+C B?55+&+P B?55w^&+Dw{ B?55w^&+Qw{ B?55&h4&hm&hB&hO&hC&hP&hD&hQ+&,4B?5+&,mB?56+&,B6 B?556+&,O6 B?55,+&,C, B?55,+&,P, B?55b&,D B?55b&,Q B?55 &R4 &Rm &RB &RO &RC &RP/-&24.B?5/-&2m8B?5/-&2B .B?55/-&2O 8B?55O/-&2CO{ .B?55O/-&2PO{ 8B?55&t4&tm&tB&tO&tC&tP&tD&tQ6f+&<m6B?5f+&<O B?55f+&<P B?55,fb&<Q, B?55?&x4?&xm?&xB?&xO?&xC?&xP?&xD?&xQ;-&X42B?5;-&Xm'5-2<<1SI7 1$0333KB0 $)@ @  O?9/910.54632'>'5-2<<1SI7 1$0333KB0 $)]%@  @ HO?+22/10>323267#".#"+mE:P>7"(=V-kE;O>7"*;HI"("7+VHI"("7+{'?@G@%#44((?743<@+077 77 @O?22]//]99//102#".54>!2#".54>%>323267#".#"|''''&&&&+mE:P>7"(=V-kE;O>7"*;;'&&''&&'HI"("7+VHI"("7+Xf&f&a1f&f1f&f&l1f]&f6f]&f&61&(aA?5&(lA?5r&+arA?5O&+lOA?5oz&+1?S)@@ O?/99910.54632'>%#u5-07 - ):$7 tl~1$03!-%@<%#u5-07 - ):$7 ~lo1$03!-%@<>323267#".#"(5-07 - ):$7 +mE:P>7"(=V-kE;O>7"*;1$03!-%@<32%# 7$:) - 70-&l~)$ 0!<<@%-!30$1+RS-@ O?9/99910.54>32%# 7$:) - 70-~lo)$ 0!<<@%-!30$1+R-.E@ "*@! -%@ H%P.O?]9+]//9/910.54>32>323267#".#"? 7$:) - 70-U+mE:P>7"(=V-kE;O>7"*;)$ 0!<<@%-!30$1^HI"("7+VHI"("7+&tN&to&t_&t`f&p5f&pm]&t6{&t7f&<fP&<af&<aaA?5f&<lA?5+&3m(B?5'+,5@#)+@)+++**` ,O?2]23/]/}102#".54>!2#".54>%#''''u&&&&ڊ~;'&&''&&'_*S'+,5@(**#@+++**` ,O?2]23/]/9/102#".54>!2#".54>'#''''u&&&&X~;'&&''&&'^+R@O?/10#6 Rz?&x&a1A'z?&x1Az?&x&l1A?]&x6z?]&x&61A/-&2a(A?5/-&2l(A?5v;-&Xav,A?5;-&Xl,A?5+z;-&X1K@O?/10#ݲ R@ @ O?9/910.54>32> 7$:) - 70-)$ 0!<<@%-!30$1h$6///10#$Hn%h6@     //32933/2223910#'7'77'$H1111hC1111h # 6 //9/9/310'7!#!'71HR111Qh$ #6   //9/9/310#!'7!$H11Rht11m///10!5!\՘m//10!5!\՘jm//10!5!jn՘jm>f)f'__]fk! XX/2210!5!5!5!fffoy T?/10&#".54>3y3`I,$!3#$@154.54>32#3`I,$!3##A1=yx+@**4,2)-&;Z=SvFB +Q?//10>54.54>32#3`I,$!3##A1=yx+@)*4,2*.&327yxy=1A##3!$,I`3FvS=Z;&-)2,4**@+h#-3,$.@ )3TT??/10&#".54>3&#".54>3!,SA( 0!!<.9ol ,SA' 0!!<.8ol(<''0*/'+#8T9NnB(<''0*/'+#8T9NnB9#3,$.@ .3)TT??/10>54.54>32#%>54.54>32#F+T@( 0!!<.9ol,SA( 0!!<.9ol(=''/*0'*#7U9NnB(=''/*0'*#7U9NnB9)3.3$.@ .34)4/10>54.54>32#%>54.54>32#F+T@( 0!!<.9ol,SA( 0!!<.9ol)<''0*/'+#8T9NoB)<''0*/'+#8T9NoB9#3%@3).3$ T?33/10".54>327".54>327lo9.3?oS00So??oS00Sof0So??oS00So??oS0;+';:(2 <7%-R#%R%R???10%#".54>32#".54>32#".54>32),,,,,,,,,,,,f,! ,,! -,! ,,! -,! ,,! -f#5AUaAB?V\?L$?6<?.??@YQ?)))0))@H@H 93T_!G R?32?99//++|]]q}22///10 5 #".54>324&#"326#".54>324&#"326#".54>324&#"326ff#A[76W>"#AZ76X>"52245134Z#A[76W>"#AZ7l52245134#A[76W?!#@[76X>"52245134}?iL*"EhG?iM*"EiKTM\ESM[?iM*"EiG?iL*SM[ETM\?iL*"EhG?iM*"EiKTM\ESM[ c#5AUaue+bvi+|li+BVi+\Li+i+i+Avv]Av)v9vIvYvivyvvv ]vb9A&6FVfv ]A]A&6FVfv ]A]$9$/<9YEXG/G>YEXg/g>Y39i+i+?)i+9 !A!'!7!G!W!g!w!!! ]A!!]QиYи!_иqиyи_01 5 #".54>324&#"326#".54>324&#"326#".54>324&#"326%#".54>324&#"326  $#A[76W>"#AZ76X>"52245134Z#A[76W>"#AZ7l52245134#A[76W?!#@[76X>"52245134#A[76W?!#@[76X>"52245134P?iL*"EhG?iM*"EiKTM\ESM[?iM*"EiG?iL*SM[ETM\?iL*"EhG?iM*"EiKTM\ESM[I?iL*"EhG?iM*"EiKTM\ESM[SzT   ///10'''{iii)yD)yD)yD b !NN۲//10   %g~bYbF!NN۲//10% 7 Y%ۆg]]bAB/CA !+ ߲&&R&RS?2?2?/10#2#".54>#2#".54>j0##00$$0[j0##00$$0q$10##01$q$10##01$C3W@ '()*1322.$.2)-@ ..''.S)& R??9/99//910%2#".54>>54.'#&+532'30##00$$0| 7S7Fe"BydB 6EC2$10##01$*2K-Lu@;Xbi2 h d.^/10!!^VNR@ SQQS????//3310 #Rf{';O%@A-K7#F<2(  //9/102#".54>2#".54>2#".54>2#".54>+"=--="#<--<#"=--="#<--<#"=--="#<--<#"=--="#<--<.=#"<--<"#=..=#"<--<"#=..=#"<--<"#=..=#"<--<"#=.gN@I#Ee+i+и/ i+ i+!i+012#".54>;#"&5#52""""a  ?D!""! bE<bwN%gbNgwNw`NgjNwsNgNLNNXwyNwNwU(6  @ c?3/322/39/2/103>32#4&#"#657gk13#&,Z) {}GKE ) EH'"@ a#_??/10%#".54>324.#"32>5_TJ^54`TJ]62A$&A12A$&B0di6-akdi6-arQh<AeHQh<Ae)o@ 0 @` ^?2?9/9/310!53'%33o:8בlz)sH9 @ a^?2?9/99//31057>54&#"'>32!:I*CB3\%V6T?mO.9T7r׏-@3-.<% j6;>[54.#"5>32^2a`:4,"o<[l/N:RL1B( 7(6n-;?AB;&=,8^C%94''  kXGY +:)7 @@    d@   `^??39/93222/32310##5!5333dXF\%b75a@ ` _??9//9/10%#"&'532654.+!!32b9gU%a41a0gb1N8FEyY4!AbC"  =6' 1Zw7)7$@`'_??9/9/9/210%#"&54>;#">324&#"326w1WxH,iuE];[/FL+(" JMDL>bC#eu@+?' |{0> l[A)`7 @`^^???2/9/3210 #!5!`V``wujH!.@L'c"c@  f/9g@94,"$a<_??9/99//9910#"&54>7.54>324#">4.'32>j0TtC-9 4)&KqKP?":*BG*9"6@ /= /"NE7'8T8jd'>1'".<'-M9 f]B\ &1@^J%%# ='  '-+ ")sH!37/%@*"a^??9/9/29/10%+532>?#".54>32%"32>74.sOY}G_<(-/9kS21WwGGwV0EJ'6 +*% ";Ꭽ^*>)7^H=aD$!RpA1)  )G4J # @   /32/10%!#!5!3!Ȭ78ff//10%!5!f@ //10!5!!5! X)y7!  n o??/10.54>7%ss:0nPaY),[^)._W7)oOVm&)7!  o n??/10'>54.'Bss90nOaX),[]7.^W7)oOVm& >] _?55 _ ] _?55 b] _?55*z *@    ^^??9//910#'#373z۝65_%0>%>@ "_?9///310%467!.#"5>32#".73267_a>=7.|>S{Q'*OpFDkK(NVIQ;(QW o +RuKAsW3(Ii2RSZK1.)#M "@!" B"C??99///3/9910)"&54>32.#"3!!!!!.Bs[>x11t=~EqR#hwkyBS{Q'j؏RB&07@, *5+4&45  .- ##-."!"""1Ƿ4+&&-#"#@ #D. 5 ' B?9?9933//99//933339333310#&54>?33273.'>7#7.'".|.w~Azk!|*E!|&N3FN|&F  >L6G0/sMЊq  *%9 |6# x@J3\+7D o@ **7'Ƿ2++ " B* D??9///99//310.#">7#".54>32.#"3>32LBԖRR؆[HH[\h8 (4!4B&, R' AS` ')Ey&ZN! =\<\J@   @  A C??9/3222/33222/33/3/310!!!!!##535#53!MM刲Zj-)@"%%")+(( $@8))$'"    / 'C B?32?9/]q32_]]222/33223/339////10#535#5354>32.#"!!!!!!53 ;maj"LL7w~Fel9K7o# "Ba@Tꔔ+T=(&P f#&)@ )#$xxx "x x 'x@1$ #) C'C A&A?3??3?99//]//91035#533!33#3##!##%3'#35#%3'5#1MyVVU.MMZZD;T]Z2k+UB73LD@3+U&<<&U+^_G8QD8?211/-")D[[Y AC??9/?/32/2/?2999////////32210+#3232>54&'.'#3267#"=#53573>32.#"#"&'4&+326(T[_Hc;o) (7" ~,@+: -!.!! 4E%6]UYP[`>u]8[ Gs5 /<+ |r+!;+ x !&" &-6!6H,UQVFE$T~E6%N@ ./=?=O==x u@ 6N*IBP3*R  ACC???9/9??99/]99]/10!#.##324.#32>#"&'532654.54>32.#"Q)',azV$<.1L #?2 0:! *G_66[0+()4F,CMC,!DiH$C/2D!#. ,CNC,3@$ 6aO5bSAZV4O4P9S{DdB   =?/G>>NhH325!3267.#"!5!!HcVT*D~oaWdaBR+g3bjfHpljG{vtL3-3w@ 3*3*"51+(.@! 4 1@H1(?+O+++ !"%B D??9/]32+222222222299//103267#"&'#53&45467#53>32.#"!!! J?EN&ZbPA?P|&Z'# !܈&1iu? &)+,O  @   CA?3?39/3322/3/33//9933103333!!####1<x,  eeV:@  @  AC??2/332299//3310#5%55%!5!!%%}}  zjIyyyyUzzzS#Ynz@ !5CjM?a7@xZ)-0Tx!jxxj!|r6@(FxauMoKuAC?cccc:CTZ0,) @ HD?+///32?]q9?999/9////299999910"&'#>32"32654&>3>7#".'#".54>32>7"%32>54."3267.'cR +3 6(/I( -:GF@H5;+-4K0,RtG!"$5Y/*#+=(!5631%+%'?0" /w % $ =R15aOhwAU#/ ?C`>W&X"0 JoL<1",'9)  +̼/8aSJvR,H--Ag@=8$$. @==3)HCE??2?99399/9/993310#'2>54&' #.54>324.#">d 2$8iR29xMwQ*eSҙ~6fO0,Nk?KjE #/-$.>#!)_ygSR`o=j+OpF{IMqM5MqK%)HcT/@(#:,2``e7KpYGf"+17@ 5/# 41(@4 '40 (! 0@ @ H  131`1p111AC??9/]q99//+]/332222/2910#+##535#535!23#3%4&'!!>267!#!.fHl^fKlQG[v!r l3YA&+~v~6V<~  #=v-.[M&'B )4@/ 2$% %$   /!$ 2 @ 0D B% B???9/9/9/99//9333310#.54>?3.'!#*'2>7#2F'_i7P~jBD??99//]3232/910!!!3267#".5<7#53>7!5!>54.#"5>324*``VyEsVxK"Zgm4||?\&vD;IBjL$QTS'!SWS!k,6-**1F-   (U]  :U##V<+?*   8]|C0Q"\ !)X@ %$!$%  "$D % B??/29/329333310#&4>?3.'23267#*'Z'M~6d04l.-9@"    A C??9////9910573%%327673#!575.дnn[gf |XӛhixXX ]N'@  R#/?//104>32#".732>54.#" WssʖWWssʖWTJaaJJaaJ$sʖWWssʖWWsaJJaaJJqt%)G:@G:?1'()& D,<6B'C&A#D????//3/3/10#".54>324.#"326# #".54>32&#"3267U+Je9Dd@*Jd9DdA ~!7*(7""7)P@nTaJoL&&KoH2_'^NRf3D')V*PtL%)NpGOuK%)NpL4N34K05M4kd)NoFFsQ,q)dk8L0='3@(&' @+'+''R.T??9/99/9/1074>3232>7#".=>54&#"=-RuG@r["324&#"326Xׅ)s5L1]e4K0^f'#"%%"#'wwp=jO->iM+RT\LQZ\ Z+'6?^7[(.;91(1(1#YAY@@;2.=7=2=00=2 DB??9///999//102#".54>"32>54.+#324&+3265̍KO|̍KO{Zj:9i\[j:9i#JrN-8gO/F?=5EH+gbgcMzrőRMzrőS\*SB(1PA636  \RB  A 5@  AA A???29332/9910#'#'#373###5!\% RO+uLPV VL-F9VL'iXi+;-XL-@    R?99///9/10&#"!3273!"5432!sohyyu;'ٔċ ,@ CA??9//3/3/3107!!5!3!+Fqm <^@06'0      6 3,D C A  B?39/???99/339/3/3/10#'##3' ##".'532654.54>32.#"%u//pʔQSn0$BZ653-!Y5G>-COC-!;P/;S"J34:-EOE-58y*?)j +!+A2#:* ` #+C *@  Q O??9//3/9/10!5!!5!+% R 5x0h@##)) 3 b@#3-RTS)&*-Q?22??33/3?329/9/3/33/3/32/33/3/3/3/10 # '73#"&'532654&+532654&#"5>32RfJ7$GiF@=?506ZT/#%-6"K-di&*8:{Ztf*F4w%"q#! q LA4@ BR.O=>>1OOHa55N1)h@""  @%,>==:C1N0CT,&  RS"#&Q?22??329/9?22/3/3/32/33/3/3/3//33/2/3/310 ##"&'532654&+532654&#"5>32!57>54.#"'>323Rfu$GiF@=?506ZT/#%-6"K-di&*8:H/! 7&C.3;#,N;")A/>{-*F4w%"q#! q LA4@ Bd}#3  e 0G/558!+R (j#?@ !!  b@ ##RTS"Q???33/3?329//3/33/3/2/2/33/3/10 # '73#".'532654&+!!32RfJ7,$F/H97F7-VD){Ztn\my)""E}W'BR!B|011$BB;a((A$?@  @!1006$A#-6T  RSQ???329/?23/3/3/2/2/33/3//33/2/3/310 ##".'532654&+!!32!57>54.#"'>323Rf,$F/H97F7-VD)H/! 7&C.3;#,N;")A/>{5\my)""E}W'B_}#3  e 0G/558!+R!LGh::J"@ 11+@@+66+?@  @2@=DJ466D+.*' '@'P'`''ADT  RSQ???329/?3]229/92/3/2/2/33/3//3/3/3/33/10 ##".'532654&+!!32#"&'532654&+532654&#"5>32Rf,$F/H97F7-VD)$GiF@=?506ZT/#%-6"K-di&*8:{5\my)""E}W'B*F4w%"q#! q LA4@ BR!,/,,#+`)&//.(?@  @*#'+(.@ H..p%%%-)S  RSQ???329/?3]9/+332/3/2/2/33/3//33/3322/10 ##".'532654&+!!32##5!533'3Rf,$F/H97F7-VD)ZZ{5\my)""E}W'BmmzRR &2n-h@ ' ' b@'-*@"P"`"""0RTSQ???33/3?9/]32/3/33/3/2/2/33/210 # '73#"&54>;#">324&#"326RfJ7;X;z{#VpKAofF*.B* !)%#&{Zth(G6|Cy\7}890A' ' G4(R+IBB,;;D??55?&h@ @* >DD@584/C@S&#@P`) RSQ???9/]32?229//3/2/2/33/2/3/3/2/10 ##"&54>;#">324&#"326#".'532654&+!!32Rfo;X;z{#VpKAofF*.B* !)%#&,$F/H97F7-VD){/(G6|Cy\7}890A' ' G4(w\my)""E}W'BR (3A)S@ !9$!19191 V4<V.Rb@ 9$1@!H11+n? m lok????/?9/+99/3/3/2/3//99=//99910 # '73#"&5467.54>32'4#">4.'326RfJ7$?U1ot7-(28T7gr,-% Q'*2* &$-,*$3{ZtI*>)NK:EA;!9*LE0D $/-$ & 'R.LWeҲfRR=MS@E:=]HUE=E]UEU]=/`V7XV/)@ "" @]H:U@!HUU4OBnc4p@"?&, #&l@ 0 ko??/3qr2?39/9qr2??9/+99/3/3/3/3/3///9=////99310 # #"&'532654&+532654&#"5>32#"&5467.54>32'4#">4.'326Rf=$GiF@=?506ZT/#%-6"K-di&*8:H$?U1ot7-(28T7gr,-% Q'*2* &$-,*$3{y*F4w%"q#! q LA4@ Ba*>)NK:EA;!9*LE0D $/-$ & 'R*7U8GGNNORL%R S@0(0((03V +V@KKQQ;NNLk?B;m@ 0(@!H(( "n5 pko????9/+99?2?q9/q/3/3//9=////99/2/2/10 ##"&5467.54>32'4#">4.'326#"&'532>54&+!#32Rf$?U1ps7-(28S8gr,-03Q'*2* &$-V$3HvS- =!* 2)NK:EA;!9*LE0DE-$ & '7af{ #MU &DR*7>@ 88;;<9::<<@?%R S@0(0((03V +V@ 8<<<>k9m@ 0(@!H(( "n5 pko????9/+99??q2/3/3//9=////999/3/3|/3/10 ##"&5467.54>32'4#">4.'326#!5!Rf$?U1ps7-(28S8gr,-03Q'*2* &$-V$3^ɘ{*>)NK:EA;!9*LE0DE-$ & '77 +1Ƿ DB?32?32/3/3/1063 #"&'532>54#")R؆[HGZ\h8TGA` ')Ey'#R "@   /9=/10 7!!'=a8aioo 0@     /2339///3310' #7ooha8a DR "@    /9=/107 '%!5!)a8a iQouuo .@  /3329///3310 7'3Oouuoa8aD \.@     /2299=//107 '7#' 73`n`˹ڹ`n`˹ڹ^buubbb6@      /3322229///3310 7'7' 'Pnuunnn`L``L`@@      /2222229/////3310 7'7' '!!SkuukkkX<]j]V]j]ߖq 4@в0&5@!0 T+R??9/9929/10#".54>32.#"5>32"32>5.ag6?r_Ey-;^YN O*~іSZA_?:Y>?_@ 5rbdo;$"dNgy(If=:iO/1o"7/D))= + @  SY?3?22/10#!##5!#V=Ùu) : Ѷ  ݷS Y?2?2/9/10!5 5!! !=@-ׁLm//10!5!\՘R=79@ SQQS???9/93?//9/333310 #777B=3<{O Z`'5@56/(:4<*8#/3222/9910#".'#".54>32>324#"32%&#"32>Z!A`>-IEF*.KEG*7Z@#%C_9!?ER4-JGF)3ZB'r(/7"&=2'lIjq +=)FxX23N48O1-RrEFxX3,RB5N3$Lv[&;)4A$ !@24XXo?10)3!4jr   /////104>32#4.#"#r323267#".#"'>3232677yG7a^^40T#D6{G6b]_30U#C7yG7a^^40T#D6{G6b]_30U#2;!)!-q1=!("+332#".!53'733%32>54.#"Ytt͙YYtt͙YI#R%NhgNNghNt͙XXtt͙XXW[OuhOOhgOOfO 4HC@# !?+5!:0D 0D&/q?q2//99//23310%!57>54.#"'>32!%4>32#".732>54.#"&4,7 . -H4)fD.N7,B-~SYtt͙YYtt͙YANhgNNghNT,@5/.#' =*25K0'EDI+{t͙XXtt͙XXthOOhgOOfO*>Ra@5#&###   +I5?+&  D:D N0/q?]q9/q9//99//9///910#"&'532654&+532654&#"5>32%4>32#".732>54.#")%KqL*ABOh[bNOP@MEBDU%U&or=65+Ytt͙YYtt͙YANhgNNghN.P<#S I?9:L@993Q \P32#".732>54.#"*x_*xYtt͙YYtt͙YANhgNNghNpR2t[t͙XXtt͙XXthOOhgOOfO1EG@# <(2 7-DA#/?]9/q//99//3210#"&'532654&+!!32%4>32#".732>54.#"-Ok>KJ&Vc]Xy=2_K-Ytt͙YYtt͙YANhgNNghN4V>"UNCB;eQ-L+t͙XXtt͙XXthOOhgOOfO+?SO@+$,J6@,!!!! )))E;D O1/?]q9/q//99//2210#"&54>;#">324&#"326%4>32#".732>54.#"#@Z7ty QjFK?\=""X35O5a@G)R&8$$PmAQ7M08L4AJE\8Mt͙XXtt͙XXthOOhgOOfO.?@ % D* /q2?]//99//33/310 #!5!4>32#".732>54.#"j0Ytt͙YYtt͙YANhgNNghN,dWt͙XXtt͙XXthOOhgOOfO)9Mam@<$ *2**:XDN: ////''55SID!!!]?/q?]q9/q99//99//99//9910#"&5467.54>324&#">4.'32>%4>32#".732>54.#"!%AX4svGKE>8U9loD?6'oB=*  ""C9DM//q?]9/q//99//3310+5326?#".54>32'"32674.4>32#".732>54.#"*º:A"W35P5#@Y54X@$$"LzLHBIE\7t͙XXtt͙XXthOOhgOOfO +?SE@ *$$$,J6@,*#""E;D &(O1/3/?2/2///99//10#".54>324.#"326!53'733%4>32#".732>54.#"oIQ(9$'9'&8%X@ #kX(6VYtt͙YYtt͙YANhgNNghN4#SggS##SjRm?Tl?Q;Aht͙XXtt͙XXthOOhgOOfO )=A@ 4 * /%D9/3/?23/2//99//10%!53'733!53'733%4>32#".732>54.#"kX(6VKkX(6VYtt͙YYtt͙YANhgNNghNQ;AhQQ;Aht͙XXtt͙XXthOOhgOOfO';OM@%&    (F2<(& A7D"$K-/3/?2/2//9///23310>323!57>54&#"!53'733%4>32#".732>54.#"D;)BM nl#$#$QkX(6VYtt͙YYtt͙YANhgNNghNgPY#<;=$QL5I8/4&Q;Aht͙XXtt͙XXthOOhgOOfO'2FZw@@1+"%""" +  +3Q=G31*)%  )LBD-/V8/3/q?2/q9/q92//9///9///910#"&'532654+532654&#"5>32!53'733%4>32#".732>54.#"`-D/'$*80Z12%$#!&3:BE$((4kX(6VYtt͙YYtt͙YANhgNNghN.P<#S I?sLC990Q \P32#".732>54.#"FPϬsF}}kX(6VYtt͙YYtt͙YANhgNNghNpE-gQ;Aht͙XXtt͙XXthOOhgOOfO';O[@-&    (F2<(& A7D"$K-/3/?2/9/q2//9///2310#"&'532654&+3#2!53'733%4>32#".732>54.#"R-E.)#428;4">0kX(6VYtt͙YYtt͙YANhgNNghN4U="TOCB:eQ/LQ;Aht͙XXtt͙XXthOOhgOOfO+6J^Y@,5/$ /  /7UAK75.-!!)-PFD13Z</3/?2/9/q2//9///2210#".54>;#">324&#"326!53'733%4>32#".732>54.#"o(8"$8'8]D #7'-8AY& #kX(6VYtt͙YYtt͙YANhgNNghN6V=!Hy\Yj:Q$?S0inAGAY8LQ;Aht͙XXtt͙XXthOOhgOOfO%9C@   0& +!D 5/3/2?22//9///3310##5!!53'733%4>32#".732>54.#"HTkX(6VYtt͙YYtt͙YANhgNNghNOsQCQ;Aht͙XXtt͙XXthOOhgOOfO,8CWkq@8%  -3B<-<<-DbNXDB;: 00**6:]SD">AgI/3/?2/9/q992//9///99//9910#"&5467.54>324#">4&'326!53'733%4>32#".732>54.#"v+<"LO,.*'&8'$7%+$ _@"0%((kX(6VYtt͙YYtt͙YANhgNNghN,D/aKAc'#Q7%@0.>#=W $.8G`0.$!B)L&#K+02-pQ;Aht͙XXtt͙XXthOOhgOOfO'2FZ]@/# 1+ ++ 3Q=G31*)  )LBD-0V8/3/?2/9/q2//9///3310+53265#"&54>32'"32674.!53'733%4>32#".732>54.#"o;Z=$NN(7<<(9#$8&% % kX(6VYtt͙YYtt͙YANhgNNghNWi]+Qqv(kb6W=!#N{LHBDE\7Q;Aht͙XXtt͙XXthOOhgOOfO =Qe\@0-!1.'71771>\HR>1-00WMD :0$$$$aC/q3/?2/2//9////23310#".54>324.#"326>323!57>54&#"4>32#".732>54.#"~IQ(9$'9'&8%X@ #;)BM nl#$#$Ytt͙YYtt͙YANhgNNghN4#SggS##SjRm?Tl?PY#<;=$QL5I8/4&t͙XXtt͙XXthOOhgOOfO&:NO@*!   'E1;' @6D$$/J,/qq?]q99//99//9910#".54>324'326%%.#"4>32#".732>54.#"1!@b@9\A#!@aA9\A#_B9IV(C7IVlYtt͙YYtt͙YANhgNNghN(P^4*W]P^4*X`%!8G 6Et͙XXtt͙XXthOOhgOOfO )I@    @H %D @H/+3/?+23/2//99//10##7#!%##7#!4>32#".V6(XkKV6(XkYtt͙YYtt͙Y&lhA;QQlhA;QHt͙XXtt͙XXfO';W@$ $  $(2(%&  &@H&7D"@H-/+3/?+2/22//9///2310>32!5#7>54&#"##7#!4>32#".l$#$#ln MB);)V6(XkYtt͙YYtt͙Y*&4/8I5LQ$=;<#YPlhA;QHt͙XXtt͙XXfO'2Fw@,)/ //3=3)01 ##1@H1BD -*@H*8/+3/q?+2/q9/q92//9///992/3104&'>54&#"632+32#"'32>##7#!4>32#".`4(($EB:3&!#$%21Z08*$'/D-V6(XkYtt͙YYtt͙YCIL32#".FsPF}}V6(XkYtt͙YYtt͙Y#EOglhA;QHt͙XXtt͙XXfO';a@ $ $  $(2(%&   &@H&7D "@H-/+3/?+2/9/q2//9///23104.#535#32#"&'32>##7#!4>32#".R0>"4;824#).E-V6(XkYtt͙YYtt͙Y7L/Q:BCOT"=U\lhA;QHt͙XXtt͙XXfO+6Ja@ -3&337A7-45))!5@H5FD 1.@H.</+3/?+2/9/q2//9///22104&#"54>;5#"32>'#".5>32##7#!4>32#".oA8-'7# D]8'8$"8(Y# &V6(XkYtt͙YYtt͙Yhi0S?$Q:jY\yH!=V0GL8YAGlhA;QHt͙XXtt͙XXfO%P@@H!D @H /+3/2?+22//9////10!33##7#!4>32#".HTV6(XkYtt͙YYtt͙YQlhA;QHt͙XXtt͙XXfO,8CWo@(:@(3 -@--@DND:AB666## 0B@HBSD+ >;@H;I/+3/?+2/9/q992//9///2/3/104.'>54.#"32>.54632#"&5467##7#!4>32#".v $+%7$'8&'*.,OL"<+_"@((%0V6(XkYtt͙YYtt͙Y#8.$ W=#>.0@%7Q#'cAKa/D)B!$.0/3-20+K#&L{lhA;QHt͙XXtt͙XXfO'2Fe@#)/%  /  /3=3)01  ""1@H1BD-*@H*8/+3/?+2/9/q2//9///33104.#"327+32>2#"&546##7#!4>32#".o&8$#9(<<7(NN$=Z; % %V6(XkYtt͙YYtt͙YWW{N#!=W6bk(vqQ+][7\EDBHLlhA;QHt͙XXtt͙XXfO =Q`@=1-07' -'  '->H>-1..@H.MD$::0@HC/+q3/?+2/2//9////23104.#"326'#".532%>32!5#7>54&#"4>32#".~%8&'9'$9(QIX# @ $#$#ln MB);Ytt͙YYtt͙Y4gS##SggS#?lT?m&4/8I5LQ$=;<#YPt͙XXtt͙XXfO';B@%%$ (2$%7D!!!-/]q?q9//9933104.#"32>'#"&'%4632&4%4>32#".P(Ig?ImI$(Ig?ImI$jaR?LLaR>KYtt͙YYtt͙Y)ic/:jZic/:jWP?( M=%t͙XXtt͙XXbfXb?10!5!ffb~\Xef??9/103 ^f$XeXb??9/10!#!f~b~$XeXb??9/10!5!~dbf\$XfXb??9/10!3!fbb~\$XfXb??9/10!5!3~bdf\+X feXb???9/210!#3!fb ^~\+X efXb???9/310!5!3ddf+X eXb?3?9/10!5!!fdbf\2X@  fXb?2?9/3/10!5!3!fbdf\ 9 X@   A f Xbe??32?9/210!#!5!3!fbddf# XXc?2210!!!!ffR\&XXef?3?3103#!3R,\ ^f (  e XXc??2210!#!5!5!f~~2dRf 1 AXXeeXb?2??/10!!#3#~ԖRf 8 AXX eXX ce???/210!#!!#f,Ԗ2~ - A Xe XXc??/2210!5!!5!~~Ζ 1 AXXeXbe??2?/10!#!3~d 8 AXX XX cee???/210#!5#!5pΖf\ - A XX Xcf??/3210!3!!5!f~d2>Rbf\ 3 AXXbffXb????/103!3#~R얖bRf\ 8 AXXff XXc???/2103!3!R~R,d2~\ -  A XXXcf??/210!5!3!5!~~pb\ 1 AXXfXbf??3?/103!5!3RR,\\ 8XX  A fXXcf???2105!3!5!3~R̖p,f\ 4 X A eX Xcf???/32210!3!!#!f~d2>2dRf\ : AX X e fXbfe?????/2103!!3#~R> ^ ^Rf\ I  AXrX eXX cfef?????/22210#!3!!#!R\ ^d2>2d~\ 4 X A XX cef???/32210!5!3#!5~薖Ζ\ 8 X XA Xbe f|?2?3?/3103#!5!3RR,\d ^\ F X X Af X Xceef?????/322103##!5%!5!3~R\dΖf 4  A Xe X Xc?3?/2210!5!!!5!ffΖ2f 5 XX X bee???33/10!!###!fddf ?@  X e XX ce??32?/2210#!5)!#!!~fbΖ2f\ 2   XX X cf??2/2210!5!3!!5!ff2>bf\ 5 XX X bff???22/10333!!5!RRR\df\ A  XX X Xcff???22/2210!5!33!!!RRfd2f\@  X XX c ef???32/2/3210!5!3!!#!5!ff2>2Ζf\E  XX A Xb feef?????32/32103#!5!3!!RR,R\d ^f\ Y X X X A Xceeff?????3222/32222210!5!33!!!##!5RRd22dΖf\f?10!fQfe?10!fQf\fe??10!f ^3\fe??10!!33 ^3f\ef??10!!33\'` \ #'+/37;?CGKOSW[_cgkosw{E@3x||lppu`ddiTXX]HLLQ<@@E0449$((-!  q rqr!q?""r-q'++/r9q377:rEq?CCGrQqKOORr]qW[[_riqcggjruqosswrq{rqrq/33232323232323232323]23232222333333333333333333333333103#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#3#%3#%3#^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^^^^^^^4^^^^^^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\N`f\ #'+/37;?CGKOSW[_cgkosw{ #'+/37A(#++''//773 (($$,,441   @ѫ{x||ckkggoowwr`hhddllttqKSSOOWW__[HPPLLTT\\Y3;;77??GGB08844<>BBEEI/333332333323333233332333323333233332333323333233332333323333233332333323333333333333333333333333333333333333333333333333333333333310!#3#3#3#3#3#3#3#3#3#3#3#3##5##5##5##5##5##35'35#3535!35!3535#353535#35#35#35#35#35#35735#35#35#35#35#35#35#353535#35#353535#35#35'35#3535%35#35%35#3535#3535#3535735#353535%35#3533535#35735#35!35%35#3533535#f\\\\\\\\\\\\\\\\\\\\\\\\\^^^^^^^^^^^N^^^^^^^*^*^^^^^^^^^^^x^^^^^^x^^^^^^^^^^^^^^^^^^^^^^^^^x^*^^^^^^^^^^^^*^^^*^^^^^^^^^^^^^^^^*^^^*^^^^^^^^^^^^*^*^^^^^^^^`\\\\\\\\\\\\\\\\\\\\\\\\\bbbbbbbbbbbJ\\\\\\ \\\\\\<\\\p\\\\4\\\\\\\\\\T\\T\\T\\\\p\\\4\\\p\\ \\h\\\\(\\ \\\\\\\\\\\\\<\\\\\\\\\\\@\\\\\\\\\\\\\\\\\\\\\\\\ff/101!ff[  66C?/10!!![PKPdVX/10!VXEVX66//10!!!ELXS244/10!24Fff//9=/101 33fm///9=/10%!0hpk&@)/]/]]9=/107p24;@$m_M/Bbr/]|/]]]]]9=/1072ff///9=/10 fffm///9=/10!mk(@)/]]/_]9=/10k0h24;@$m_M/Bbr/]|/]]]]]9=/10% 4hhR !շ AC??99/10!# 3% o$l80/''$@#/Oo /]/10"32>54.'2#".54>3Kb99bKKb99bKiPPiiPP9bKKb99bKKb9PiiPPiiP 24';Ocw@532#".54>32'#".54>32'#".54>327#".54>327#".54>324>32#".4>32#".74>32#".74>32#".'4>32#".".54>323       7   7     ,        7   7     k                       .   z  ////10#"5432Bf$@  e/?99//10!!"32>54.f3?oS00So??oS00So h0So??oS00So??oS0ff-)@$/.) /|/|||101!32>54.#"4>32#".fVprǔUUrKycG'dEx]]yEEy]]xEf2qƔUUqrǔU'GcyL^zGGz^\zGGz8. 6 6 //10#"&5463232654&#".igigVgIJdfJHfjhffJffJIeg.8-';I]{@IYCYOOY(2_(^4>32#".732>54.#"#"&'53267'".54>32$$$$DACB0^YX^00^XY^0D)m??m)'n@@n';$$$$k!+,  ,+!ԋgfmloŔVVooQRx=FF=.55.s!+,  ,+!N-'5IN@%..((;;E;EKJ..((+`222#6 @/22/]2|/2/9//}/|/3/3}/10"32>54.4>32#".#"&'32672>54.#"''&&?{vv{??{vv{?*vEEv*-tDCu-6((&&}#//""//#gfml 2882BKKB*#.0""0.#>'-A\@0(8C.)(B3'#" !  - , ))=/3|/9/9932|29/3210>75373#'#5.''7.'#53>7'32>54.#"U"N++N#TdT!no1TdTFV+M#RdR"nn!T*Ia77bI**Ib77aI*U!qq!TdT#N+TGSdS1pp RdR#M,,N#U8bI**Ib87bI++Ibd2?@)434 3.X$Xo?222/9/3210%##5#535.54>32332>54.#"^ڢSf:I}``~I:gS/Sn??oS//So??nS/QyV`~HH~`VyQs@oS//So@?oT00ToW/>@&0+X!X //222323332/10%'#".54>3232>54.#"i+Q`I~``}II}`ME|/Sn??oS//So??nS/@o`~HH~``~H#]@oS//So@?oT00To)=.@  //9/99///3210#"&'##".54>3ĂA$=O+Dt8++8tD+O=$A?5Q7L>@>L7Q5?$B2A@!+.#..#34 ((//9/939/////9922102>32#"&'##".54>32.54>3<]A!B6,M 5YA$%?T/;q=++=q;/T?%%@U1)P(6B!A]&@W0<@&CZ47Z?";88;"?Z73ZB&@<0W@&G @ //339///10>32.54>3236N1[E)54.'#"&54>3232  32#"&54>32%)NrHGQ%C]95;)NrHGQ%C]95;u%K`8MB)SC**iK`8MB)SC*hi+:6@      /9/3293310% %#' 76]F\]^^E^SR((fO5@ ppD/29?]q2//9/104>32#".##7#!Ytt͙YYtt͙Y9\'t͙XXtt͙XX͛YfafO 4C@% !+!`pp0D  &/]q?]q2//99//10!7>54.#">32!4>32#".D2J1">W4Ms-:"Q2$3! #>2Ytt͙YYtt͙Y1QMM,6U;8/E#-'55;I1^nt͙XXtt͙XXfO-A[@4&&&.8. ""))=D  3/]q?]q9/qq9//99//99104.'>54&#"632+32#"&'32>%4>32#".G0<32#".HykYtt͙YYtt͙Y\\t͙XXtt͙XXfO1E@$  (  -D #/q?]q9/q//99//104.+5!5!32#"&'32>%4>32#".B3Tk8DDYcho`+S!T#FxX3Ytt͙YYtt͙YAU3[oBJKX_&Eat͙XXtt͙XXfO-AM@,(.8.++++####=D3/q?]q9/q//99//2104.#"7>;5#"32>'#".5>32%4>32#".BeH'm*9")?*"]-PH+Ytt͙YYtt͙Y4V>#5W="[I{Z(G^0(>+?gNT0t͙XXtt͙XXfO1@D /]q2?//99//10!!3 4>32#".;wIYtt͙YYtt͙YbQt͙XXtt͙XXfO+=QR@/H>#9 &4 ,}9k99## 111MD)))) C/q?q9/qq99//9//104.'>54&#"32>.54632#"&54>7%4>32#".>,<#GL}y@_?FMUO!Bb@:dI)|AENIKCEJ *8 BW"7)0?$3Ytt͙YYtt͙Yl'@4)$_EUc!7G%?^(+hH*G34M.E #C/433,) :6+('))*t͙XXtt͙XXfO-AM@,) # .8.&&=D3/q?]q9/q//99//104.#"3267+32>2#"&54>4>32#".I)Hc:+ _-PG*9Ytt͙YYtt͙YYbU'(G_63U?#p{[2k?hMSI(>+t͙XXtt͙XXfO +?Q@"( (  (,6,")**@H*;D&#@H#1/+3/?+2/2//9///104.#"326'#".532##7#!4>32#".o%8&'9'$9(QIX# @V6(XkYtt͙YYtt͙Y4gS##SggS#?lT?mlhA;QHt͙XXtt͙XX&/' !s !@    ]]q5]5&O& K K@  _o]]q5]5&/@   O  ]]]5&3 @_?]]]]]5^)4C/*#"ij*/@ //"C.A /??9/9/9103267#".5!2#.#4&+32>\ 1"4<#XrB^ri1$GiD7M(.5?'Nx?eG'FFS,  .WzMq2ZM=mYA_OR0?%njgP9S*T<(&D *T<-&W oHO,8  @ PS QQ????10!#4&#"#3>323#oWQ#=BN3)OOR,e ur/P7'.54>323#>54&#" H %  6R77U:*>(+vn* %"  |B0d9)F43E*/LFE':&S*(#D !@ CA??9///210!#3!kX!@ QO??9///210!#3!쯯IbC"69  +@ 0R&PP?3??//29/104.#">%4>74>32#".{!7*!+ A_?2EGl30#7_H$Dc?XwI .r”cmH+SY/4R:32#".!-+!!+-!tj,!!,,!!,Zs%@@OO  /]?9//]102#".54>' +!!+-!!-J_s!,,  ,,!L^hy@ O?///10!5!2#".54>hj,!!,,!!,L!-+!!+-!stK8O?//10!5!53t}n\k<* 1pp@  A/?32999///9/10%#%#*{Ϝ/VwDNg<* 6pp@  //399//399//9/1033<1Z"D6Wfh)Enָe+#h+ui+Fh+h+A]A)9IYiy ]A&6FVfv ]A]+u9IF9FLFklF9pu9xu9F9u9uܸи/ии/F9EX/>Y h+h+.*i+A'7GWgw ]A]ии01%2>54.#"2#".54>!>32#&'.'.'.>54.'.'.'.546763635.54676'.>7;#267#"&'353.'4>73""#"&'.'.'#3467>3;&'&'&"353kRRkkRRku͙XXuuΙX(Jf~-A[[A   @<4 B5AP 6 AI)5S; ' NW }4
'  S @H   TQQ???9/932+910!#!##5354632.#"!%ï{5?<<4= yz|eG    @ Q  T Q??9/932?99/10.#"3###5354632#: ծAO~| w hc  O?2//10 '6,3h'5[Kh@cc  O?2//102 $!5'c@hK[hW   O?//10.#"#&>32hD@ɅWob #LP321 DC@;bE&+HM*P %]4>lP/'=sh5> =]=jc "M{Ydd3'F @ '(! (@ @H  O'$R??+999/102#".54>#".5!5!3267/2%%22%%2%_4HxW1[Y*R"&21&&12&w "M{Y%djc &C&t&&}&iN&o&*>^:0$$ ?+(@5@H5 O  R'W??9/?99+9/999/10#"&54>7.5!5!326732672#".54>=lo*"ErS.[Y*R"#+ +5';2%%22%%2\H,19#%MyV%djc $7,' )&21&&12&- @    OR??999/10%#".5!5!3267%_4HxW1[Y*R" "M{Y%djc 3F/%45 (@*@H*P R??+9/103267#".54&#"5>322#".54>[Z*Q %_4HxW1ZZ*S#&`5GyX1^2%%22%%2Pjc "M{Ykjc "M|Y&21&&12&&C&t&&}&iN&o&J`"JDD@:44KL;:7>D4.>(@  >P.JG.R&W??9?]999/102#".54>3267#"&54>7.54&#"5>323267/2%%22%%2#+ +5'=lo*"ErS.ZZ*S#&`5GyX1YY*R"&21&&12&w$7,' )q\H,19#%MyVkjc "M|Yjc 4@ ! P R??999/103267#".54&#"5>32[Z*Q %_4HxW1ZZ*S#&`5GyX1Pjc "M{Ykjc "M|YH\s#9I4)# :$(@/////P V??]10%#"&'532654.#"5>32+".54>3HAzoQ>"NSU)~!Bb@32HAzoQ>"NSU)~!Bb@7;J^f6t|DED!.ah  R&R) HS?+4&5f&P`    @     SR??99//9999999/9/10%#".=573%32>7;J^f6Vt|DED!.ahsrqꮞ‰  _&w 4@ ! T R??999/103267#".54&#"5>32[Z*Q %_4HxW1ZZ*S#&`5GyX1Pjc "M{Ykb "M{YR&R)$ H$$S?+4p&ԝf&'p@ &&$@()'&%$%@%%% T R??99//9999999/9/9/103267#".55%4&#"5>32%[Z*Q %_4HxW1ZZ*S#&`5GyX1Pjc "M{YRkb "M{Yђ'w2^A @ Q  @ PO???929/99/10>32.#"!!53#5$KVd=0c(0n-5SLJ,+N+C. 1M6Պ&t&^f&k- Q  PO???99103>32.#"#ɟ,ZdtG;<8 FA7@l_S'5M1 "=S1&t&f&b0P -$@ 12$*- @.*PP R???9999//99/10"327#".54&#"562327>32./5TLK,[ZSB#Z5HxW1VL  5_N;'NWe=0c(0nd1N6jc "M{Ykjc.H4.F0 &t&bf&9h:Y#5ʵ&-&-@;#-:);,-0) R?/9/99/999//910"32>=7#".54>7.54632.#"3?HzY2#HkHIqM(:you=%B[6Z`._+1e03V>#(Hc;"EgE7`F))MlC/]}I:iYCz`C %g1I/;R4{/@@@HA?^]+/10#%37{/@@@HA?^]+/10#7b{o{=@ @HA?^]2+9/2210#'#73oyffo{=@ @HA?^]+29/2210373#!{ggՋ)@  A?^]/10>323267#".#"+mE:P>7"(=V,lE;O>7")<HI"("7+RHI"("7+y{#$$ز  $A?22/102#"&54>!2#"&54>X''-='((-='{('=-(('=-(NP@ A?]/10!5!N5˅=*F F@  A?^]2/10#".533265=+Ia55`J+C>>CL=W88W=3333 +66@   A?^]/102#".54>"32654&3+J66J++I66I+(22(*003F*)G33G)*F3f/)(22()/#$_ #!""77"@H"pH H $A r??++q+/9/102#".54>"32654&#72.P9 9O-/M; ;M.+55+,33_2/B'&C//C'&A/_,%%..%%,N}f{C@@A?^]2]2/10#7!#7ߵ{ !A?/104>32#"."..##.."L.##..##.= $///102>54.54>327) '1&2VtA) & & #-D/JtQ,9R^-b/5-/  EfYFEflf{f;f;jfCwfE fE fYF>f  @f^f`fb !?E;;1'1 @1@"6 ,6T,R??9/9999/10>54&#"32>54&#"%#".54>32Zp=PGDgI- (JkDMmF!%C&24eO0>xtlu=A}JvR,,A06:54'#".54>323##"";.s"CeDKh?r=*TV"{9qqGU?j^| '?WA:S1H'KlE4fO1Ӓ#*&hblHH7!9(>gJ))f?#1F)$@23$2U.#P?3?9/329/104>32#&54>7>54.#"2H.}!?[9R^4Ex\+NkA7EeB #7D"*"Nct?RPqH"JsF r g\ Ac~G]_0EUm4 Ȳ@IA?/10#Z\/ wm-@A;.;1@ )A; 6$R  S??999/99910.54>3!!"#".54>32>54.'u,-_c8L.+RmB.IiYoh2'Fao{ BdD@gH&1Q<1;@!6_E( "%h/nv|=4nj_G*LeUuZ<1N[21UtC7^SI"fo* @   O?]2/10#".5332>5f-QrEPrI"!8*+9"9o;\A""A\;2''2}jf*sr@  A?^]2/10#"&5332>5j.SsE#9*+:$5f:Y<yt/!!/-SSGTS3@) SO=OB(O(O.BR:R#.T???99//99/23103267.#"32>54.#"'>32#"&'#".54>7>327%%.Z26 .#1-" 2*" (V`G|jY$y0u^~? 4RrMV\:>? EY5*E3,vJ&LQp\sgMd:0UsHΎJ*H`6XFuU/^GzIbZ6H+5YwBL3,0%})2;@)*2 ;36-@$< ** )@36; 2-))NM??99//92299//9933}103.'#7.'5.54>7>54.'P4h4324.#"32>2#".54>324.#"32>324&'32>%.#"@|ue|E@|uh{C v^CkL) v\DlK(Bz٢_Hޖzס^Jܟ?yJZ5l|=JZ7mX';G-77 @  <(/(((#@ 22g#e??9/]9/10#".54>324.#"32>%2#".54>@|ue|E@|uh{CCpTDlK(CpUCkL)."".-""-Bz٢_Hޖyء^JܟX|J7mkV|L5l#.-""-.#X'$@ (g#e??10#".54>324.#"32>@|ue|E@|uh{CCpTDlK(CpUCkL)Bz٢_Hޖyء^JܟX|J7mkV|L5l 9 @  f d?2?9/9/310)5!'%3!P@$!!8! @" g d?2?999//10)5>54.#"'>32!LQe88S7Q9^KpUi;"KvU` @bTR1,P<#C8qMT1]T>vtw@!4P@ 0-$$- @ 5%$!(0(g i??9/999///910%#"&'532>54.+532>54&#"5>32H8m654&+!!32V/d*38:cc2r^Ua}G.Om?{o}#T{f3@* @4*%j/e??9/99/210#"4>;#">324.#"32>AxgCnۏÂE_B&MIC"EgE9_E'ZuC%dǷtBOY&6@oatPw#5G,$@;1;11; 6>@# H1;;1'6>$,k;keCe???9/9?999/999=////9910#".54>7.54>324&#">4.'32>E|eli4=nX}4ikeh4CmM*{q7X=!9Y?3X?$=fLz~%D_:(ZK1RP_58^~E+^ab0Aw@e?3YyGiB"P`q]n4I-'E@?!?BE:(MKJ%DP3N50Jd)"6<2 (@72- #g h??9/99/210+532>?#".54>32"32>74.3K2UD`C%MJB%Ff7W6^XK~Y)3AoT[uD@#%GhC377456@3\755764563/+'$1-)%$ "$ @#! @&Z #$'(+30/,#+,,+#//9/////+/////9/9+10 @TX #a`# HH`#a #xY @TX #a`# HH`#a #xY#!#3!33#3#3#3##!#5#535#535#535#53vr~҂P,,,``ddddddddddddddrzFOZ8 R@1H0HdtFV@ H0?/]]]]9/+]]++/9/10#'32654&+532LIZ2( P@ HhF!EQ^"(-k#6Cj k@ @   @# HYi  @`//]]3]9/]]+/999/10#'#7%#7t۟wߍyykj q@ @   @( HYi  @?/]]]3]9/]]+/999/10#'#7%#7t۟wߍyykJ h @  @# HYi  @`//]]3]9/]]+/999/10#'#7%#'oۚ֠yykJ n @  @( HYi  @?/]]]3]9/]]+/999/10#'#7%#'oۚ֠yyk 8 8@ @@ Yi HV f U e  гH @,HF  P ` p  @`//]]3]9/q]9/]++]q+]/999/910#'#7%#'32654&+532t۟=<R) 323267#".#"#'#7+mE:P>7"(=V,lE;O>7")<\HI"("7+VHI!)"7+323267#".#"#'#7+mE:P>7"(=V,lE;O>7")<\*9:&V9:&>3)QqyPP@ r#&H@4H?O  @  0   /]qr^]^]q2]++?]/9/10#7#".533265Qߍ+Ia55`J+C>>Cq=W88W=3333+t3PP@` /  /]]2/9/10#'#".533265栍(CZ33ZC(8888t=[<<[=3>>3=p}PP@ r#&H@7H?O  @  0   /]qr^]^]q2]q++?]/9/10#'#".533265栍#+Ia55`J+C>>Cp=W88W=3333;+&8!8@!! P P@ Vf@+He[@ H !!   `//]]]2]9/+]]+q/9/910#".5332657#'32654&+532+(CZ33ZC(8888.=<R) >38AKj,6)=&ݲ  P&P8 8@- +$ ###$#####H#@>C6A`j+5=W88W=3333)WP P@) ))!&@ ! `//]]2]]]//10#".533265%>323267#".#"+(CZ33ZC(8888&+mE:P>7"(=V,lE;O>7")<=[<<[=3>>3HI"("7+VHI!)"7+))P #P"14H#&H@H "&323267#".#"#".533265+mE:P>7"(=V,lE;O>7")<+Ia55`J+C>>C 9:&V9:&H=W88W=3333TT) +*o%/?104>32#".732>54.#"'GcyKrǔUUrpƔVdEx]]yEEy]]xE2LycG'UrqƔUUq\zGGz\^zGGzw-#2 !!@! D BA C???32?/3//2104.#"#3>32#526=5J+ KT\0,]_^,NZ15farm ?Z8/P<=4E*.[\ui1w\-#2 !!@! F BA C???32?/3//210%4.#"#3>32#526=5J+ KT\0,]_^,NZ15farm ?Z8/P<=4E*.[\Tui1w-+; &&@ &&)% D BA??32?323///3/2104.#"#3>32#".'5326=5J+ KT\0,]_^,NZ14.+326;)KkB9?5) "9,a^"8'-@)`dUT0J36N'5# (( 8# 40 ?33/322/3/3/10#"&54>32.#"3267X`.UyK3W('V22Q9ql/W'0#PZ1\"B^=7M &0 /  ?3//3/10+324.+32M$9SnF¬n;Y=PEj0XK>,F`; l  7@   /@    ?3/9//23/3/3/10!!!!!! _+8RRl  //@?3/9//3/3/210!!!#! 'i^P  *)F/0! )& ?32?329//3/9/2/10.#"32>75#53#".54>32!)W3:[>!9Y>  466M{W.6_M2Y)8$D_:<_B#P  +T}SR[/07 4 / / ?33/39//23/310#!#3!37jii4j/U 6@  /@   ?3/22/2/3/3/3/10#5!#3!53D]SS SSO +/@    ?323//3/3/10#".'53265!59V;.*% #T*:@.+M9! [D?S_^ 5/@  ?33/3933/3/33/3210##33^jj |G64/?3/3/10!3!4Zj< XV@   . /@    ?33/3/9/323/3/2/339333/3310#'#'#3?3Xg"mDg# d$ch\ggUU25 3 . .@   ?3/33/33//23/310#'#3535@fLfve X')00 #?3//3/10#".54>324.#"32>X0Rl323267#".4.#"32>84,%O)-K=&,E00C,+D1/D, 3UtF[V).WNQ{V0,4C-B;]F&(FY5<`F&(F]_b$=/ 0@     ?33/9/9/3/32/3210#'.+#324&+32>byn %2iC`>);&+2LDbT$:).@(7.! 0(32(- #3I*0 $$0@  / $'# ?323/3299/3/2/3/10#"&'532654.'.54>32.#"#+MlA;p&,jB]P,;'N?'ChJ+--.W(SM-9 'N?(1H/ b10"  ,<,#C4 \ /)"  -?(>&/@ ?3/2/3/2/10###5!>j]HS/ 8'/ /  ?3/3/3/10#".53326538#Cc?Fb=j%;*PKj7Y?"  <[yIIy\< `bb`&&-9&SrF FrSVTTV%&<+%=&QQ@  A?/2/3/104&#"#4>32C>>C+J`55aI+3333=W88W=!@  O?2/3/3/3/3/10#".54>7?,7=3%;`FRG  $7"6%+O=%[m O A?5mvbn@H H++5E{ Bm*T<( T q* Q@&      r?33/333933323/33/33393333310''7'7LuuNuuLuuNu*LuvNvvLuvNvf-'B7B@@ @ H H+5+5{{t @ H+5=  H+5 '5HHHH H+++++55Cc H+5 A?5X#0@  o/]2]/9/10>32#.#"".54>32 <[yIIy\; `bb`&&-9&-RsF FsRVTTV%&<+%'8@@ Z?/3/3/102654.#52#*:$-N:"":N-9:*%j 8L++K8 2vc@ H@H++5j'?P@&@ @H@H++5j @ @H @ H ++5K"<*#W$,24H&+HH H++++55.8%Q&W'E!(# 24H '+H H +++55Q)! 24H ''H H +++5I*K+;*n, H +5!D-G.))@ @/]/10!5!7mm@ @/]/10!%3!mm@ @/]/10#'!5!@ m@ @/]/10!#7!@ 7m#B @ /]/10#'#%373Bʒ$B @ /]/10#'#737B+? A?5+\%G @ &%#TV?32?329/32/3/3/32/22/10&#"!!#"&'532767!5!5!2xV}[T=t25::X1/{_r9_KRp: HEɑJ& X& &&\H&&&&&&&&&&&H\%& \%& H\%& I& W@ p@]]]5'& 5@ p@]]]5D& R@ p1@111]]]5P&vP1&v&%6@+p+/+++HP++@ H +++]]+]+]qqq5&%6@7p7/777HP77@ H 777]]+]+]qqq5&%6@ p /   HP  @ H   ]]+]+]qqq5&%6@p/HP@ H ]]+]+]qqq5&%6@#p#/###HP##@ H ###]]+]+]qqq55v&v&v&&ov)))HO))]+]]5v&&ov555HO55]+]]5&o%'@o0  P O ]]]qqq5&o%'@"o"0"""" "P"O"""]]]qqq5&%C@pO/HHP@ H ]]+]++qqqqq5&%C@""p"O"/""H"HP""@ H """]]+]++qqqqq5&&&^v&[v&bv&vN&&o[vN&&ovN&&ox&ox%'@o0 PO]]]qqq5&o%'@o0 PO]]]qqq5&o%'@3o303333 3P3O333]]]qqq5S&' aK aK@_o]]q5]5&& K K@  $$$_$o$$]]q5]5& & & & & Sy'y>y /3//3/10!#!5!3e*H* /3//3/10!#!5!3 /3//3/10!#!5!3Gל7/3///10!#!5!3JCz/3//3/10!#73zeSH_4C@ /3/9///10!# 7 3fSGH _4C @ /3/9//3/10!#!7!3SGH_HC/3//3/10!#73S_qC /3//3/10!# 73fSG_~sC/3///10!# 73fS_j^8C/3//3/10!#73S_q//3///10!# 7 3RgGHG5/ @ /3/9//3/10!# 7 3Rga.G@ / @ /3/9//3/10!#!7!3Rg}Gq/ /3//3/10!# 73RgGHG@//3///10!#73 gsG[/z/3//3/10!#73zQgHG<77%/3///10!# 7 3HqGHj<7#% /3//3/10!# 7 53HqQ>q<7% /3//3/10!# 7 3Hqq<7 q% @ /3/9//3/10!#!733HqG<7)%/3///10!# 73HqۜG<7z/3///10!#73zww/ ///3/10!# 7 53R]QHqG>q/ @ //9//3/10!# 7 3R]k.G>FAg/ @ //9//3/10!#!7!3R]GJ;/////10!# 73R]GG>/z////10!#73zQjE'#`///2//10!# 7 3Qj:R*I7/ //2/3/10!# 7 53RjDH*$:̀/ //2/3/10!# 7 3RjZ2q-k/ //2/3/10!# 7 3Rj{G-/////10)733Rj*b&z////10!#'3zjN&////10!#!'!j^=qP& /3//3/10!# ' 3jG#M4& /3//3/10!# ' 3jH5P5& /3//3/10!# ' 3jHGWH#&/3///10!# ' 3jGEBz///3/10!#'3zTQ>B////10!#'3qTjB @ //9//3/10!#!'!3T~egyHB @ //9//3/10!# ' 3THGZ{B @ //9//3/10!# ' 3THGZB////10!# ' 3TGZj@ //9///10!#!5!3_GH @ //9//3/10!#!5!3GHe* @ //9//3/10!#!5!3e*GH@ //9///10!#!5!3Bz///3/10!#73zdTHGRB@ //9///10!# 7 3eTrtpB @ //9//3/10!# 7 53dT.aqpB @ //9//3/10!# 7 3eTQ>pB{B @ //9//3/10!#!7!3TGHGaB////10!#73Tfq&z////10!#73zHpHnOW&//2//10!# 7 3Hp,cnIp& //2/3/10!# 7 53Hp2]*nLv& //2/3/10!# 7 3IpGHqnRY& //3/3/10!# 7 3Ipe*GnI.:&////10)733IpnI#z////10!#'3zst8;#////10!##'!`s)H+# /3//3/10!#%' 3sHA2# /3//3/10!# ' 3sH;8# /3//3/10!# ' 3sHG>5##/3///10!# ' 3sG7>5/z///3/10!#'53zgqD}/////10!#' 3igHqQe/ @ //9//3/10!#!'!3gHqNH/ @ //9//3/10!# ' 3gHGqAq/ ///3/10!# ' 3gHGq2g]}/////10!# ' 3gGqALLKz///3/10!#'3zKZK////10!#' 3pK}]s@K///3/10!#'3qKڜqm*K @ //9//3/10!#!'!3K~\g}K @ //9//3/10!# ' 3KHGHcK@ //9///10!# ' 3KGp@ //9///10!#!5!3_GH7 @ //9//3/10!#!5!53iQ>q9 @ //9//3/10!#!5!3GHfq@ //9///10!#!5!3e*GBz////10!#73zdTHfB//2//10!# 7 3dT~fB //3/3/10!# 7 53eTr*f\vB //3/3/10!# 7 3eT4[qf+B //3/3/10!# 7 3eTGHGfGB////10)7!3THG]z//2//10!#'3z|Ĝ$.//3//10!##'!b|. /3/2/3/10!#%' 3|H9.  /3/2/3/10!# ' 3|H.! /3/2/3/10!# ' 3|HG.-/3/2//10!# ' 3|H.$z//2/3/10!#'53zr*2&b$//3//10!#' 3LrH*2$ @ //29//3/10!##'!3jrH*2@H$ //2/3/10!# ' 3rHG*2g$ //2/3/10!# ' 3r>G*2EK$//2//10!# ' 3r4*2 L/z//2/3/10!#'3zgqOT///2//10!#'3qg[Ok/ //2/3/10!#' 3igHqO/ @ //29//3/10!#!'!3gRqO/ @ //29//3/10!# ' 3g%GHqO///2//10!# ' 3g1qOTNz//2/3/10!#'3zHG{N//2//10!#' 3RHB8{2 N //2/3/10!#' 53fHHq{.sN//2/3/10!#'3qHלq{qN @ //29//3/10!#!'!3H>G{hN@ //39///10!# ' 3H0G{|//3//10!#!5!3_GHJ //3/3/10!#!5!53sGH*N //3/3/10!#!5!3_[4qa //3/3/10!#!5!3GHGe55mmllaa]6SCSCSBSBDDSPSPSOSOQQ``__{7{79No+%S &oC`!@@**H@#%H@H@H++++55S &oB`!@@**H@#%H@H@H++++55S &oP`!@@**H@#%H@H@H++++55S &oO`!@@**H@#%H@H@H++++55S &C`'@-@.4H-@#*H-@H-@H-@ H-+++++55S &B`'@-@.4H-@#*H-@H-@H-@ H-+++++55S &P`'@-@.4H-@#*H-@H-@H-@ H-+++++55S &B`'@-@.4H-@#*H-@H-@H-@ H-+++++55&`o_ 1@ H1+5&_o_ 1@ H1+5&`['@????`?/????]]]]]]]q5&_['@????`?/????]]]]]]]q5sv9No+!Dgg2 R?5m///10!5!\՘f'BB(HH H++5+55% M@   A?3//2/102>324&#"#Cn\OHG%yv95;DPavH#yG>"@  @//10.54632=S3F36/%%7#:K*>8.!@ @ //10>54.546327%%/63F3S=!.8>*K:#<W !6 U^  @ QV??/9910%!#"&'532>=#^) @ Q V??/10%3267#".=#7= 1":<#Xo>^*FY3 5]MB^ @ QV??/10%!#"&'532>=!=#>=#i=#h'JjC:60(]P$ ";0w^)  V/?/10%3267#".== 1":<#Xo>FY3 5]M^)M  V/?/10%3267#".== 1":<#Xo>MvFY3 5]MuC@&@ @ H@ O?]+]q//9/10#7>323267#".#"LߍI+mE:P>7"(=V,lE;O>7")<uHI"("7+VHI!)"7+zU@(  @H@` HAr??+q]q3/+22//9/10>323267#".#"#7+mE:P>7"(=V,lE;O>7")<0ߍ}HI"("7+RHI"("7+Ll*@@ O?]/9/10#7!5!Lߍ l]9l*@@ O?]/9/10#'!5!ݠ( l]O4@@@A@P`/]?]q/9/10!!#'5ˠP+?@P 1شO;;@ ',`@6"" "" @@O?2]]2//]10>323267#".#"2#".54>!2#".54>+mE:P>7"(=V,lE;O>7")<=)))))))) HI"("7+VHI!)"7+5)))))))){+,1' ض`",O?]//10!5!2#".54>!2#".54>9 #)))))))) ɅR))))))))Ly'(I# @@(A o@  0@/]q]?]q//10!5!2#"&54>!2#"&54>N5 ''-='((-='˅G('=-(('=-(3 ش`@ @@ HO?9/+]/9/10#7%2#".54>1$$10$$0$00$$00$o= ص`@@@HO?23/+]/910'3732#".54>H1$$10$$0yy$$00$$00$5oQ@ @@H@ HHA r??+]q2+3/+/910373#4>32#".,"..##.."M{ggy.##..##.6 #@  A?/229/310#'##'##'Z"00"00"Zj6ddddqfC ////107iiJyKz@ @W Q??/1032654.'3#"&'z1C6 ,$'/ ~n59) ',7$&>4.H\O4@@A@P`O/q]?]/9/10!5!#7N5ߍ}˅/);<c /7@2%4" ""O_o""323267#".#"2#"&54>!2#"&54>+mE:P>7"(=V,lE;O>7")<9''-='((-='HI"("7+RHI"("7+('=-(('=-(}f<`ش`  @@ HA?]9/+]/]10#7%4>32#"."..##.."{l.##..##.N{I///10!!wIT@ ?o/]///10 #]A*T<(*@/?_@-2H/+]r///10 #<Y(,Z{///10!!wyo#'(V$ز%ص `  @ H (A% &0&&& H&|/+]q?+]2]2//102#"&54>!2#"&54>7!5!X''-='((-='V5{('=-(('=-(o{:'+,@(ز#)ص`@ ,O)*`**@ H*/+]q?2]2//102#".54>!2#".54>7!5!\))))))))F C))))))))ry'(O`# ص`@ (A@P`@H/]+]?]2]2//9/]10#72#"&54>!2#"&54>Oߍ''-='((-='('=-(('=-({O+,A' @@ `",O?2]2]//9/10#72#".54>!2#".54>Lߍ)))))))) O))))))))y#*+i@ *'$)%% @ `@!  +A'''''$$$(%%%%/]]2]q?]2]q2//9/9102#"&54>!2#"&54>%'373X''-='((-='ۚ{('=-(('=-(1yyo{./N@  * @@ `%/O?2]2]2//9/910'3732#".54>!2#".54>ۚ)))))))) yyG))))))))oy'(K # ص`@ (A@P`@H/]+]?]]//9/10#'2#".54>!2#".54>䠍'=-''`'=-(((-='((-='({O+,A ' @@ `",O?2]2]//9/10#'2#".54>!2#".54>砍))))i))))O))))))))NR @ @`@ HA 0/]q?+]]/9/]10!5!2#".54>N51$$10$$0$00$$00${9[,@ @` O?]/9/102#".54>%!5!31$$10$$0# f$00$$00$pz{'@@@HA?]+//10#'##%Ӷ${#@@@HO?+//10#'##%ϯݮ%g=@ A?]/32104&#"#4>32C>>C+J`55aI+3333=W88W=+@  O?/32104&#"#4>328888(CZ33ZC(3>>3=[<<[={&o-,@H@H?O]]]]++5zR@2  @ /]q]]]]22/]////]10>323267#".#"!5!+mE:P>7"(=V,lE;O>7")</5HI"("7+RHI"("7+Qv&v&v&v&v&&&!)T5| 2% t   6 &  ,& R ~  6  6D  d X  6 @  L W X  *S   2015 TypoStyle Co. All Rights Reserved. 2015 TypoStyle Co. All Rights Reserved.Code New RomanCode New RomanRegularRegularCode New Roman:Version 2.10Code New Roman:Version 2.10Code New RomanCode New RomanVersion 2.10 March 29, 2015Version 2.10 March 29, 2015CodeNewRomanCodeNewRomanCode New Roman is a trademark of the TypoStyle Co.Code New Roman is a trademark of the TypoStyle Co.TypoStyle Co.TypoStyle Co.Samiru R.Samiru R.Code New Roman is aimed for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for programmers. This font improved and target to Mac OS Western New Roman, MONACO, Windows Consolas/Lusida Consolas, ABeeZee and Bitstream Vera Sans Mono.This font display allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortably reading of extended text on screen. OpenType features include hanging or lining numerals; slashed, dotted and normal zeros; and alternative shapes for a number of lower-case letters. The look of text can be tuned to personal taste by varying the number of bars and waves.Code New Roman is aimed for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for programmers. This font improved and target to Mac OS Western New Roman, MONACO, Windows Consolas/Lusida Consolas, ABeeZee and Bitstream Vera Sans Mono.This font display allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortably reading of extended text on screen. OpenType features include hanging or lining numerals; slashed, dotted and normal zeros; and alternative shapes for a number of lower-case letters. The look of text can be tuned to personal taste by varying the number of bars and waves.http://typostyle.com/cat/reg/cnrhttp://typostyle.com/cat/reg/cnrhttp://typostyle.com/typo/dsinr/samiruhttp://typostyle.com/typo/dsinr/samiruIMPORTANT Code New Roman LICENSE TERMS This font is freeware. You can not redistribute and/or modify it. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: http://scripts.sil.org/OFL v1.1 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the OFL License for more details. ** and remember CNR is non-profit font** Designer: imSamiru@live.comIMPORTANT Code New Roman LICENSE TERMS This font is freeware. You can not redistribute and/or modify it. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: http://scripts.sil.org/OFL v1.1 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the OFL License for more details. ** and remember CNR is non-profit font** Designer: imSamiru@live.comhttp://typostyle.com/http://typostyle.com/Code New RomanCode New RomanBonjourf   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghjikmlnoqprsutvwxzy{}|~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                            ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  uni00B2uni00B3uni00B9AmacronamacronAbreveabreveAogonekaogonek Ccircumflex ccircumflex Cdotaccent cdotaccentDcarondcaronDcroatEmacronemacronEbreveebreve Edotaccent edotaccentEogonekeogonekEcaronecaron Gcircumflex gcircumflex Gdotaccent gdotaccentuni0122uni0123 Hcircumflex hcircumflexHbarhbarItildeitildeImacronimacronIbreveibreveIogonekiogonekIJij Jcircumflex jcircumflexuni0136uni0137 kgreenlandicLacutelacuteuni013Buni013CLcaronlcaronLdotldotNacutenacuteuni0145uni0146Ncaronncaron napostropheEngengOmacronomacronObreveobreve Ohungarumlaut ohungarumlautRacuteracuteuni0156uni0157RcaronrcaronSacutesacute Scircumflex scircumflexuni0162uni0163TcarontcaronTbartbarUtildeutildeUmacronumacronUbreveubreveUringuring Uhungarumlaut uhungarumlautUogonekuogonek Wcircumflex wcircumflex Ycircumflex ycircumflexZacutezacute Zdotaccent zdotaccentlongsuni0180uni0181uni0182uni0183uni0184uni0185uni0186uni0187uni0188uni0189uni018Auni018Buni018Cuni018Duni018Euni018Funi0190uni0191uni0193uni0194uni0195uni0196uni0197uni0198uni0199uni019Auni019Buni019Cuni019Duni019Euni019FOhornohornuni01A2uni01A3uni01A4uni01A5uni01A6uni01A7uni01A8uni01A9uni01AAuni01ABuni01ACuni01ADuni01AEUhornuhornuni01B1uni01B2uni01B3uni01B4uni01B5uni01B6uni01B7uni01B8uni01B9uni01BAuni01BBuni01BCuni01BDuni01BEuni01BFuni01C0uni01C1uni01C2uni01C3uni01C4uni01C5uni01C6uni01C7uni01C8uni01C9uni01CAuni01CBuni01CCuni01CDuni01CEuni01CFuni01D0uni01D1uni01D2uni01D3uni01D4uni01D5uni01D6uni01D7uni01D8uni01D9uni01DAuni01DBuni01DCuni01DDuni01DEuni01DFuni01E0uni01E1uni01E2uni01E3uni01E4uni01E5Gcarongcaronuni01E8uni01E9uni01EAuni01EBuni01ECuni01EDuni01EEuni01EFuni01F0uni01F1uni01F2uni01F3uni01F4uni01F5uni01F6uni01F7uni01F8uni01F9 Aringacute aringacuteAEacuteaeacute Oslashacute oslashacuteuni0200uni0201uni0202uni0203uni0204uni0205uni0206uni0207uni0208uni0209uni020Auni020Buni020Cuni020Duni020Euni020Funi0210uni0211uni0212uni0213uni0214uni0215uni0216uni0217uni0218uni0219uni021Auni021Buni021Cuni021Duni021Euni021Funi0220uni0221uni0222uni0223uni0224uni0225uni0226uni0227uni0228uni0229uni022Auni022Buni022Cuni022Duni022Euni022Funi0230uni0231uni0232uni0233uni0234uni0235uni0236uni0237uni0238uni0239uni023Auni023Buni023Cuni023Duni023Euni023Funi0240uni0241uni0242uni0243uni0244uni0245uni0246uni0247uni0248uni0249uni024Auni024Buni024Cuni024Duni024Euni024Funi0250uni0251uni0252uni0253uni0254uni0255uni0256uni0257uni0258uni0259uni025Auni025Buni025Cuni025Duni025Euni025Funi0260uni0261uni0262uni0263uni0264uni0265uni0266uni0267uni0268uni0269uni026Auni026Buni026Cuni026Duni026Euni026Funi0270uni0271uni0272uni0273uni0274uni0275uni0276uni0277uni0278uni0279uni027Auni027Buni027Cuni027Duni027Euni027Funi0280uni0281uni0282uni0283uni0284uni0285uni0286uni0287uni0288uni0289uni028Auni028Buni028Cuni028Duni028Euni028Funi0290uni0291uni0292uni0293uni0294uni0295uni0296uni0297uni0298uni0299uni029Auni029Buni029Cuni029Duni029Euni029Funi02A0uni02A1uni02A2uni02A3uni02A4uni02A5uni02A6uni02A7uni02A8uni02A9uni02AAuni02ABuni02ACuni02ADuni02AEuni02AFuni02B0uni02B1uni02B2uni02B3uni02B4uni02B5uni02B6uni02B7uni02B8minuteuni02BAuni02BBuni02BCuni02BDuni02BEuni02BFuni02C0uni02C1uni02C2uni02C3uni02C4uni02C5uni02C8uni02CAuni02CBuni02CCuni02CDuni02CEuni02CFuni02D0uni02D1uni02D2uni02D3uni02D4uni02D5uni02D6uni02D7uni02DEuni02DFuni02E0uni02E1uni02E2uni02E3uni02E4uni02E5uni02E6uni02E7uni02E8uni02E9uni02EAuni02EBuni02ECuni02EDuni02EEuni02EFuni02F0uni02F1uni02F2uni02F3uni02F4uni02F5uni02F6uni02F7uni02F8uni02F9uni02FAuni02FBuni02FCuni02FDuni02FEuni02FF gravecomb acutecombuni0302 tildecombuni0304uni0305uni0306uni0307uni0308 hookabovecombuni030Auni030Buni030Cuni030Duni030Euni030Funi0310uni0311uni0312uni0313uni0314uni0315uni0316uni0317uni0318uni0319uni031Auni031Buni031Cuni031Duni031Euni031Funi0320uni0321uni0322 dotbelowcombuni0324uni0325uni0326uni0327uni0328uni0329uni032Auni032Buni032Cuni032Duni032Euni032Funi0330uni0331uni0332uni0333uni0334uni0335uni0336uni0337uni0338uni0339uni033Auni033Buni033Cuni033Duni033Euni033Funi0340uni0341uni0342uni0343uni0344uni0345uni0346uni0347uni0348uni0349uni034Auni034Buni034Cuni034Duni034Euni034Funi0350uni0351uni0352uni0353uni0354uni0355uni0356uni0357uni0358uni0359uni035Auni035Buni035Cuni035Duni035Euni035Funi0360uni0361uni0362uni0363uni0364uni0365uni0366uni0367uni0368uni0369uni036Auni036Buni036Cuni036Duni036Euni036Funi0374uni0375uni037Auni037Buni037Cuni037Duni037Etonos dieresistonos Alphatonos anoteleia EpsilontonosEtatonos Iotatonos Omicrontonos Upsilontonos OmegatonosiotadieresistonosAlphaBetaGammauni0394EpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilonPhiChiPsiuni03A9 IotadieresisUpsilondieresis alphatonos epsilontonosetatonos iotatonosupsilondieresistonosalphabetagammadeltaepsilonzetaetathetaiotakappalambdauni03BCnuxiomicronrhosigma1sigmatauupsilonphichipsiomega iotadieresisupsilondieresis omicrontonos upsilontonos omegatonosuni03D0theta1Upsilon1uni03D3uni03D4phi1omega1uni03D7uni03D8uni03D9uni03DAuni03DBuni03DCuni03DDuni03DEuni03DFuni03E0uni03E1uni03E2uni03E3uni03E4uni03E5uni03E6uni03E7uni03E8uni03E9uni03EAuni03EBuni03ECuni03EDuni03EEuni03EFuni03F0uni03F1uni03F2uni03F3uni03F4uni03F5uni03F6uni03F7uni03F8uni03F9uni03FAuni03FBuni03FCuni03FDuni03FEuni03FFuni0400uni0401uni0402uni0403uni0404uni0405uni0406uni0407uni0408uni0409uni040Auni040Buni040Cuni040Duni040Euni040Funi0410uni0411uni0412uni0413uni0414uni0415uni0416uni0417uni0418uni0419uni041Auni041Buni041Cuni041Duni041Euni041Funi0420uni0421uni0422uni0423uni0424uni0425uni0426uni0427uni0428uni0429uni042Auni042Buni042Cuni042Duni042Euni042Funi0430uni0431uni0432uni0433uni0434uni0435uni0436uni0437uni0438uni0439uni043Auni043Buni043Cuni043Duni043Euni043Funi0440uni0441uni0442uni0443uni0444uni0445uni0446uni0447uni0448uni0449uni044Auni044Buni044Cuni044Duni044Euni044Funi0450uni0451uni0452uni0453uni0454uni0455uni0456uni0457uni0458uni0459uni045Auni045Buni045Cuni045Duni045Euni045Funi0460uni0461uni0462uni0463uni0464uni0465uni0466uni0467uni0468uni0469uni046Auni046Buni046Cuni046Duni046Euni046Funi0470uni0471uni0472uni0473uni0474uni0475uni0476uni0477uni0478uni0479uni047Auni047Buni047Cuni047Duni047Euni047Funi0480uni0481uni0482uni0483uni0484uni0485uni0486uni0488uni0489uni048Auni048Buni048Cuni048Duni048Euni048Funi0490uni0491uni0492uni0493uni0494uni0495uni0496uni0497uni0498uni0499uni049Auni049Buni049Cuni049Duni049Euni049Funi04A0uni04A1uni04A2uni04A3uni04A4uni04A5uni04A6uni04A7uni04A8uni04A9uni04AAuni04ABuni04ACuni04ADuni04AEuni04AFuni04B0uni04B1uni04B2uni04B3uni04B4uni04B5uni04B6uni04B7uni04B8uni04B9uni04BAuni04BBuni04BCuni04BDuni04BEuni04BFuni04C0uni04C1uni04C2uni04C3uni04C4uni04C5uni04C6uni04C7uni04C8uni04C9uni04CAuni04CBuni04CCuni04CDuni04CEuni04CFuni04D0uni04D1uni04D2uni04D3uni04D4uni04D5uni04D6uni04D7uni04D8uni04D9uni04DAuni04DBuni04DCuni04DDuni04DEuni04DFuni04E0uni04E1uni04E2uni04E3uni04E4uni04E5uni04E6uni04E7uni04E8uni04E9uni04EAuni04EBuni04ECuni04EDuni04EEuni04EFuni04F0uni04F1uni04F2uni04F3uni04F4uni04F5uni04F6uni04F7uni04F8uni04F9uni04FAuni04FBuni04FCuni04FDuni04FEuni04FFuni0500uni0501uni0502uni0503uni0504uni0505uni0506uni0507uni0508uni0509uni050Auni050Buni050Cuni050Duni050Euni050Funi0510uni0511uni0512uni0513uni0E3Funi1D00uni1D01uni1D02uni1D03uni1D04uni1D05uni1D06uni1D07uni1D08uni1D09uni1D0Auni1D0Buni1D0Cuni1D0Duni1D0Euni1D0Funi1D10uni1D11uni1D12uni1D13uni1D14uni1D15uni1D16uni1D17uni1D18uni1D19uni1D1Auni1D1Buni1D1Cuni1D1Duni1D1Euni1D1Funi1D20uni1D21uni1D22uni1D23uni1D24uni1D25uni1D26uni1D27uni1D28uni1D29uni1D2Auni1D2Buni1D2Cuni1D2Duni1D2Euni1D2Funi1D30uni1D31uni1D32uni1D33uni1D34uni1D35uni1D36uni1D37uni1D38uni1D39uni1D3Auni1D3Buni1D3Cuni1D3Duni1D3Euni1D3Funi1D40uni1D41uni1D42uni1D43uni1D44uni1D45uni1D46uni1D47uni1D48uni1D49uni1D4Auni1D4Buni1D4Cuni1D4Duni1D4Euni1D4Funi1D50uni1D51uni1D52uni1D53uni1D54uni1D55uni1D56uni1D57uni1D58uni1D59uni1D5Auni1D5Buni1D5Cuni1D5Duni1D5Euni1D5Funi1D60uni1D61uni1D62uni1D63uni1D64uni1D65uni1D66uni1D67uni1D68uni1D69uni1D6Auni1D6Buni1D6Cuni1D6Duni1D6Euni1D6Funi1D70uni1D71uni1D72uni1D73uni1D74uni1D75uni1D76uni1D77uni1D78uni1D79uni1D7Auni1D7Buni1D7Cuni1D7Duni1D7Euni1D7Funi1D80uni1D81uni1D82uni1D83uni1D84uni1D85uni1D86uni1D87uni1D88uni1D89uni1D8Auni1D8Buni1D8Cuni1D8Duni1D8Euni1D8Funi1D90uni1D91uni1D92uni1D93uni1D94uni1D95uni1D96uni1D97uni1D98uni1D99uni1D9Auni1D9Buni1D9Cuni1D9Duni1D9Euni1D9Funi1DA0uni1DA1uni1DA2uni1DA3uni1DA4uni1DA5uni1DA6uni1DA7uni1DA8uni1DA9uni1DAAuni1DABuni1DACuni1DADuni1DAEuni1DAFuni1DB0uni1DB1uni1DB2uni1DB3uni1DB4uni1DB5uni1DB6uni1DB7uni1DB8uni1DB9uni1DBAuni1DBBuni1DBCuni1DBDuni1DBEuni1DBFuni1DC0uni1DC1uni1DC2uni1DC3uni1DC4uni1DC5uni1DC6uni1DC7uni1DC8uni1DC9uni1DCAuni1DFEuni1DFFuni1E00uni1E01uni1E02uni1E03uni1E04uni1E05uni1E06uni1E07uni1E08uni1E09uni1E0Auni1E0Buni1E0Cuni1E0Duni1E0Euni1E0Funi1E10uni1E11uni1E12uni1E13uni1E14uni1E15uni1E16uni1E17uni1E18uni1E19uni1E1Auni1E1Buni1E1Cuni1E1Duni1E1Euni1E1Funi1E20uni1E21uni1E22uni1E23uni1E24uni1E25uni1E26uni1E27uni1E28uni1E29uni1E2Auni1E2Buni1E2Cuni1E2Duni1E2Euni1E2Funi1E30uni1E31uni1E32uni1E33uni1E34uni1E35uni1E36uni1E37uni1E38uni1E39uni1E3Auni1E3Buni1E3Cuni1E3Duni1E3Euni1E3Funi1E40uni1E41uni1E42uni1E43uni1E44uni1E45uni1E46uni1E47uni1E48uni1E49uni1E4Auni1E4Buni1E4Cuni1E4Duni1E4Euni1E4Funi1E50uni1E51uni1E52uni1E53uni1E54uni1E55uni1E56uni1E57uni1E58uni1E59uni1E5Auni1E5Buni1E5Cuni1E5Duni1E5Euni1E5Funi1E60uni1E61uni1E62uni1E63uni1E64uni1E65uni1E66uni1E67uni1E68uni1E69uni1E6Auni1E6Buni1E6Cuni1E6Duni1E6Euni1E6Funi1E70uni1E71uni1E72uni1E73uni1E74uni1E75uni1E76uni1E77uni1E78uni1E79uni1E7Auni1E7Buni1E7Cuni1E7Duni1E7Euni1E7FWgravewgraveWacutewacute Wdieresis wdieresisuni1E86uni1E87uni1E88uni1E89uni1E8Auni1E8Buni1E8Cuni1E8Duni1E8Euni1E8Funi1E90uni1E91uni1E92uni1E93uni1E94uni1E95uni1E96uni1E97uni1E98uni1E99uni1E9Auni1E9Buni1E9Euni1EA0uni1EA1uni1EA2uni1EA3uni1EA4uni1EA5uni1EA6uni1EA7uni1EA8uni1EA9uni1EAAuni1EABuni1EACuni1EADuni1EAEuni1EAFuni1EB0uni1EB1uni1EB2uni1EB3uni1EB4uni1EB5uni1EB6uni1EB7uni1EB8uni1EB9uni1EBAuni1EBBuni1EBCuni1EBDuni1EBEuni1EBFuni1EC0uni1EC1uni1EC2uni1EC3uni1EC4uni1EC5uni1EC6uni1EC7uni1EC8uni1EC9uni1ECAuni1ECBuni1ECCuni1ECDuni1ECEuni1ECFuni1ED0uni1ED1uni1ED2uni1ED3uni1ED4uni1ED5uni1ED6uni1ED7uni1ED8uni1ED9uni1EDAuni1EDBuni1EDCuni1EDDuni1EDEuni1EDFuni1EE0uni1EE1uni1EE2uni1EE3uni1EE4uni1EE5uni1EE6uni1EE7uni1EE8uni1EE9uni1EEAuni1EEBuni1EECuni1EEDuni1EEEuni1EEFuni1EF0uni1EF1Ygraveygraveuni1EF4uni1EF5uni1EF6uni1EF7uni1EF8uni1EF9uni1F00uni1F01uni1F02uni1F03uni1F04uni1F05uni1F06uni1F07uni1F08uni1F09uni1F0Auni1F0Buni1F0Cuni1F0Duni1F0Euni1F0Funi1F10uni1F11uni1F12uni1F13uni1F14uni1F15uni1F18uni1F19uni1F1Auni1F1Buni1F1Cuni1F1Duni1F20uni1F21uni1F22uni1F23uni1F24uni1F25uni1F26uni1F27uni1F28uni1F29uni1F2Auni1F2Buni1F2Cuni1F2Duni1F2Euni1F2Funi1F30uni1F31uni1F32uni1F33uni1F34uni1F35uni1F36uni1F37uni1F38uni1F39uni1F3Auni1F3Buni1F3Cuni1F3Duni1F3Euni1F3Funi1F40uni1F41uni1F42uni1F43uni1F44uni1F45uni1F48uni1F49uni1F4Auni1F4Buni1F4Cuni1F4Duni1F50uni1F51uni1F52uni1F53uni1F54uni1F55uni1F56uni1F57uni1F59uni1F5Buni1F5Duni1F5Funi1F60uni1F61uni1F62uni1F63uni1F64uni1F65uni1F66uni1F67uni1F68uni1F69uni1F6Auni1F6Buni1F6Cuni1F6Duni1F6Euni1F6Funi1F70uni1F71uni1F72uni1F73uni1F74uni1F75uni1F76uni1F77uni1F78uni1F79uni1F7Auni1F7Buni1F7Cuni1F7Duni1F80uni1F81uni1F82uni1F83uni1F84uni1F85uni1F86uni1F87uni1F88uni1F89uni1F8Auni1F8Buni1F8Cuni1F8Duni1F8Euni1F8Funi1F90uni1F91uni1F92uni1F93uni1F94uni1F95uni1F96uni1F97uni1F98uni1F99uni1F9Auni1F9Buni1F9Cuni1F9Duni1F9Euni1F9Funi1FA0uni1FA1uni1FA2uni1FA3uni1FA4uni1FA5uni1FA6uni1FA7uni1FA8uni1FA9uni1FAAuni1FABuni1FACuni1FADuni1FAEuni1FAFuni1FB0uni1FB1uni1FB2uni1FB3uni1FB4uni1FB6uni1FB7uni1FB8uni1FB9uni1FBAuni1FBBuni1FBCuni1FBDuni1FBFuni1FC0uni1FC1uni1FC2uni1FC3uni1FC4uni1FC6uni1FC7uni1FC8uni1FC9uni1FCAuni1FCBuni1FCCuni1FCDuni1FCEuni1FCFuni1FD0uni1FD1uni1FD2uni1FD3uni1FD6uni1FD7uni1FD8uni1FD9uni1FDAuni1FDBuni1FDDuni1FDEuni1FDFuni1FE0uni1FE1uni1FE2uni1FE3uni1FE4uni1FE5uni1FE6uni1FE7uni1FE8uni1FE9uni1FEAuni1FEBuni1FECuni1FEDuni1FEEuni1FEFuni1FF2uni1FF3uni1FF4uni1FF6uni1FF7uni1FF8uni1FF9uni1FFAuni1FFBuni1FFCuni1FFDuni1FFEuni2000uni2001uni2002uni2003uni2004uni2005uni2006uni2007uni2008uni2009uni200Auni200Buni200Cuni200Duni200Euni200F figuredashuni2015uni2016 underscoredbl quotereverseduni201Funi202Funi2031seconduni2034 exclamdbluni203Duni203Euni2043uni205Euni205Funi2070uni2071uni2074uni2075uni2076uni2077uni2078uni2079uni207Auni207Buni207Cuni207Duni207Euni207Funi2080uni2081uni2082uni2083uni2084uni2085uni2086uni2087uni2088uni2089uni208Auni208Buni208Cuni208Duni208Euni2090uni2091uni2092uni2093uni2094uni20A0 colonmonetaryuni20A2lirauni20A5uni20A6pesetauni20A8uni20A9uni20AAdongEurouni20ADuni20AEuni20AFuni20B0uni20B1uni20B2uni20B3uni20B4uni20B5uni20B8uni20B9uni20BAuni20DDuni2105uni2113uni2116uni2117 estimateduni2132uni214Duni214Eonethird twothirdsuni2155uni2156uni2157uni2158uni2159uni215A oneeighth threeeighths fiveeighths seveneighthsuni2183uni2184 arrowleftarrowup arrowright arrowdown arrowboth arrowupdn arrowupdnbseuni2215 orthogonal intersection equivalencehouse revlogicalnot integraltp integralbtuni2460uni2461uni2462uni2463uni2464uni2465uni2466uni2467uni2468uni2469uni246Auni246Buni246Cuni246Duni246Euni246Funi2470uni2471uni2472uni2473uni24EAuni24EBuni24ECuni24EDuni24EEuni24EFuni24F0uni24F1uni24F2uni24F3uni24F4uni24FFSF100000SF110000SF010000SF030000SF020000SF040000SF080000SF090000SF060000SF070000SF050000SF430000SF240000SF510000SF520000SF390000SF220000SF210000SF250000SF500000SF490000SF380000SF280000SF270000SF260000SF360000SF370000SF420000SF190000SF200000SF230000SF470000SF480000SF410000SF450000SF460000SF400000SF540000SF530000SF440000upblockdnblockblocklfblockrtblockltshadeshadedkshade filledboxH22073H18543H18551 filledrecttriagupuni25B4uni25B8triagrttriagdnuni25BEuni25C2triaglfcircleuni25CCH18533 invbullet invcircle openbullet smileface invsmilefacesunfemalemalespadeclubheartdiamond musicalnotemusicalnotedbluni2736uni2776uni2777uni2778uni2779uni277Auni277Buni277Cuni277Duni277Euni277Funi2C60uni2C61uni2C62uni2C63uni2C64uni2C65uni2C66uni2C67uni2C68uni2C69uni2C6Auni2C6Buni2C6Cuni2C74uni2C75uni2C76uni2C77uni2E17uniA717uniA718uniA719uniA71AuniA720uniA721 TypoStyleuniFB01uniFB02uniFE20uniFE21uniFE22uniFE23uniFEFFf.ss04f.ss05i.ss05 igrave.ss05 iacute.ss05icircumflex.ss05 itilde.ss05idieresis.ss05 imacron.ss05 ibreve.ss05 iogonek.ss05 dotlessi.ss05_277_278_279_280_281_282_283_284_285_286_287_288_289l.ss05 lacute.ss05 lcaron.ss05 uni013C.ss05 lslash.ss05 ldot.ss05_296_297_298_299_300_301r.ss04 racute.ss04 rcaron.ss04 uni0157.ss04r.ss05 racute.ss05 rcaron.ss05 uni0157.ss05_310_311_312_313ampersand.ss05_317_319 uni0302.ccmp uni030C.ccmptildecomb.ccmp uni0308.ccmp uni0304.ccmp uni0306.ccmp uni030A.ccmp_335 uni030B.ccmp uni0307.ccmp_344 hyphen.caseexclamdown.casequestiondown.caseguilsinglleft.caseguilsinglright.caseguillemotleft.caseguillemotright.case endash.case emdash.caseperiodcentered.caseparenleft.caseparenright.casebracketleft.casebracketright.casebraceleft.casebraceright.case beta.ss03 theta.ss03phi.ss03_473anoteleia.case uni0431.locl breve.locl breve.ccmpat.case dollar.onum zero.ss08 zero.ss07 zero.onumzero.onum_ss08zero.onum_ss07one.onumtwo.onum three.onum four.onum five.onumsix.onum seven.onum eight.onum nine.onum uni2070.fraconesuperior.fractwosuperior.fracthreesuperior.frac uni2074.frac uni2075.frac uni2076.frac uni2077.frac uni2078.frac uni2079.frac_708hookabovecomb.ccmp_711_712_713_714_715_716_717_718_719_720_721_722_723_724_725_726_852Eng.ss01Eng.ss02Eng.ss03 iogonek.ccmpA.supsB.supsC.supsD.supsE.supsF.supsG.supsH.supsI.supsJ.supsK.supsL.supsM.supsN.supsO.supsP.supsQ.supsR.supsS.supsT.supsU.supsV.supsW.supsX.supsY.supsZ.sups uni0305.ccmp uni030D.ccmp uni030E.ccmp uni030F.ccmp uni0310.ccmp uni0311.ccmp_966_967 uni0313.ccmp uni0314.ccmp uni031A.ccmp uni0334.ccmp uni0335.ccmp uni0336.ccmp uni0337.ccmp uni0338.ccmp uni033D.ccmp uni033E.ccmp uni033F.ccmp uni0340.ccmp uni0341.ccmp uni0346.ccmp uni034A.ccmp uni034B.ccmp uni034C.ccmp uni0350.ccmp uni0351.ccmp uni0352.ccmp uni0357.ccmp uni0358.ccmp uni035B.ccmp uni035D.ccmp uni035E.ccmp uni0360.ccmp uni0361.ccmp uni0363.ccmp uni0364.ccmp uni0365.ccmp uni0366.ccmp uni0367.ccmp uni0368.ccmp uni0369.ccmp uni036A.ccmp uni036B.ccmp uni036C.ccmp uni036D.ccmp uni036E.ccmp uni036F.ccmp uni1DC0.ccmp uni1DC1.ccmp uni1DC4.ccmp uni1DC5.ccmp uni1DC6.ccmp uni1DC7.ccmp uni1DC8.ccmp uni1DC9.ccmp uni1DFE.ccmp_1301 uni019A.ss05_1307 uni01D0.ss05_1326_1344 uni0209.ss05_1354 uni020B.ss05_1357 uni0211.ss04_1362_1363 uni0213.ss04_1366_1367_1393 uni0249.ccmp_1395 uni024D.ss04_1399_1400 uni1E1F.ss04_1426 uni1E2D.ss05_1435 uni1E2D.ccmpuni1E2D.ccmp_ss05_1438 uni1E37.ss05_1445 uni1E39.ss05_1448 uni1E3B.ss05_1451 uni1E3D.ss05_1454 uni1E59.ss04 uni1E59.ss05_1471 uni1E5B.ss04 uni1E5B.ss05_1475 uni1E5D.ss04 uni1E5D.ss05_1479 uni1E5F.ss04 uni1E5F.ss05_1483 uni2C61.ss05_1516 uni0268.ss05_1553 uni0268.ccmpuni0268.ccmp_ss05_1556_1829_1830uni02E5_uni02E5_uni02E6uni02E5_uni02E5_uni02E7uni02E5_uni02E5_uni02E8uni02E5_uni02E5_uni02E9uni02E5_uni02E6uni02E5_uni02E6_uni02E5uni02E5_uni02E6_uni02E6uni02E5_uni02E6_uni02E7uni02E5_uni02E6_uni02E8uni02E5_uni02E6_uni02E9uni02E5_uni02E7uni02E5_uni02E7_uni02E5uni02E5_uni02E7_uni02E6uni02E5_uni02E7_uni02E7uni02E5_uni02E7_uni02E8uni02E5_uni02E7_uni02E9uni02E5_uni02E8uni02E5_uni02E8_uni02E5uni02E5_uni02E8_uni02E6uni02E5_uni02E8_uni02E7uni02E5_uni02E8_uni02E8uni02E5_uni02E8_uni02E9uni02E5_uni02E9uni02E5_uni02E9_uni02E5uni02E5_uni02E9_uni02E6uni02E5_uni02E9_uni02E7uni02E5_uni02E9_uni02E8uni02E5_uni02E9_uni02E9uni02E6_uni02E5uni02E6_uni02E5_uni02E5uni02E6_uni02E5_uni02E6uni02E6_uni02E5_uni02E7uni02E6_uni02E5_uni02E8uni02E6_uni02E5_uni02E9uni02E6_uni02E6_uni02E5uni02E6_uni02E6_uni02E7uni02E6_uni02E6_uni02E8uni02E6_uni02E6_uni02E9uni02E6_uni02E7uni02E6_uni02E7_uni02E5uni02E6_uni02E7_uni02E6uni02E6_uni02E7_uni02E7uni02E6_uni02E7_uni02E8uni02E6_uni02E7_uni02E9uni02E6_uni02E8uni02E6_uni02E8_uni02E5uni02E6_uni02E8_uni02E6uni02E6_uni02E8_uni02E7uni02E6_uni02E8_uni02E8uni02E6_uni02E8_uni02E9uni02E6_uni02E9uni02E6_uni02E9_uni02E5uni02E6_uni02E9_uni02E6uni02E6_uni02E9_uni02E7uni02E6_uni02E9_uni02E8uni02E6_uni02E9_uni02E9uni02E7_uni02E5uni02E7_uni02E5_uni02E5uni02E7_uni02E5_uni02E6uni02E7_uni02E5_uni02E7uni02E7_uni02E5_uni02E8uni02E7_uni02E5_uni02E9uni02E7_uni02E6uni02E7_uni02E6_uni02E5uni02E7_uni02E6_uni02E6uni02E7_uni02E6_uni02E7uni02E7_uni02E6_uni02E8uni02E7_uni02E6_uni02E9uni02E7_uni02E7_uni02E5uni02E7_uni02E7_uni02E6uni02E7_uni02E7_uni02E8uni02E7_uni02E7_uni02E9uni02E7_uni02E8uni02E7_uni02E8_uni02E5uni02E7_uni02E8_uni02E6uni02E7_uni02E8_uni02E7uni02E7_uni02E8_uni02E8uni02E7_uni02E8_uni02E9uni02E7_uni02E9uni02E7_uni02E9_uni02E5uni02E7_uni02E9_uni02E6uni02E7_uni02E9_uni02E7uni02E7_uni02E9_uni02E8uni02E7_uni02E9_uni02E9uni02E8_uni02E5uni02E8_uni02E5_uni02E5uni02E8_uni02E5_uni02E6uni02E8_uni02E5_uni02E7uni02E8_uni02E5_uni02E8uni02E8_uni02E5_uni02E9uni02E8_uni02E6uni02E8_uni02E6_uni02E5uni02E8_uni02E6_uni02E6uni02E8_uni02E6_uni02E7uni02E8_uni02E6_uni02E8uni02E8_uni02E6_uni02E9uni02E8_uni02E7uni02E8_uni02E7_uni02E5uni02E8_uni02E7_uni02E6uni02E8_uni02E7_uni02E7uni02E8_uni02E7_uni02E8uni02E8_uni02E7_uni02E9uni02E8_uni02E8_uni02E5uni02E8_uni02E8_uni02E6uni02E8_uni02E8_uni02E7uni02E8_uni02E8_uni02E9uni02E8_uni02E9uni02E8_uni02E9_uni02E5uni02E8_uni02E9_uni02E6uni02E8_uni02E9_uni02E7uni02E8_uni02E9_uni02E8uni02E8_uni02E9_uni02E9uni02E9_uni02E5uni02E9_uni02E5_uni02E5uni02E9_uni02E5_uni02E6uni02E9_uni02E5_uni02E7uni02E9_uni02E5_uni02E8uni02E9_uni02E5_uni02E9uni02E9_uni02E6uni02E9_uni02E6_uni02E5uni02E9_uni02E6_uni02E6uni02E9_uni02E6_uni02E7uni02E9_uni02E6_uni02E8uni02E9_uni02E6_uni02E9uni02E9_uni02E7uni02E9_uni02E7_uni02E5uni02E9_uni02E7_uni02E6uni02E9_uni02E7_uni02E7uni02E9_uni02E7_uni02E8uni02E9_uni02E7_uni02E9uni02E9_uni02E8uni02E9_uni02E8_uni02E5uni02E9_uni02E8_uni02E6uni02E9_uni02E8_uni02E7uni02E9_uni02E8_uni02E8uni02E9_uni02E8_uni02E9uni02E9_uni02E9_uni02E5uni02E9_uni02E9_uni02E6uni02E9_uni02E9_uni02E7uni02E9_uni02E9_uni02E8 uni0313.locluni0313.locl_ccmp uni0314.locluni0314.locl_ccmpacutecomb.loclacutecomb.ccmpgravecomb.loclgravecomb.ccmp uni0342.ccmpuni0313.locl_acutecomb.locluni0313.locl_acutecomb_ccmpuni0313.locl_gravecomb.locluni0313.locl_gravecomb_ccmpuni0313.locl_uni0342uni0313.locl_uni0342_ccmpuni0314.locl_acutecomb.locluni0314.locl_acutecomb_ccmpuni0314.locl_gravecomb.locluni0314.locl_gravecomb_ccmpuni0314.locl_uni0342uni0314.locl_uni0342_ccmpuni0308_acutecomb.locluni0308_acutecomb.ccmpuni0308_gravecomb.locluni0308_gravecomb.ccmpuni0308_uni0342uni0308_uni0342.ccmp_2070_2071 uni0343.ccmpuni0304_uni0313.locl_acutecomb.uni0304_uni0313.locl_gravecomb.uni0304_uni0314.locl_acutecomb.uni0304_uni0314.locl_gravecomb.uni0306_uni0313.locl_acutecomb.uni0306_uni0313.locl_gravecomb.uni0306_uni0314.locl_acutecomb.uni0306_uni0314.locl_gravecomb.uni0308_uni0304_acutecomb.locluni0308_uni0304_gravecomb.locluni0308_uni0306_acutecomb.locluni0308_uni0306_gravecomb.locl uni0345.ccmp_2357_2358_2360figuredash.case_2514 uni0484.ccmp uni0485.ccmp uni0486.ccmp_2570_2571_2637_2638_2639_2640_2641_2642_2643_2644_2645_2646_2647_2648_2649_2650_2651_2652_2653_2654_2655_2656_2657_2658_2659_2660_2661_2662_2663_2664_2665_2666_2667_2668_2669_2670_2671_2672_2673_2674_2675_2676_2677_2678_2679_2680_2681 uni1ECB.ss05_2693 uni1ECB.ccmpuni1ECB.ccmp_ss05_2696iogonek.ccmp_ss05_2698_30_31_7  080 ./01456778ABDENOQR^_`a   ) * H I S T X Y [ \ ] ^   G H O P q r w x | }  pcyrlgrekzlatn SRB 8   IPPHFROM XTRK     caltcaseccmpccmpdligdnomfracloclloclloclloclnumronumordn saltsaltsalt sinf(ss01.ss024ss03@^`blw{9~I8:=>12=>\]ghT 88:;==?? 12=@!gj%IT88:?&,08@ 'H/2P=@TKNXZ^\gja88:?AZ!$%&'()*+-08>FNTX`h 'p/3x=A}KNZ^gk88:?&,08@ 'H/2P=@TKNXZ^\gja88:?AZ!$%&'()*+-08>FNTX`h 'p/3x=A}KNZ^gk88:?&,08@ 'H/2P=@TKNXZ^\gja88:?AZ!$%&'()*+-08>FNTX`h 'p/3x=A}KNZ^gk88:?&,08@ 'H/2P=@TKNXZ^\gja88:?AZ!$%&'()*+-08>FNTX`h 'p/3x=A}KNZ^gkeAEGIOTXAAAAAAAAEEEEEEGGGGGGGGIIIIIIIIOOOOOOTTTTXXXXXXXX33333333AAAAAAAAkkkkkkkkAAAAEEGGIIIITTTTQOOXX88:?&,08@ 'H/2P=@TKNXZ^\gja rsy*  rsy             rsy.0Z76_a`l " i J N h J L g H N f H L " m J N l J L k H N j H L (06< q N p L o N n L a _ N ] LD6BaClQ6OaPl U S N Q L [ Y N W Li5m H J a    "#$%&'()*+,-.234    " $ & ( O H J L N Q S U W Y [ ] _ a {X$%&'()*+,-./0123456789:;<=EGIKNO   $&(*,.024689;=?8:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZacegjmuw  "=~     ! # % ' ) I J K L M N P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  I K M O P R T V X Z \ ^ ` b e r x y z |a I  J K L M N Q R S T U V W X Y Z [ \ ] P e r ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x x y z y z { | } ~      ! # % ' ) P I K M O R T V X Z \ ^ ` b |a    "#$%&'()*+,-.234    " $ & ( O H J L N Q S U W Y [ ] _ a { L(Wa    "#$%&'()*+,-.234    " $ & ( O H J L N Q S U W Y [ ] _ a { . L(WM a    "#$%&'()*+,-.234    " $ & ( O H J L N Q S U W Y [ ] _ a {  M j"4FX:BJRZbjrz                            :BJRZbjrz                            :BJRZbjrz                            :BJRZbjrz + * ) ( ' % $ # " !                 & :BJRZbjrz G F E D C B A @ ? = < ; : 9 7 6 5 4 3 1 0 / . - 2 8 > ,  yrs       8      <~"&,2:BFJRX\`dhlpv|                               < ILMOUZ  (>TZaguW  . !  >TZ"  agu#    IU Z* * ILOUZ(W . D4nrvz~  $(,048<@                           4 ILMOUZ  (W .        > / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H ^  bprswx}yrs  $=DKMN&PS(UU,WZ-\]13  4  5al N L H JCt OLI0 ^  bprswx}DKMNPS UUWZ\]"# `cyrlgrek(latn6 SRB IPPHROM TRK markmkmk$   (08@HPX`hXQRVjx, zH*GNH  &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv|     $ * 0 6 < B H N T Z ` f l r x ~ !!!!!! !&!,!2!8!>!D!J!P!V!\!b!h!n!t!z!!!!!!!!!!!!!!!!!!!!!!"" """"""("."4":"@"F"L"R"X"^"d"j"p"v"|"""""""""""""""""""""### ####$#*#0#6#<#B#H#N#T#Z#`#f#l#r#x#~#####################$$$$$$ $&$,$2$8$>$D$J$P$V$\$b$h$n$t$z$$$$$$$$$$$$$$$$$$$$$$%% %%%%"%(%.%4%:%@%F%L%R%X%^%d%j%p%v%|%%%%%%%%%%%%%%%%%%%%%&&& &&&&$&*&0&6&<&B&H&N&T&Z&`&f&l&r&x&~&&&&&&&&&&&&&&&&&&&&&'''''' '&','2'8'>'D'J'P'V'\'b'h'n't'z''''''''''''''''''''''(( (((("(((.(4(:(@(F(L(R(X(^(d(j(p(v(|((((((((((((((((((((())) ))))$)*)0)6)<)B)H)N)T)Z)`)f)l)r)x)~)))))))))))))))))))))****** *&*,*2*8*>*D*J*P*V*\*b*h*n*t*z**********************++ ++++"+(+.+4+:+@+F+L+R+X+^+d+j+p+v+|+++++++++++++++++++++,,, ,,,,$,*,0,6,<,B,H,N,T,Z,`,f,l,r,x,~,,,,,,,,,,,,,,,,,,,,,------ -&-,-2-8->-D-J-P-V-\-b-h-n-t-z----------------------.. ....".(...4.:.@.F.L.R.X.^.d.j.p.v.|...................../// ////$/*/0/6/0D0J0P0V0\0b0h0n0t0z000000000000000000000011 1111"1(1.141:1@1F1L1R1X1^1d1j1p1v1|111111111111111111111222 2222$2*20262<2B2H2N2T2Z2`2f2l2r2x2~222222222222222222222333333 3&3,32383>3D3J3P3V3\3b3h3n3t3z333333333333333333333344 4444"4(4.444:4@4F4L4R4X4^4d4j4p4v4|444444444444444444444555 5555$5*50565<5B5H5N5T5Z5`5f5l5r5x5~555555555555555555555666666 6&6,62686>6D6J6P6V6\6b6h6n6t6z666666666666666666666677 7777"7(7.747:7@7F7L7R7X7^7d7j7p7v7|777777777777777777777888 8888$8*80868<8B8H8N8T8Z8`8f8l8r8x8~888888888888888888888999999 9&9,92989>9D9J9P9V9\9b9h9n9t9z9999999999999999999999:: ::::":(:.:4:::@:F:L:R:X:^:d:j:p:v:|:::::::::::::::::::::;;; ;;;;$;*;0;6;<;B;H;N;T;Z;`;f;l;r;x;~;;;;;;;;;;;;;;;;;;;;;<<<<<< <&<,<2<8<>>> >>>>$>*>0>6><>B>H>N>T>Z>`>f>l>r>x>~>>>>>>>>>>>>>>>>>>>>>?????? ?&?,?2?8?>?D?J?P?V?\?b?h?n?t?z??????????????????????@@ @@@@"@(@.@4@:@@@F@L@R@X@^@d@j@p@v@|@@@@@@@@@@@@@@@@@@@@@AAA AAAA$A*A0A6ABDBJBPBVB\BbBhBnBtBzBBBBBBBBBBBBBBBBBBBBBBCC CCCC"C(C.C4C:C@CFCLCRCXC^CdCjCpCvC|CCCCCCCCCCCCCCCCCCCCCDDD DDDD$D*D0D6DEDEJEPEVE\EbEhEnEtEzEEEEEEEEEEEEEEEEEEEEEEFF FFFF"F(F.F4F:F@FFFLFRFXF^FdFjFpFvF|FFFFFFFFFFFFFFFFFFFFFGGG GGGG$G*G0G6G<3n3L3n3LonoL n L3n3L3n3Lo&noL3*n3L3n3L3n3L35n3L3n3L35n3L3"n3L3n3L3n3L3n3  n3L3n3L3Bn3L3,n3L3n3L3kn3L3bn3L3n3L3(n3L33L3x3LooL33L33LML3F33x3L3 3L33'x3L33L3>3L33L33L33 33 33L33Lx3L33L3O3L3t3L3=3L3O3 33L33L33L33L33L33L3&&3LnLono33L33L33L33L33L33L33L33L3n3L323L3/3L3q3L3/3L3q3L3q3L3LoL333L3<3L33L3<3L33L3u3L33L33L33L33L33L33L3773L3Y3Loo33L323L33L323L3 3L33L33L33L303L3 3L3 3L3L3L33L33L33L3333L3 3L33L3 3L3_3 33 3O3 33L33L33L33L3n3%33%o%oLo#oLooL[oLooL[oLo%oLooL  L33L3n3L33L33L323L33L323L33L323L3n3%33%33L323LooL3V3o6oL3V3o6oL3F3o&no 3333L3Ix3L3uu3L33L33L33L33L33L33L33L3n3%3 3%33L3 3L3u:u3L3>33o3L3335n3 3'x3 38F3L33L33L3n3 33 3!3L33L3n3LLGnGL33L323L3 3L3"n3 33 323L3 3Lq3L3"n3333q3L33L3q3L33L33L33LnL3R3L 3L3J3L n3 33  3L33L3'3L33L33L33L3n3333'3L33L33L_3L3Ru3L3L3<3L3 3L3<3L3 3L33L3 3L3&&3L3773L33L33L3,n3%33%3{{3L33L3f3L3O3 33L383L33L3(3L33L383L33LH3L33L3uu3L3uu3L33L3u 3L3u3L3 3L`L L3uu3LouuoL3u u3L33L33L3uu3L3-3L33L3uuQJDQ`L3uu3L&LrL3uu3L3{1{3L33L3 3L3E3L3uNu3L3u2u3 3 353L33L3 3LoBoLoDoL3u%u3L33 3uu33n3L33L3u8u3L^MM33uRu3L33L3uRu333L   L3v}v3L3<3L3}3L33(n3L33L3n3LonoL3uu3L33L3s \\L\\LppLRu+nLKvKzulnDL|b|b33L33L33L33L3/3L3 3L3<3L3 3L33LL3N3Lo&noL3F3[6oL3F313Le3L3n3%33%3/3%33%33L33c3\nn\L\2x\LppLo6oL3V3|OnL3{{s 323L33L33L33L33L33L33L33L33L33L33L33L33L33L3/3L3 3L3/3L3 3L 3L3J3L33L3J3L3<3L3 3L3<3L3 3L3Bn3 x3 3u3L33c3&3L3 3L33 33 3u3L3 3L3(n3#3333L33L3n33333L33L33L3_3 33 33 3 F33x3L3*3 33oo333n3L3(333333L33L33L33L3x3L3T3L3T33333L33L33LNL33L33L  L33L3333 333L3F_33;3L3 3 3x3L3x33 3L L33L33L33L330+c3N3L3N3 3>333333 3L33LoMoL3W3L33 3L3L33 333L33L33L35 L33...k. 33Lx33 3L3S3L33L33L3B3L3E3L3d3L33#3333c33 3LL)3Loo33L3F3L3T3L3L3 3L3 33  ) L3 3LLHpHLgcb!-Lb-L-L;L3uu3L3WW3L3!3 3!33F3LoFoL33L33L33L33L33L33L33L3G33L3U3L33L3w3L33L3`X3L X L3i63L3si3L3\'3L33L33L3i3L3i3L33L33L3oL313L33L34t43L34t43L3[3L3_3L33L33L  LGGL33L33L353L33L33L3A3L33L33L3 3L]L33L33L33 3J3L3G3L33Lx3L33L3V33PP3L3F33L3c3L3c3L33 33L33L3x333M3F33'x3333>33333 3333 Q3O33=3333333 333` X33X3333 333.#3333#3n33333Lox3L3n33x33n33x333L3L n333 n333 n 33 n3M33M3n3M3QM3n3M33M33L]]]Lo&oL3V33*3Lyx3L3*n33x33:3L3%%3L3*n33x33*n3M3x3M3n3M3 3M3'3L3i3L35n33'x335n33'x33no3G3o3iG3no3G3neM3G3w{3L3N3L353L3>3L35n33>33"3L33L3"n3333"n3333"n3M33M3:3L3<3 33L33 33L33L n333 n33333L33L3n3333f3L3w3L33L33L33333B3L3L3Bn3x33Bn3x33Bn3Mx3M3,n3p33p3,n3M33M3,n3M33M33L3_3L3n33O33{{3L33L3{{3L33L3{{3L33L3k3L3t3L3kn33t33b3L3=3L33L3k3L33L3O3 33L33L3(n3333(n3333x33#3L373L37_3 3773LkH3L3n3333O3L3*3L3n3333O3L3*3L33L33L33L3E3L3n33 33n3333O3L3 *3L3,n3333,O3L3 *3L3f3L33 3n33O3333L3_*3 33L3_3 3 3%33 3M3 3L3 33 33 33 33 33 33 3$$=D]4K!j$x|})+,=>Vn~o.\KS]aq *,/DIT[ps~ . .    #. 5B".N14[_lu  )w I S Y [ ^ g l P q x |v| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz3333 333v3@333Z3Z3333%393333Q33333)3333333333333333333393C3M33%33C333333333C3333333@333C3 3 33 3 33 3333333E3Q333*3*333333C3j3333333N333333333333333333 333333%333Q 3333333~3333M333333333333333S3S3333l3434343434343434343434343f3f3f3fGfGf333%333333333f3f3f3f33333s" 6<BHNTZ`flrx~33333333333333333333333333 <$33 b &,28>DJPV\bhntz "(.4:@FLRX^djpv| RpRR\ >@p>4H\R\W\D>DHff\ pffRHHHHHHWWWWDDDDffffffffffDWHf\ Hp>fDRffg$=D]4;CHNOPQRUVWY$$Z(([**\56]IJ_LLa^0j/0z      $ * 0 6 < B H N T Z ` f l r x ~      & , 2 8 > D J P V \ b h n t z  "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz     " ( . 4 : @ F L R X ^ d j p v | !!! !!!!$!*!0!6!"D"J"P"V"\"b"h"n"t"z""""""""""""""""""""""## ####"#(#.#4#:#@#F#L#R#X#^#d#j#p#v#|#####################$$$ $$$$$$*$0$6$<$B$H$N$T$Z$`$f$l$r$x$~$$$$$$$$$$$$$$$$$$$$$%%%%%% %&%,%2%8%>%D%J%P%V%\%b%h%n%t%z%%%%%%%%%%%%%%%%%%%%%%&& &&&&"&(&.&4&:&@&F&L&R&X&^&d&j&p&v&|&&&&&&&&&&&&&&&&&&&&&''' ''''$'*'0'6'<'B'H'N'T'Z'`'f'l'r'x'~'''''''''''''''''''''(((((( (&(,(2(8(>(D(J(P(V(\(b(h(n(t(z(((((((((((((((((((((()) ))))")().)4):)@)F)L)R)X)^)d)j)p)v)|)))))))))))))))))))))*** ****$***0*6*<*B*H*N*T*Z*`*f*l*r*x*~*********************++++++ +&+,+2+8+>+D+J+P+V+\+b+h+n+t+z++++++++++++++++++++++,, ,,,,",(,.,4,:,@,F,L,R,X,^,d,j,p,v,|,,,,,,,,,,,,,,,,,,,,,--- ----$-*-0-6-<-B-H-N-T-Z-`-f-l-r-x-~---------------------...... .&.,.2.8.>.D.J.P.V.\.b.h.n.t.z......................// ////"/(/./4/:/@/F/L/R/X/^/d/j/p/v/|ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffflfflfflfflfflfflfffffflfflfflfflfflfflfflfflfffflfflfflfflfflfflfffflfflfflfflfflfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffflfffflfffffffflfffflfffflfffflfffflfflfffffflfffflfffflfffffffflfffflfffflfffflfffffffflfflfffffflfffflfffflfffffffflfffffffflfffffffffflfflfffffflfflfffffffffflfffffffflfffffffffflfffflfffflfffffffflfffffffflfffflfffflfffffffflfffflfflfffffflfffflfffflfffflfffflfffffffflfffflfffflfflfffflfffflfffffffffffffffffffflfffffffffffffffffffffffflfffffffffffffffffffffffffflfffffffffffffffffffffffffffffflfffffffffffffffffffffffffflfffffffffffffffffflfffflfffflfffflfffffflfffffffflfffflfflfffffflfffflfffffffffffflfffffffflfffflfffflfffflfffflfffflfffflfffflfffflfffflfffflfffflfffflfffffffffffflfflfffffffffffffflfffffffflfffflfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffflfffffffffffflfffffffffffffffffffffffffffflfflfflfffflfffffffflfflfffffffffffffflfflfffffffffffffflfflfffffffffflfffflfffffffflfffffffffffffffflfffflfffflfffffffffffflfffffffflfflfflfflfflfffflfffffffffffffffffffffffffffflfffffffflfffflfffflfffflfffffffflfffflfffflfffflfffffffffffffflfffffffflfffffflfffffffflfffflfffflfffffffffffflfffffffflfffflfffffffflfffflfffLfLfLfffffffffffffffff$$=D]4K!j$x|})+,=>Vn~o.\KS]aq *,/DIT[ps~ . .    ! h k .4:@FLRX^dj333N333333O3w3N H "(.4:@FLRX^djpv| $*06<XHHHH@ppH  Hp  HRX  HpH pzpHppp   zzzp p zz $=D]4679;<()>X[@psDfl "FLRX^djpv| 33333333333p33333"3333333"$&(*,./125678DFHJLNOQRUVWXX  "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz     " ( . 4 : @ F L R X ^ d j p v |     $ * 0 6 < B H N T Z ` f l r x ~      & , 2 8 > D J P V \ b h n t z     " ( . 4 : @ F L R X ^ d j p v |     $ * 0 6 < B H N T Z ` f l r x ~  &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz:f@z&vDbDl  l pp6 Np^ffffzzzz:D    ^f^    :R:ff f f *f fzzzz&lpR6f6vvvD D pD^DlllD  :Dv\68pfRzf{ f\ppHD ZI D^3 f 2  p2zzzblCpf f zz66ffbfpk fD^ppppl\3p pD*ppbp2pNpzfbfpf>p`pDf\\8p6f0p6RpTpTpp,ppDLpbYzpfzf>3\ 4pjpffdwXfp:g#>ppD d dH#NpE@:zlp p66  p pvX pR*pp`p`p~pptpppplII:IIUPIIII@Il]]]III p p6IvIIvvIID IIII33IIbNIIppppID^ p^fIf f z?IDIID^I^D^D^lIIIII$$=D]4K!j$x|})+,=>Vn~o.\KS]aq *,/DIT[ps~ . .    b0j/0t      $ * 0 6 < B H N T Z ` f l r x ~      & , 2 8 > D J P V \ b h n t z  "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz     " ( . 4 : @ F L R X ^ d j p v | !!! !!!!$!*!0!6!"D"J"P"V"\"b"h"n"t"z""""""""""""""""""""""## ####"#(#.#4#:#@#F#L#R#X#^#d#j#p#v#|#####################$$$ $$$$$$*$0$6$<$B$H$N$T$Z$`$f$l$r$x$~$$$$$$$$$$$$$$$$$$$$$%%%%%% %&%,%2%8%>%D%J%P%V%\%b%h%n%t%z%%%%%%%%%%%%%%%%%%%%%%&& &&&&"&(&.&4&:&@&F&L&R&X&^&d&j&p&v&|&&&&&&&&&&&&&&&&&&&&&''' ''''$'*'0'6'<'B'H'N'T'Z'`'f'l'r'x'~'''''''''''''''''''''(((((( (&(,(2(8(>(D(J(P(V(\(b(h(n(t(z(((((((((((((((((((((()) ))))")().)4):)@)F)L)R)X)^)d)j)p)v)|)))))))))))))))))))))*** ****$***0*6*<*B*H*N*T*Z*`*f*l*r*x*~*********************++++++ +&+,+2+8+>+D+J+P+V+\+b+h+n+t+z++++++++++++++++++++++,, ,,,,",(,.,4,:,@,F,L,R,X,^,d,j,p,v,|,,,,,,,,,,,,,,,,,,,,,--- ----$-*-0-6-<-B-H-N-T-Z-`-f-l-r-x-~---------------------...... .&.,.2.8.>.D.J.P.V.\.b.h.n.t.z......................// ////"/(/./4/:/@/F/L/R/X/^/d/j/p/v/|ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff$$=D]4K!j$x|})+,=>Vn~o.\KS]aq *,/DIT[ps~ . .    $j jV V @.M14mq~  ) I [ ^ P q x | v \bhntz "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^dj33333333733333'3333363.333333^3 3:333733w3w3Q3w3n3u3>3>3w3w33n3n3333333M^^3(3(3:j3333333&33J3]3J3]333333333?33333333333l3l3l333333q333k33D331313 313(3,33313133(3(33333y333333=3=33333=3=3333GG3333f3f3f3f3f3f3f3f33363633I3I33  !"".#14046=>G  )I I RZ Y [d ^ eg g go l p P q x |  !"".#14046=>G  )I I RZ Y [d ^ eg g go l p P q x | "(.4:@FLRX^djpv| $*06<BHNTZ`flrx~ &,28>DJPV\bhntz "(.4:@FLRX^djpv|3333 333v3@333Z3Z3333%39393C3M33%33C3333C333@3C3 3 33 3 33 3333333E3Q333*3*3333Cj3333333N333333333333333333 333333%3333333333~3333M333333333333333S3S3333l3434343434343434343434343f3f3f3fGfGf333%333333333f3f3f3f33333sf +X^djpv| $*06<BHNT3p3p3333333d33p33 33d3w3p3p3p3p3p33 333d33w33333333333333     "&()*     "&()*+ &,28>DJPV\bhntz333333333)333333333333333333333333333333333W?6vl:libgdiplus-6.0.4+dfsg/tests/testgraphicsdraw.c0000644000175000017500000141411213542674535022224 0ustar directhexdirecthex#ifdef WIN32 #ifndef __cplusplus #error Please compile with a C++ compiler. #endif #endif #if defined(USE_WINDOWS_GDIPLUS) #include #include #pragma comment(lib, "gdiplus.lib") #else #include #endif #if defined(USE_WINDOWS_GDIPLUS) using namespace Gdiplus; using namespace DllExports; #endif #include #include #include #include "testhelpers.h" static void createImageGraphics (INT width, INT height, GpImage **image, GpGraphics **graphics) { GpStatus status; status = GdipCreateBitmapFromScan0 (width, height, 0, PixelFormat32bppARGB, NULL, (GpBitmap **) image); assertEqualInt (status, Ok); status = GdipGetImageGraphicsContext (*image, graphics); assertEqualInt (status, Ok); } static void test_drawArc () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive -> large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 90, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, 0, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArc (graphics, pen, 5, 5, 100, 100, -90, -700); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawArc (NULL, pen, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (NULL, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, NULL, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, 0, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, -1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, 1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, -1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArc (graphics, pen, 0, 0, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawArc (graphics, pen, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, NULL, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 0, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, -1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 1, 0, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 1, -1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArc (graphics, pen, 0, 0, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawArcI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive -> large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 90, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, 0, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawArcI (graphics, pen, 5, 5, 100, 100, -90, -700); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawArcI (NULL, pen, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (NULL, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, NULL, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, 0, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, -1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, 1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, -1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawArcI (graphics, pen, 0, 0, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawArcI (graphics, pen, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, NULL, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 0, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, -1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 1, 0, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 1, -1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawArcI (graphics, pen, 0, 0, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawBezier () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Normal. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBezier (graphics, pen, 10, 20, 40, 30, 60, 50, 80, 70); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Straight line. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBezier (graphics, pen, 10, 20, 30, 40, 50, 60, 70, 80); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBezier (graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawBezier (NULL, pen, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBezier (graphics, NULL, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawBezier (graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawBezier (graphics, NULL, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawBezierI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Normal. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBezierI (graphics, pen, 10, 20, 40, 30, 60, 50, 80, 70); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Straight line. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBezierI (graphics, pen, 10, 20, 30, 40, 50, 60, 70, 80); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBezierI (graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawBezierI (NULL, pen, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBezierI (graphics, NULL, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawBezierI (graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawBezierI (graphics, NULL, 0, 0, 0, 0, 0, 0, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawBeziers () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPointF normal7[] = { {10, 20}, {40, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Straight line (4). GpPointF straight4[] = { {10, 20}, {30, 40}, {50, 60}, {70, 80} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, straight4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, normal7, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, normal7, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziers (graphics, pen, normal7, 1); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawBeziers (NULL, pen, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (NULL, pen, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (NULL, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (NULL, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (NULL, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (NULL, pen, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, normal7, 8); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, normal7, 6); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, normal7, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawBeziers (graphics, pen, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziers (graphics, pen, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziers (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziers (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziers (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziers (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziers (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawBeziersI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPoint normal7[] = { {10, 20}, {40, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, {200, 130} }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Straight line (4). GpPoint straight4[] = { {10, 20}, {30, 40}, {50, 60}, {70, 80} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, straight4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, normal7, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, normal7, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (1). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawBeziersI (graphics, pen, normal7, 1); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawBeziersI (NULL, pen, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (NULL, pen, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (NULL, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (NULL, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (NULL, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (NULL, pen, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, normal7, 8); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, normal7, 6); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, normal7, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawBeziersI (graphics, pen, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziersI (graphics, pen, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziersI (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziersI (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziersI (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawBeziersI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawBeziersI (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawCurve () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, normal7, 6); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, normal7, 5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, normal7, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve (graphics, pen, normal7, 2); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawCurve (NULL, pen, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (NULL, pen, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (NULL, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (NULL, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (NULL, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (NULL, pen, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawCurve (graphics, pen, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve (graphics, pen, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawCurveI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, normal7, 6); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, normal7, 5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, normal7, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurveI (graphics, pen, normal7, 2); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawCurveI (NULL, pen, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (NULL, pen, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (NULL, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (NULL, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (NULL, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (NULL, pen, normal7, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawCurveI (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, NULL, normal7, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurveI (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurveI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawCurveI (graphics, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, normal7, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawCurveI (graphics, pen, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawCurveI (graphics, pen, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawCurveI (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawCurveI (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawCurveI (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawCurveI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, NULL, normal7, -1); assertEqualInt (status, OutOfMemory); // FIXME: this causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurveI (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurveI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawCurveI (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawCurveI (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurveI (graphics, pen, normal7, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); } static void test_drawCurve2 () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 7, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 7, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 7, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 7, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 7, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 6, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 6, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 6, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 6, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 6, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 5, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 5, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 5, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 5, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 5, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, zero4, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, zero4, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, zero4, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, zero4, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, zero4, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 3, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 3, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 3, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 2, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 2, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2 (graphics, pen, normal7, 2, -10); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawCurve2 (NULL, pen, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (NULL, pen, normal7, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, NULL, normal7, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, -1, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawCurve2 (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, NULL, normal7, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, NULL, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2 (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2 (graphics, pen, normal7, -1, 0); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawCurve2I () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 7, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 7, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 7, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 7, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 7, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 6, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 6, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 6, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 6, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 6, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 5, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 5, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 5, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 5, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 5, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, zero4, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, zero4, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, zero4, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, zero4, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, zero4, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 3, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 3, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 3, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 2, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 2, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve2I (graphics, pen, normal7, 2, -10); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawCurve2I (NULL, pen, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (NULL, pen, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (NULL, pen, normal7, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, NULL, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, NULL, normal7, -1, 0); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurve2I (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 1, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurve2I (graphics, pen, NULL, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, pen, NULL, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, pen, normal7, -1, 0); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawCurve2I (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, NULL, normal7, 4, 0); assertEqualInt (status, ObjectBusy); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurve2I (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurve2I (graphics, pen, NULL, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, NULL, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, pen, NULL, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve2I (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve2I (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve2I (graphics, pen, normal7, -1, 0); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawCurve3 () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 7, 0, 6, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 7, 1, 5, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 7, 2, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 7, 1, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 7, 5, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 6, 0, 5, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 6, 1, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 6, 2, 3, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 6, 1, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 6, 4, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 5, 0, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 5, 1, 3, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 5, 2, 2, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 5, 1, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 5, 3, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 1, 2, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 2, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 1, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 2, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, zero4, 4, 0, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, zero4, 4, 1, 2, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, zero4, 4, 2, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, zero4, 4, 1, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, zero4, 4, 2, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 0, 2, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 1, 1, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 0, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 0, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 0, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, -10); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawCurve3 (NULL, pen, normal7, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 3, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 3, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 2, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 2, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, -1, 0, -2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (NULL, pen, normal7, -1, 0, -2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 3, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 3, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 2, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 2, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, -1, 0, -2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, -1, 0, -2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 4, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 4, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 2, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 2, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 3, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 3, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 2, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 2, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, -1, 0, -2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, -1, 0, -2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 4, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 4, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 2, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 2, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, -1, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, -1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 1, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, -1, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, -1, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, -1, -2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, -1, -2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, -1, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, -1, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, -1, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, -1, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 4, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 4, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 2, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 2, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 2, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 2, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 1, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 1, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 1, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 1, 1, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 0, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 3, 0, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 2, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, -1, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, -1, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 4, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 4, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, -1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, -1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 0, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 2, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, NULL, normal7, 4, 2, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 4, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 4, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 2, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, NULL, 4, 2, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, -1, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 1, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, -1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, -1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 1, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, -1, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, -1, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 1, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 1, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, -1, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, -1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 1, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, -1, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3 (graphics, pen, normal7, 4, -1, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, -1, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 4, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 4, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, -1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, -1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 0, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 1, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 1, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 2, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3 (graphics, pen, normal7, 4, 2, 2, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawCurve3I () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 7, 0, 6, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 7, 1, 5, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 7, 2, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 7, 1, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 7, 5, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 6, 0, 5, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 6, 1, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 6, 2, 3, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 6, 1, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 6, 4, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 5, 0, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 5, 1, 3, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 5, 2, 2, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 5, 1, 2, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 5, 3, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 1, 2, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 2, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 1, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 2, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, zero4, 4, 0, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, zero4, 4, 1, 2, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, zero4, 4, 2, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, zero4, 4, 1, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, zero4, 4, 2, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 0, 2, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 1, 1, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 0, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 0, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 0, 1, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (2) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, -10); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawCurve3I (NULL, pen, normal7, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 3, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 3, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 2, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 2, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (NULL, pen, normal7, -1, 0, -2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (NULL, pen, normal7, -1, 0, -2, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 3, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 3, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 2, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 2, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, -1, 0, -2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, NULL, normal7, -1, 0, -2, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 4, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 4, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 2, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 2, 2, 0); assertEqualInt (status, InvalidParameter); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 3, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 3, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 2, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 2, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurve3I (graphics, pen, NULL, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, -1, 0, -2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, NULL, -1, 0, -2, 0); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurve3I (graphics, pen, NULL, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 4, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 4, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 2, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 2, 2, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, -1, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, -1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 1, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, -1, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, -1, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, -1, -2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, -1, -2, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -2, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, -1, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, -1, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, -1, 1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, -1, 1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 4, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 4, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 2, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 2, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 2, 0, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 2, 0, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 0, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 0, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 2, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 1, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 1, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 1, 1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 1, 1, 0); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 0, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 3, 0, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 2, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, -1, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, -1, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 4, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 4, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, -1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, -1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 0, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 2, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, NULL, normal7, 4, 2, 2, 0); assertEqualInt (status, ObjectBusy); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, -1, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, -1, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 4, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 4, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 0, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 2, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, NULL, 4, 2, 2, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, -1, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 1, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, -1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, -1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 1, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, -1, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, -1, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 1, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 1, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -2, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -2, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, -1, 0, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, -1, 0, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 1, 0, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 1, 0, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 0, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 0, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, -1, 0, 1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawCurve3I (graphics, pen, normal7, 4, -1, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, -1, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 4, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 4, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, -1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, -1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 0, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 0, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 1, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 1, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 2, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawCurve3I (graphics, pen, normal7, 4, 2, 2, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawClosedCurve () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve (graphics, pen, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve (graphics, pen, normal7, 6); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve (graphics, pen, normal7, 5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve (graphics, pen, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve (graphics, pen, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve (graphics, pen, normal7, 3); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawClosedCurve (NULL, pen, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (NULL, pen, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (NULL, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (NULL, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (NULL, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (NULL, pen, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawClosedCurve (graphics, pen, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve (graphics, pen, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, NULL, normal7, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve (graphics, pen, normal7, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawClosedCurveI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurveI (graphics, pen, normal7, 7); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurveI (graphics, pen, normal7, 6); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurveI (graphics, pen, normal7, 5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurveI (graphics, pen, normal7, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4). GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurveI (graphics, pen, zero4, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3). createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurveI (graphics, pen, normal7, 3); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawClosedCurveI (NULL, pen, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (NULL, pen, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (NULL, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (NULL, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (NULL, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (NULL, pen, normal7, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, NULL, normal7, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawClosedCurveI (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawClosedCurveI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurveI (graphics, pen, normal7, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, normal7, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, normal7, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawClosedCurveI (graphics, pen, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, pen, normal7, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, NULL, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, NULL, normal7, -1); assertEqualInt (status, OutOfMemory); // FIXME: this causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawClosedCurveI (graphics, pen, NULL, 4); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawClosedCurveI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurveI (graphics, pen, normal7, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, pen, normal7, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurveI (graphics, pen, normal7, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurveI (graphics, pen, normal7, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawClosedCurve2 () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPointF normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 7, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 7, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 7, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 7, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 7, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 6, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 6, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 6, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 6, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 6, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 5, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 5, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 5, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 5, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 5, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPointF zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, zero4, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, zero4, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, zero4, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, zero4, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, zero4, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, -10); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawClosedCurve2 (NULL, pen, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (NULL, pen, normal7, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, -1, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, NULL, normal7, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, NULL, -1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2 (graphics, pen, normal7, -1, 0); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawClosedCurve2I () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GpPoint normal7[] = { {10, 20}, {60, 30}, {60, 50}, {80, 70}, {100, 90}, {150, 110}, {200, 130}, }; // Normal (7) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 7, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 7, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 7, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 7, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (7) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 7, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 6, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 6, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 6, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 6, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (6) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 6, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 5, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 5, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 5, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 5, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (5) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 5, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Normal (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - large tension. GpPoint zero4[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, zero4, 4, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, zero4, 4, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, zero4, 4, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, zero4, 4, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // All zero (4) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, zero4, 4, -10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - large tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, 10); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - one tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - normal tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - zero tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Small (3) - negative tension. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, -10); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawClosedCurve2I (NULL, pen, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (NULL, pen, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (NULL, pen, normal7, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, -1, 0); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawClosedCurve2I (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 3, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 3, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 1, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawClosedCurve2I (graphics, pen, NULL, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, pen, NULL, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 2, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, pen, normal7, -1, 0); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 4, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 3, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 4, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, NULL, normal7, 4, 0); assertEqualInt (status, ObjectBusy); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawClosedCurve2I (graphics, pen, NULL, 4, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 4, 0); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawClosedCurve2I (graphics, pen, NULL, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, NULL, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, pen, NULL, -1, 0); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 2, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 2, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 1, 0.5); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 0, 0.5); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawClosedCurve2I (graphics, pen, normal7, -1, 0.5); assertEqualInt (status, OutOfMemory); status = GdipDrawClosedCurve2I (graphics, pen, normal7, -1, 0); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawEllipse () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, 100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, 100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, 100, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, 0, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, 0, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, -100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, -100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipse (graphics, pen, 5, 5, -100, -100); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawEllipse (NULL, pen, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawEllipse (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawEllipse (graphics, pen, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawEllipse (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawEllipseI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, 100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, 100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, 100, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, 0, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, 0, -100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, -100, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, -100, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative, Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawEllipseI (graphics, pen, 5, 5, -100, -100); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawEllipseI (NULL, pen, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawEllipseI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawEllipseI (graphics, pen, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawEllipseI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } const WCHAR bitmapFile[] = {'t', 'e', 's', 't', '.', 'b', 'm', 'p', 0}; #define GDIPLUS_MAXFLOAT 0x40000040 #define GDIPLUS_MINFLOAT -GDIPLUS_MAXFLOAT // GDI+ float conversion differs from libgdiplus. #if defined(USE_WINDOWS_GDIPLUS) #define GDIPLUS_MAXINT 0x4000007F #define GDIPLUS_MININT -0x40000000 #else #define GDIPLUS_MAXINT GDIPLUS_MAXFLOAT #define GDIPLUS_MININT -GDIPLUS_MAXFLOAT #endif static void test_drawImage () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImage (graphics, bitmapImage, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImage (graphics, bitmapImage, 10, 20); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImage (graphics, bitmapImage, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImage (graphics, bitmapImage, -10, -20); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImage (graphics, bitmapImage, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawImage (NULL, bitmapImage, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (NULL, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (NULL, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1)); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1)); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (graphics, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (graphics, NULL, (REAL)(GDIPLUS_MAXFLOAT + 1), 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (graphics, NULL, (REAL)(GDIPLUS_MINFLOAT - 1), 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (graphics, NULL, 0, (REAL)(GDIPLUS_MAXFLOAT + 1)); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (graphics, NULL, 0, (REAL)(GDIPLUS_MINFLOAT - 1)); assertEqualInt (status, InvalidParameter); status = GdipDrawImage (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImage (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImage (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1)); assertEqualInt (status, ValueOverflow); status = GdipDrawImage (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1)); assertEqualInt (status, ValueOverflow); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImage (graphics, bitmapImage, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImage (graphics, NULL, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImage (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImage (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImage (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1)); assertEqualInt (status, ObjectBusy); status = GdipDrawImage (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImageI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageI (graphics, bitmapImage, GDIPLUS_MAXINT, GDIPLUS_MAXINT); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageI (graphics, bitmapImage, 10, 20); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageI (graphics, bitmapImage, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageI (graphics, bitmapImage, -1, -1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageI (graphics, bitmapImage, GDIPLUS_MININT, GDIPLUS_MININT); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawImageI (NULL, bitmapImage, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (NULL, bitmapImage, GDIPLUS_MAXINT + 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (NULL, bitmapImage, GDIPLUS_MININT - 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (NULL, bitmapImage, 0, GDIPLUS_MAXINT + 1); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (NULL, bitmapImage, 0, GDIPLUS_MININT - 1); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (graphics, NULL, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (graphics, NULL, GDIPLUS_MAXINT + 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (graphics, NULL, GDIPLUS_MININT - 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (graphics, NULL, 0, GDIPLUS_MAXINT + 1); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (graphics, NULL, 0, GDIPLUS_MININT - 1); assertEqualInt (status, InvalidParameter); status = GdipDrawImageI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1); assertEqualInt (status, ValueOverflow); status = GdipDrawImageI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1); assertEqualInt (status, ValueOverflow); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImageI (graphics, bitmapImage, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageI (graphics, NULL, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1); assertEqualInt (status, ObjectBusy); status = GdipDrawImageI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImageRect () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, 10, 20, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, -10, -20, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, 75, 100, 0, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, 75, 100, -150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, 75, 100, 150, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRect (graphics, bitmapImage, 75, 100, 150, -100); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawImageRect (NULL, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, 0, 0, 0, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, 0, 0, 150, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (NULL, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (graphics, NULL, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (graphics, NULL, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (graphics, NULL, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (graphics, NULL, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0); assertEqualInt (status, ValueOverflow); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImageRect (graphics, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, NULL, 0, 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, NULL, 0, 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, NULL, 0, 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImageRectI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT, GDIPLUS_MAXINT, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, 10, 20, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, -10, -20, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT, GDIPLUS_MININT, 150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, 75, 100, 0, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, 75, 100, -150, 100); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, 75, 100, 150, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectI (graphics, bitmapImage, 75, 100, 150, -100); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawImageRectI (NULL, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, 0, 0, 0, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, 0, 0, 150, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, GDIPLUS_MAXINT + 10, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, GDIPLUS_MININT - 10, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, 0, GDIPLUS_MAXINT + 1, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, 0, GDIPLUS_MININT - 1, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (NULL, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (graphics, NULL, GDIPLUS_MAXINT + 1, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (graphics, NULL, GDIPLUS_MININT - 1, 0, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (graphics, NULL, 0, GDIPLUS_MAXINT + 1, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (graphics, NULL, 0, GDIPLUS_MININT - 1, 150, 100); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 150, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 150, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 150, 0); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 150, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 100); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 150, 0); assertEqualInt (status, ValueOverflow); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImageRectI (graphics, bitmapImage, 0, 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, NULL, 0, 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, NULL, 0, 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, NULL, 0, 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 150, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 150, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 100); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 150, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImagePoints () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; PointF points[] = { {10, 20}, {160, 10}, {50, 120}, {100, 150} }; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePoints (graphics, bitmapImage, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. PointF zeroPoints[] = { {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePoints (graphics, bitmapImage, zeroPoints, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. PointF negativePoints[] = { {100, 50}, {10, 50}, {10, 150} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePoints (graphics, bitmapImage, negativePoints, 3); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawImagePoints (NULL, bitmapImage, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (NULL, bitmapImage, points, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (NULL, bitmapImage, points, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (NULL, bitmapImage, points, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (NULL, bitmapImage, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (NULL, bitmapImage, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, points, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, points, 4); assertEqualInt (status, NotImplemented); status = GdipDrawImagePoints (graphics, bitmapImage, points, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, points, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImagePoints (graphics, bitmapImage, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, NULL, points, 5); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, NULL, points, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, NULL, points, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, points, 5); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, bitmapImage, points, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, bitmapImage, points, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePoints (graphics, bitmapImage, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePoints (graphics, bitmapImage, points, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImagePointsI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; Point points[] = { {10, 20}, {160, 10}, {50, 120}, {100, 150}, {100, 150} }; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Point zeroPoints[] = { {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsI (graphics, bitmapImage, zeroPoints, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. Point negativePoints[] = { {100, 50}, {10, 50}, {10, 150} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsI (graphics, bitmapImage, negativePoints, 3); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawImagePointsI (NULL, bitmapImage, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (NULL, bitmapImage, points, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (NULL, bitmapImage, points, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (NULL, bitmapImage, points, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (NULL, bitmapImage, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (NULL, bitmapImage, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 4); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, points, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, NULL, points, 5); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, NULL, points, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, NULL, points, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 5); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 4); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 2); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 5); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 4); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 2); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsI (graphics, bitmapImage, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsI (graphics, bitmapImage, points, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImagePointRect () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 10, 20, 50, 20, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, -10, -20, -30, -40, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative source origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 0, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, -150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 150, 0, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 150, -100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitPoint. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitPoint); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitInch. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitInch); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitDocument. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitDocument); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitMillimeter. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRect (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitMillimeter); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif // Negative tests. status = GdipDrawImagePointRect (NULL, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, 0, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, 0, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (NULL, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, NULL, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, NULL, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, NULL, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, NULL, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, NULL, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 150, 100, UnitPixel); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 150, 100, UnitPixel); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 150, 100, UnitPixel); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitWorld); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitDisplay); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, NULL, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, NULL, 0, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, NULL, 0, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 0,100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0,100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitWorld); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitDisplay); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRect (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImagePointRectI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT, GDIPLUS_MAXINT, GDIPLUS_MAXINT, GDIPLUS_MAXINT, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 10, 20, 50, 20, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, -10, -20, -30, -40, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT, GDIPLUS_MININT, GDIPLUS_MININT, GDIPLUS_MININT, 150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 0, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, -150, 100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 150, 0, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 150, -100, UnitPixel); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitPoint. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitPoint); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitInch. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitInch); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitDocument. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitDocument); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitMillimeter. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointRectI (graphics, bitmapImage, 75, 100, 50, 20, 150, 100, UnitMillimeter); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif // Negative tests. status = GdipDrawImagePointRectI (NULL, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, 0, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, 0, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (NULL, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, NULL, GDIPLUS_MAXINT + 1, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, NULL, GDIPLUS_MININT - 1, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, NULL, 0, GDIPLUS_MAXINT + 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, NULL, 0, GDIPLUS_MININT - 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 150, 100, UnitPixel); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 150, 100, UnitPixel); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 150, 100, UnitPixel); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, Ok); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MAXINT + 1, 0, 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MAXINT + 1, 0, 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MININT - 1, 0, 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MININT - 1, 0, 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MAXINT + 1, 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MAXINT + 1, 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MININT - 1, 0, 100, UnitPixel); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MININT - 1, 150, 0, UnitPixel); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitWorld); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitDisplay); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1)); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, NULL, 0, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, NULL, 0, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, NULL, 0, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 0,100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MAXINT + 1, 0, 0,100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MAXINT + 1, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MININT - 1, 0, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, GDIPLUS_MININT - 1, 0, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MAXINT + 1, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MAXINT + 1, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MININT - 1, 0, 100, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, GDIPLUS_MININT - 1, 150, 0, UnitPixel); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitWorld); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, UnitDisplay); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointRectI (graphics, bitmapImage, 0, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1)); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImageRectRect () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, 200, 125, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 10, 20, 200, 125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, -10, -20, 200, 125, -30, -40, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, 200, 125, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero destination width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 0, 125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative destination width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, -200, 125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero destination height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 0, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative destination height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, -125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero source width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative source width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, -150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero source height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative source height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, -100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitPoint. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitPoint, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitInch. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitInch, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitDocument. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitDocument, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitMillimeter. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRect (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitMillimeter, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif // Negative tests. status = GdipDrawImageRectRect (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, NULL, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 0, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 0, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 0, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 0, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 0,100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0,100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 200, 125, 0, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRect (graphics, bitmapImage, 0, 200, 125, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImageRectRectI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT, GDIPLUS_MAXINT, 200, 125, GDIPLUS_MAXINT, GDIPLUS_MAXINT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 10, 20, 200, 125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, -10, -20, 200, 125, -30, -40, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT, GDIPLUS_MININT, 200, 125, GDIPLUS_MININT, GDIPLUS_MININT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero destination width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 0, 125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative destination width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, -200, 125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero destination height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 0, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative destination height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, -125, 50, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero source width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative source width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, -150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero source height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative source height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, -100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitPoint. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitPoint, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitInch. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitInch, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitDocument. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitDocument, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitMillimeter. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImageRectRectI (graphics, bitmapImage, 75, 100, 200, 125, 50, 20, 150, 100, UnitMillimeter, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif // Negative tests. status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, GDIPLUS_MINFLOAT - 1, 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (NULL, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, NULL, 0, GDIPLUS_MININT - 1, 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 0, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 0, 125, GDIPLUS_MAXINT + 1, 0, 100, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 0, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MAXINT + 1, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MAXINT + 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MININT - 1, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 0, 125, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 0, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MININT - 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 0, 125, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 0, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MAXINT + 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MAXINT + 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 0, 125, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 0, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MININT - 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MININT - 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, NULL, 0, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 0,100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MAXINT + 1, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, GDIPLUS_MININT - 1, 0, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MAXINT + 1, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 125, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 125, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, GDIPLUS_MININT - 1, 200, 125, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MAXINT + 1, 0, 0,100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MAXINT + 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MININT - 1, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, GDIPLUS_MININT - 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MAXINT + 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MAXINT + 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MININT - 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, GDIPLUS_MININT - 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 0, 200, 125, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 200, 125, 0, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImageRectRectI (graphics, bitmapImage, 0, 200, 125, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImagePointsRect () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; PointF points[] = { {10, 20}, {160, 10}, {50, 120}, {100, 150} }; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 10, 10, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. PointF zeroPoints[] = { {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, zeroPoints, 3, 10, 10, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. PointF negativePoints[] = { {100, 50}, {10, 50}, {10, 150} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, negativePoints, 3, 10, 10, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL) GDIPLUS_MAXFLOAT, (REAL) GDIPLUS_MAXFLOAT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 10, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, -20, -30, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative source origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL) GDIPLUS_MINFLOAT, (REAL) GDIPLUS_MINFLOAT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, -150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, -100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitPoint. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitPoint, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitInch. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitInch, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitDocument. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitDocument, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitMillimeter. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitMillimeter, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif // Negative tests. status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (NULL, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, NULL, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, NULL, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, NULL, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, NULL, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, NULL, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 5, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 4, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 2, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, -1, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 0, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 0,100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MAXFLOAT + 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, (REAL)(GDIPLUS_MINFLOAT - 1), 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRect (graphics, bitmapImage, points, 3, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawImagePointsRectI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpImage *bitmapImage; Point points[] = { {10, 20}, {160, 10}, {50, 120}, {100, 150}, {100, 150} }; GdipLoadImageFromFile (bitmapFile, &bitmapImage); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 10, 10, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Point zeroPoints[] = { {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, zeroPoints, 3, 10, 10, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. Point negativePoints[] = { {100, 50}, {10, 50}, {10, 150} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, negativePoints, 3, 10, 10, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // Max Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT, GDIPLUS_MAXINT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 10, 20, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, -20, -30, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Max Negative source origin. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT, GDIPLUS_MININT, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative width. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, -150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative height. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, -100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitPoint. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitPoint, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitInch. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitInch, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitDocument. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitDocument, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif GdipDeleteGraphics (graphics); GdipDisposeImage (image); // UnitMillimeter. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitMillimeter, NULL, NULL, NULL); // FIXME: not implemented in libgdiplus: https://github.com/mono/libgdiplus/issues/428 #if defined(USE_WINDOWS_GDIPLUS) assertEqualInt (status, Ok); #endif // Negative tests. status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (NULL, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, NotImplemented); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, Ok); // FIXME: libgdiplus does not validate this: https://github.com/mono/libgdiplus/issues/429 #if defined(USE_WINDOWS_GDIPLUS) status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ValueOverflow); #endif status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, NULL, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, NULL, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, NULL, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, NULL, points, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, NULL, 3, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 5, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 4, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 2, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, -1, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 0, 0, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, InvalidParameter); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 0,100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MAXINT + 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, GDIPLUS_MININT - 1, 0, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MAXINT + 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 150, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 0, 100, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, GDIPLUS_MININT - 1, 150, 0, UnitPixel, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitWorld, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, UnitDisplay, NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); status = GdipDrawImagePointsRectI (graphics, bitmapImage, points, 3, 0, 0, 150, 100, (Unit) (UnitMillimeter + 1), NULL, NULL, NULL); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDisposeImage (bitmapImage); } static void test_drawLine () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLine (graphics, pen, 10, 20, 30, 40); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLine (graphics, pen, 0, 0, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLine (graphics, pen, 10, 20, -10, -20); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawLine (NULL, pen, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLine (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawLine (graphics, pen, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawLine (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawLineI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLineI (graphics, pen, 10, 20, 30, 40); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLineI (graphics, pen, 0, 0, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLineI (graphics, pen, 10, 20, -10, -20); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawLineI (NULL, pen, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLineI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawLineI (graphics, pen, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawLineI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawLines () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; PointF points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLines (graphics, pen, points, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLines (graphics, pen, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLines (graphics, pen, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. PointF zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLines (graphics, pen, zeroPoints, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawLines (NULL, pen, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (NULL, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (NULL, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (NULL, pen, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, NULL, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, points, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawLines (graphics, pen, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawLines (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawLines (graphics, NULL, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawLines (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawLines (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLines (graphics, pen, points, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawLinesI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; Point points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLinesI (graphics, pen, points, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLinesI (graphics, pen, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLinesI (graphics, pen, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Point zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawLinesI (graphics, pen, zeroPoints, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawLinesI (NULL, pen, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (NULL, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (NULL, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (NULL, pen, points, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawLinesI (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, NULL, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, NULL, points, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawLinesI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawLinesI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawLinesI (graphics, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, points, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawLinesI (graphics, pen, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawLinesI (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawLinesI (graphics, NULL, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawLinesI (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, NULL, points, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawLinesI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawLinesI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawLinesI (graphics, pen, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawLinesI (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawLinesI (graphics, pen, points, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawPath () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GpPath *emptyPath; GpPath *onePath; GpPath *twoPath; GpPath *threePath; GpPath *multiPath; GpPath *intersectPath; GpPath *alternatePath; GpPath *windingPath; GpPath *invalidPath; PointF points[] = { {1, 2}, {4, 2}, {4, 6}, }; BYTE types[] = { PathPointTypeStart, PathPointTypeLine, PathPointTypeLine }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); GdipCreatePath (FillModeWinding, &emptyPath); GdipCreatePath2 (points, types, 1, FillModeAlternate, &onePath); GdipCreatePath2 (points, types, 2, FillModeAlternate, &twoPath); GdipCreatePath2 (points, types, 3, FillModeAlternate, &threePath); GdipCreatePath (FillModeWinding, &multiPath); GdipAddPathRectangle (multiPath, 10, 20, 30, 40); GdipAddPathRectangle (multiPath, 60, 70, 80, 90); GdipCreatePath (FillModeWinding, &intersectPath); GdipAddPathRectangle (intersectPath, 10, 20, 30, 40); GdipAddPathRectangle (intersectPath, 20, 30, 40, 50); GdipCreatePath (FillModeAlternate, &alternatePath); GdipAddPathRectangle (alternatePath, 10, 20, 30, 40); GdipCreatePath (FillModeWinding, &windingPath); GdipAddPathRectangle (windingPath, 10, 20, 30, 40); GdipCreatePath ((FillMode) (FillModeWinding + 1), &invalidPath); GdipAddPathRectangle (invalidPath, 10, 20, 30, 40); // FillModeAlternate. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, alternatePath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // FillModeWinding. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, windingPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Invalid FillMode. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, invalidPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Empty path. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, emptyPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One path. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, onePath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two path. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, twoPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three path. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, threePath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Multi path. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, multiPath); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Intersect path. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPath (graphics, pen, intersectPath); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawPath (NULL, pen, windingPath); assertEqualInt (status, InvalidParameter); status = GdipDrawPath (graphics, NULL, windingPath); assertEqualInt (status, InvalidParameter); status = GdipDrawPath (graphics, pen, NULL); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawPath (graphics, NULL, windingPath); assertEqualInt (status, ObjectBusy); status = GdipDrawPath (graphics, pen, NULL); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePath (emptyPath); GdipDeletePath (onePath); GdipDeletePath (twoPath); GdipDeletePath (threePath); GdipDeletePath (multiPath); GdipDeletePath (intersectPath); GdipDeletePath (alternatePath); GdipDeletePath (windingPath); GdipDeletePath (invalidPath); GdipDeletePen (pen); } static void test_drawPie () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive -> large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 90, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, 0, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPie (graphics, pen, 5, 5, 100, 100, -90, -700); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawPie (NULL, pen, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (NULL, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, NULL, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, 0, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, -1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, 1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, -1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPie (graphics, pen, 0, 0, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawPie (graphics, pen, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, NULL, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 0, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, -1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 1, 0, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 1, -1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPie (graphics, pen, 0, 0, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawPieI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive -> large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Positive -> Negative large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 90, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, 0, -700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, 700); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, 360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, 135); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, -90); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative 360. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, -360); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative -> Negative Large. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPieI (graphics, pen, 5, 5, 100, 100, -90, -700); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawPieI (NULL, pen, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (NULL, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, NULL, 0, 0, 1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, 0, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, -1, 1, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, 1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, -1, 0, 0, 135); assertEqualInt (status, InvalidParameter); status = GdipDrawPieI (graphics, pen, 0, 0, -1, 0, 0, 0); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawPieI (graphics, pen, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, NULL, 0, 0, 1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, NULL, 0, 0, 1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 0, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 0, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, -1, 1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, -1, 1, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 1, 0, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 1, 0, 0, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 1, -1, 0, 360); assertEqualInt (status, ObjectBusy); status = GdipDrawPieI (graphics, pen, 0, 0, 1, -1, 0, 0); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawPolygon () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; PointF points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygon (graphics, pen, points, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygon (graphics, pen, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygon (graphics, pen, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. PointF zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygon (graphics, pen, zeroPoints, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawPolygon (NULL, pen, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (NULL, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (NULL, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (NULL, pen, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, NULL, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, points, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawPolygon (graphics, pen, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygon (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygon (graphics, NULL, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygon (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, NULL, points, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygon (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygon (graphics, pen, points, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawPolygonI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; Point points[] = { {10, 20}, {30, 40}, {100, 150}, {200, 200} }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygonI (graphics, pen, points, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygonI (graphics, pen, points, 3); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygonI (graphics, pen, points, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Point zeroPoints[] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawPolygonI (graphics, pen, zeroPoints, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawPolygonI (NULL, pen, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (NULL, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (NULL, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (NULL, pen, points, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawPolygonI (graphics, NULL, points, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, NULL, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, NULL, points, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawPolygonI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawPolygonI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawPolygonI (graphics, pen, points, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, points, -1); assertEqualInt (status, OutOfMemory); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawPolygonI (graphics, pen, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygonI (graphics, NULL, points, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygonI (graphics, NULL, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygonI (graphics, NULL, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, NULL, points, -1); assertEqualInt (status, OutOfMemory); // This causes GDI+ to crash. #if !defined(USE_WINDOWS_GDIPLUS) status = GdipDrawPolygonI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); #endif status = GdipDrawPolygonI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, NULL, -1); assertEqualInt (status, OutOfMemory); status = GdipDrawPolygonI (graphics, pen, points, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawPolygonI (graphics, pen, points, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawPolygonI (graphics, pen, points, -1); assertEqualInt (status, OutOfMemory); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawRectangle () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangle (graphics, pen, 10, 20, 30, 40); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangle (graphics, pen, 0, 0, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangle (graphics, pen, 10, 20, -10, -20); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawRectangle (NULL, pen, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangle (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangle (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangle (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangle (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangle (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawRectangle (graphics, pen, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, pen, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, pen, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawRectangleI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Positive. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangleI (graphics, pen, 10, 20, 30, 40); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangleI (graphics, pen, 0, 0, 0, 0); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Negative. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangleI (graphics, pen, 10, 20, -10, -20); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawRectangleI (NULL, pen, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangleI (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawRectangleI (graphics, pen, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, pen, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, pen, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangle (graphics, NULL, 0, 0, 0, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, NULL, 0, 0, -1, 1); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 1, 0); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangleI (graphics, NULL, 0, 0, 1, -1); assertEqualInt (status, ObjectBusy); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawRectangles () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; RectF rectangles[] = { {10, 20, 30, 40}, {30, 40, 0, 0}, {100, 150, -20, -30}, {200, 200, 40, 50} }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangles (graphics, pen, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangles (graphics, pen, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangles (graphics, pen, rectangles, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangles (graphics, pen, rectangles, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. RectF zeroRectangles[] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectangles (graphics, pen, zeroRectangles, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawRectangles (NULL, pen, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (NULL, pen, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (NULL, pen, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, NULL, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, NULL, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, rectangles, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawRectangles (graphics, pen, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangles (graphics, NULL, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawRectangles (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, NULL, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectangles (graphics, pen, rectangles, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } static void test_drawRectanglesI () { GpStatus status; GpImage *image; GpGraphics *graphics; GpPen *pen; Rect rectangles[] = { {10, 20, 30, 40}, {30, 40, 0, 0}, {100, 150, -20, -30}, {200, 200, 40, 50} }; GdipCreatePen1 (0xFF00FF00, 1, UnitPixel, &pen); // Four. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectanglesI (graphics, pen, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Three. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectanglesI (graphics, pen, rectangles, 4); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Two. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectanglesI (graphics, pen, rectangles, 2); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // One. createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectanglesI (graphics, pen, rectangles, 1); assertEqualInt (status, Ok); GdipDeleteGraphics (graphics); GdipDisposeImage (image); // Zero. Rect zeroRectangles[] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; createImageGraphics (256, 256, &image, &graphics); status = GdipDrawRectanglesI (graphics, pen, zeroRectangles, 4); assertEqualInt (status, Ok); // Negative tests. status = GdipDrawRectanglesI (NULL, pen, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (NULL, pen, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (NULL, pen, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, NULL, rectangles, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, NULL, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, rectangles, -1); assertEqualInt (status, InvalidParameter); HDC hdc; status = GdipGetDC (graphics, &hdc); status = GdipDrawRectanglesI (graphics, pen, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawRectanglesI (graphics, NULL, rectangles, 3); assertEqualInt (status, ObjectBusy); status = GdipDrawRectanglesI (graphics, NULL, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, NULL, rectangles, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, 3); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, 1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, NULL, -1); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, rectangles, 0); assertEqualInt (status, InvalidParameter); status = GdipDrawRectanglesI (graphics, pen, rectangles, -1); assertEqualInt (status, InvalidParameter); GdipReleaseDC (graphics, hdc); GdipDeleteGraphics (graphics); GdipDisposeImage (image); GdipDeletePen (pen); } int main (int argc, char**argv) { STARTUP; test_drawArc (); test_drawArcI (); test_drawBezier (); test_drawBezierI (); test_drawBeziers (); test_drawBeziersI (); test_drawCurve (); test_drawCurveI (); test_drawCurve2 (); test_drawCurve2I (); test_drawCurve3 (); test_drawCurve3I (); test_drawClosedCurve (); test_drawClosedCurveI (); test_drawClosedCurve2 (); test_drawClosedCurve2I (); test_drawEllipse (); test_drawEllipseI (); test_drawImage (); test_drawImageI (); test_drawImageRect (); test_drawImageRectI (); test_drawImagePoints (); test_drawImagePointsI (); test_drawImagePointRect (); test_drawImagePointRectI (); test_drawImageRectRect (); test_drawImageRectRectI (); test_drawImagePointsRect (); test_drawImagePointsRectI (); test_drawLine (); test_drawLineI (); test_drawLines (); test_drawLinesI (); test_drawPath (); test_drawPie (); test_drawPieI (); test_drawPolygon (); test_drawPolygonI (); test_drawRectangle (); test_drawRectangleI (); test_drawRectangles (); test_drawRectanglesI (); SHUTDOWN; return 0; } libgdiplus-6.0.4+dfsg/winconfig.h.in0000644000175000017500000000026113542672033020063 0ustar directhexdirecthex/* winconfig.h.in. Template used on Windows/MSVC and processed by libgdiplus.vcxproj PreBuildEvent. */ /* Version number of package */ #define VERSION "#LIBGDIPLUS_VERSION#" libgdiplus-6.0.4+dfsg/ltmain.sh0000644000175000017500000117147413545371053017163 0ustar directhexdirecthex#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.6 Debian-2.4.6-2" package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.4.6-2 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libgdiplus-6.0.4+dfsg/libgdiplus0.spec.in0000644000175000017500000000303413542674535021033 0ustar directhexdirecthex%define real_name libgdiplus Name: libgdiplus0 Version: @VERSION@ Release: 0 License: LGPL v2.1 only ; MPL ; MIT License (or similar) Url: http://go-mono.org/ Source0: %{real_name}-%{version}.tar.bz2 Summary: Open Source Implementation of the GDI+ API Group: Development/Libraries/Other BuildRoot: %{_tmppath}/%{name}-%{version}-build Obsoletes: libgdiplus-devel Provides: libgdiplus-devel Obsoletes: libgdiplus Provides: libgdiplus BuildRequires: cairo-devel >= 1.6.4 BuildRequires: fontconfig-devel BuildRequires: giflib-devel BuildRequires: glib2-devel BuildRequires: libexif-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel %if 0%{?suse_version} BuildRequires: freetype2-devel %else BuildRequires: freetype-devel %endif %description This is part of the Mono project. It is required when using Windows.Forms. %files %defattr(-, root, root) %_libdir/libgdiplus.so* %_libdir/pkgconfig/libgdiplus.pc %doc AUTHORS COPYING ChangeLog* NEWS README.md %prep %setup -q -n %{real_name}-%{version} %build export CFLAGS="$RPM_OPT_FLAGS" %configure make %install make install DESTDIR=%{buildroot} # Unwanted files: rm -f %{buildroot}%{_libdir}/libgdiplus.a rm -f %{buildroot}%{_libdir}/libgdiplus.la # Remove generic non-usefull INSTALL file... (appeases # suse rpmlint checks, saves 3kb) find . -name INSTALL | xargs rm -f %clean rm -rf "$RPM_BUILD_ROOT" %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %changelog libgdiplus-6.0.4+dfsg/missing0000755000175000017500000001533013256032133016715 0ustar directhexdirecthex#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libgdiplus-6.0.4+dfsg/aclocal.m40000644000175000017500000015167213545371055017202 0ustar directhexdirecthex# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) libgdiplus-6.0.4+dfsg/config.guess0000755000175000017500000012637313244306071017652 0ustar directhexdirecthex#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libgdiplus-6.0.4+dfsg/compile0000755000175000017500000001624513256032133016702 0ustar directhexdirecthex#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libgdiplus-6.0.4+dfsg/src/0000755000175000017500000000000013545371077016121 5ustar directhexdirecthexlibgdiplus-6.0.4+dfsg/src/texturebrush-private.h0000644000175000017500000000366512377405421022511 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __TEXTUREBRUSH_PRIVATE_H__ #define __TEXTUREBRUSH_PRIVATE_H__ #include "gdiplus-private.h" #include "brush-private.h" #include "matrix-private.h" typedef struct _Texture { GpBrush base; GpImage *image; cairo_matrix_t matrix; GpRect rectangle; GpWrapMode wrapMode; cairo_pattern_t *pattern; } Texture; #include "texturebrush.h" #endif libgdiplus-6.0.4+dfsg/src/codecs-private.h0000644000175000017500000000551113542672033021175 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __CODECS_PRIVATE_H__ #define __CODECS_PRIVATE_H__ #include "gdiplus-private.h" #include "codecs.h" /* Maximum CODEC signature length, which is the minimum size we need to read from an image file to detect it's type */ #define MAX_CODEC_SIG_LENGTH 44 typedef enum { File, DStream, Memory } ImageSource; typedef struct { BYTE* ptr; int size; int pos; } MemorySource; static const CLSID gdip_image_frameDimension_page_guid = {0x7462dc86U, 0x6180U, 0x4c7eU, {0x8e, 0x3f, 0xee, 0x73, 0x33, 0xa7, 0xa4, 0x83}}; static const CLSID gdip_image_frameDimension_time_guid = {0x6aedbd6dU, 0x3fb5U, 0x418aU, {0x83, 0xa6, 0x7f, 0x45, 0x22, 0x9d, 0xc8, 0x72}}; static const CLSID gdip_image_frameDimension_resolution_guid = {0x84236f7bU, 0x3bd3U, 0x428fU, {0x8d, 0xab, 0x4e, 0xa1, 0x43, 0x9c, 0xa3, 0x15}}; const EncoderParameter *gdip_find_encoder_parameter (GDIPCONST EncoderParameters *eps, const GUID *guid) GDIP_INTERNAL; GpStatus initCodecList (void) GDIP_INTERNAL; void releaseCodecList (void) GDIP_INTERNAL; extern GUID GdipEncoderCompression; extern GUID GdipEncoderColorDepth; extern GUID GdipEncoderSaveFlag; extern GUID GdipEncoderSaveAsCMYK; extern GUID GdipEncoderImageItems; extern GUID GdipEncoderTransformation; extern GUID GdipEncoderQuality; extern GUID GdipEncoderLuminanceTable; extern GUID GdipEncoderChrominanceTable; #endif libgdiplus-6.0.4+dfsg/src/texturebrush.h0000644000175000017500000000360613542674535021045 0ustar directhexdirecthex/* * texturebrush.h * * Author: * Ravindra (rkumar@novell.com) * * Copyright (C) 2004,2006-2007 Novell, Inc. http://www.novell.com */ /* * NOTE: This header file contains ONLY public definitions and MUST match the GDI+ definitions. */ #ifndef __TEXTUREBRUSH_H__ #define __TEXTUREBRUSH_H__ GpStatus WINGDIPAPI GdipCreateTexture (GpImage *image, GpWrapMode wrapmode, GpTexture **texture); GpStatus WINGDIPAPI GdipCreateTexture2 (GpImage *image, GpWrapMode wrapmode, REAL x, REAL y, REAL width, REAL height, GpTexture **texture); GpStatus WINGDIPAPI GdipCreateTexture2I (GpImage *image, GpWrapMode wrapmode, INT x, INT y, INT width, INT height, GpTexture **texture); GpStatus WINGDIPAPI GdipCreateTextureIA (GpImage *image, GpImageAttributes *imageAttributes, REAL x, REAL y, REAL width, REAL height, GpTexture **texture); GpStatus WINGDIPAPI GdipCreateTextureIAI (GpImage *image, GpImageAttributes *imageAttributes, INT x, INT y, INT width, INT height, GpTexture **texture); GpStatus WINGDIPAPI GdipGetTextureTransform (GpTexture *texture, GpMatrix *matrix); GpStatus WINGDIPAPI GdipSetTextureTransform (GpTexture *texture, GDIPCONST GpMatrix *matrix); GpStatus WINGDIPAPI GdipResetTextureTransform (GpTexture *texture); GpStatus WINGDIPAPI GdipMultiplyTextureTransform (GpTexture *texture, GpMatrix *matrix, GpMatrixOrder order); GpStatus WINGDIPAPI GdipTranslateTextureTransform (GpTexture *texture, REAL dx, REAL dy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipScaleTextureTransform (GpTexture *texture, REAL sx, REAL sy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipRotateTextureTransform (GpTexture *texture, REAL angle, GpMatrixOrder order); GpStatus WINGDIPAPI GdipSetTextureWrapMode (GpTexture *texture, GpWrapMode wrapmode); GpStatus WINGDIPAPI GdipGetTextureWrapMode (GpTexture *texture, GpWrapMode *wrapmode); GpStatus WINGDIPAPI GdipGetTextureImage (GpTexture *texture, GpImage **image); #endif libgdiplus-6.0.4+dfsg/src/adjustablearrowcap.h0000644000175000017500000000477513542674535022166 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __ADJUSTABLEARROWCAP_H__ #define __ADJUSTABLEARROWCAP_H__ /* AdjustableArrowCap public API (only!) */ GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap (REAL height, REAL width, BOOL isFilled, GpAdjustableArrowCap **cap); GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight (GpAdjustableArrowCap *cap, REAL *height); GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight (GpAdjustableArrowCap *cap, REAL height); GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth (GpAdjustableArrowCap *cap, REAL *width); GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth (GpAdjustableArrowCap *cap, REAL width); GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset (GpAdjustableArrowCap *cap, REAL *middleInset); GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset (GpAdjustableArrowCap *cap, REAL middleInset); GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState (GpAdjustableArrowCap *cap, BOOL isFilled); GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState (GpAdjustableArrowCap *cap, BOOL *isFilled); #endif libgdiplus-6.0.4+dfsg/src/Makefile.am0000644000175000017500000000507613542674535020167 0ustar directhexdirecthexlib_LTLIBRARIES = libgdiplus.la libgdiplus_la_SOURCES = \ adjustablearrowcap.c \ adjustablearrowcap.h \ adjustablearrowcap-private.h \ alpha-premul-table.inc \ bitmap.c \ bitmap.h \ bitmap-private.h \ brush.c \ brush.h \ brush-private.h \ carbon-private.c \ carbon-private.h \ codecs.h \ codecs-private.h \ customlinecap.c \ customlinecap.h \ customlinecap-private.h \ dstream.c \ dstream.h \ font.c \ font.h \ font-private.h \ fontcollection.h \ fontcollection-private.h \ fontfamily.h \ fontfamily-private.h \ gdi32.h \ gdi32.c \ GdiPlusFlat.h \ gdiplus-private.h \ gdip.h \ gdipenums.h \ gdiplusimaging.h \ gdipluspixelformats.h \ gdipstructs.h \ general.c \ general.h \ general-private.h \ graphics.c \ graphics.h \ graphics-cairo.c \ graphics-cairo-private.h \ graphics-metafile.c \ graphics-metafile-private.h \ graphics-private.h \ graphics-path.c \ graphics-path.h \ graphics-path-private.h \ graphics-pathiterator.c \ graphics-pathiterator.h \ graphics-pathiterator-private.h \ hatchbrush.c \ hatchbrush.h \ hatchbrush-private.h \ icocodec.c \ icocodec.h \ image.c \ image.h \ image-private.h \ imageattributes.c \ imageattributes.h \ imageattributes-private.h \ lineargradientbrush.c \ lineargradientbrush.h \ lineargradientbrush-private.h \ matrix.c \ matrix.h \ matrix-private.h \ metafile.c \ metafile.h \ metafile-private.h \ pathgradientbrush.c \ pathgradientbrush.h \ pathgradientbrush-private.h \ pen.c \ pen.h \ pen-private.h \ print.c \ region.c \ region.h \ region-private.h \ region-bitmap.c \ region-bitmap.h \ region-path-tree.c \ region-path-tree.h \ solidbrush.c \ solidbrush.h \ solidbrush-private.h \ stringformat.c \ stringformat.h \ stringformat-private.h \ text.c \ text.h \ text-metafile.c \ text-metafile-private.h \ texturebrush.c \ texturebrush.h \ texturebrush-private.h \ win32structs.h \ bmpcodec.h \ bmpcodec.c \ emfcodec.c \ emfcodec.h \ emfplus.c \ emfplus.h \ gifcodec.h \ gifcodec.c \ jpegcodec.h \ jpegcodec.c \ pngcodec.h \ pngcodec.c \ tiffcodec.h \ tiffcodec.c \ wmfcodec.c \ wmfcodec.h if USE_PANGO_RENDERING libgdiplus_la_SOURCES += \ text-pango.c \ text-pango-private.h else libgdiplus_la_SOURCES += \ text-cairo.c \ text-cairo-private.h endif libgdiplus_la_LIBADD = $(GDIPLUS_LIBS) AM_CPPFLAGS = $(GDIPLUS_CFLAGS) EXTRA_DIST = libgdiplus.vcxproj libgdiplus-6.0.4+dfsg/src/general-private.h0000644000175000017500000001432713545154626021365 0ustar directhexdirecthex/* * general-private.h * * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __GENERAL_PRIVATE_H__ #define __GENERAL_PRIVATE_H__ #include "gdiplus-private.h" #define PI 3.14159265358979323846 #define DEGTORAD (PI / 180.0) /* looks like they are not available everywhere :( */ #ifndef G_MAXINT32 #define G_MAXINT32 2147483647 #define G_MININT16 -32768 #define G_MAXINT16 32767 #endif #define MAKE_ARGB_RGB(r,g,b) (((r&0xff) << 16) | ((g&0xff) << 8) | (b&0xff)) #define MAKE_ARGB_ARGB(a,r,g,b) (((guint32)(a&0xff) << 24) | ((r&0xff) << 16) | ((g&0xff) << 8) | (b&0xff)) #if !defined(min) #define min(a,b) (a < b ? a : b) #endif #if !defined(max) #define max(a,b) (a > b ? a : b) #endif #if !defined(__has_attribute) #define __has_attribute(x) 0 #endif #if __has_attribute(used) || defined(__GNUC__) #define ATTRIBUTE_USED __attribute__((used)) #else #define ATTRIBUTE_USED #endif /* avoid direct floating point comparison */ #define gdip_near_zero(value) ((value >= -0.00059604645f) && (value <= 0.00059604645f)) #define gdip_near_one(value) gdip_near_zero (value - 1.0f) /* avoid integer overflows when int/float/int conversion are used (see #79643) */ #define SAFE_FLOAT_TO_UINT32(value) ((value < 0) ? 0 : (value >= G_MAXINT32) ? G_MAXINT32 : (((int)value) < 0 ? G_MAXINT32 : (int)value)) /* avoid fp division and multiplication that would return the same number */ #define OPTIMIZE_CONVERSION(g) ((g->type != gtPostScript) && ((g->page_unit == UnitPixel) || (g->page_unit == UnitWorld))) /* macros for common conversions, i.e. to or from UnitCairoPoint */ #define gdip_unitx_convgr(g,f) (gdip_unit_conversion (g->page_unit, UnitCairoPoint, g->dpi_x, g->type, f)) #define gdip_unity_convgr(g,f) (gdip_unit_conversion (g->page_unit, UnitCairoPoint, g->dpi_y, g->type, f)) #define gdip_convgr_unitx(g,f) (gdip_unit_conversion (UnitCairoPoint, g->page_unit, g->dpi_x, g->type, f)) #define gdip_convgr_unity(g,f) (gdip_unit_conversion (UnitCairoPoint, g->page_unit, g->dpi_y, g->type, f)) /* pixman always use 32bits for pixman_bits_t */ #define gdip_align_stride(s) { s += (sizeof(guint32)-1); s &= ~(sizeof(guint32)-1); } /* avoid floating point division/multiplications when pre-multiplying the alpha channel with R, G and B values */ extern const BYTE pre_multiplied_table[256][256]; extern const BYTE pre_multiplied_table_reverse[256][256]; extern BOOL gdiplusInitialized; #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1,6,0) /* older cairo has a (signed) 15(1)/16(2)bits pixel positioning, while GDI+ use (signed) 23 bits (infinity). * Using larger values confuse the bits used for subpixel positioning. * (1) http://lists.freedesktop.org/archives/cairo/2006-June/007251.html * (2) testing shows artefacts if using more than 15 bits */ #define CAIRO_LOW_LIMIT -16384 #define CAIRO_HIGH_LIMIT 16383 #define CAIRO_LIMIT(v) ((v < CAIRO_LOW_LIMIT) ? CAIRO_LOW_LIMIT : (v > CAIRO_HIGH_LIMIT) ? CAIRO_HIGH_LIMIT : v) #else /* since cairo 1.6 values are split 24/8 */ #define CAIRO_LIMIT(v) v #endif /* other shared functions */ int iround (float d) GDIP_INTERNAL; float gdip_erf (float x, float std, float mean) GDIP_INTERNAL; float gdip_get_display_dpi () GDIP_INTERNAL; GpStatus gdip_get_status (cairo_status_t status) GDIP_INTERNAL; GpStatus gdip_get_pattern_status (cairo_pattern_t *pat) GDIP_INTERNAL; gchar *utf16_to_utf8 (const gunichar2 *ucs2, int length) GDIP_INTERNAL; BOOL utf8_to_ucs2 (const gchar *utf8, gunichar2 *ucs2, int ucs2_len) GDIP_INTERNAL; int utf8_encode_ucs2char (gunichar2 unichar, unsigned char *dest) GDIP_INTERNAL; /* for drawing curves */ GpPointF *convert_points (const GpPoint *points, int count) GDIP_INTERNAL; GpRectF *convert_rects (const GpRect *rect, int count) GDIP_INTERNAL; GpPointF *gdip_closed_curve_tangents (int terms, const GpPointF *points, int count, float tension) GDIP_INTERNAL; GpPointF *gdip_open_curve_tangents (int terms, const GpPointF *points, int count, float tension) GDIP_INTERNAL; /* Conversion functions. */ void gdip_RectF_from_Rect (const GpRect* rect, GpRectF* rectf) GDIP_INTERNAL; void gdip_Rect_from_RectF (const GpRectF* rectf, GpRect* rect) GDIP_INTERNAL; void gdip_PointF_from_Point (const GpPoint* point, GpPointF* pointf) GDIP_INTERNAL; void gdip_Point_from_PointF (const GpPointF* pointf, GpPoint* point) GDIP_INTERNAL; /* Rect functions */ void gdip_normalize_rectangle (const GpRectF *rect, GpRectF *normalized) GDIP_INTERNAL; BOOL gdip_is_rectF_empty (const GpRectF *rect, BOOL allowNegative) GDIP_INTERNAL; /* memory */ void* gdip_realloc (void *org, int size) GDIP_INTERNAL; void* gdip_calloc (size_t nelem, size_t elsize) GDIP_INTERNAL; /* checksums */ DWORD gdip_crc32 (const BYTE *buf, size_t size) GDIP_INTERNAL; #include "general.h" #endif libgdiplus-6.0.4+dfsg/src/pathgradientbrush.c0000644000175000017500000010672213545154623022007 0ustar directhexdirecthex/* * pathgradientbrush.c * * Copyright (C) 2003-2004,2007 Novell, Inc. http://www.novell.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. * * Authors: * Vladimir Vukicevic (vladimir@pobox.com) * Ravindra (rkumar@novell.com) * */ #include "pathgradientbrush-private.h" #include "general-private.h" #include "gdiplus-private.h" #include "graphics-private.h" #include "graphics-path-private.h" #include "matrix-private.h" static GpStatus gdip_pgrad_setup (GpGraphics *graphics, GpBrush *brush); static GpStatus gdip_pgrad_clone_brush (GpBrush *brush, GpBrush **clonedBrush); static GpStatus gdip_pgrad_destroy (GpBrush *brush); static BrushClass pathgradient_vtable = { BrushTypePathGradient, gdip_pgrad_setup, gdip_pgrad_clone_brush, gdip_pgrad_destroy }; static GpStatus gdip_pathgradient_init (GpPathGradient *pg) { gdip_brush_init (&pg->base, &pathgradient_vtable); pg->boundary = NULL; pg->boundaryColors = (ARGB *) GdipAlloc (sizeof (ARGB)); if (!pg->boundaryColors) { return OutOfMemory; } *(pg->boundaryColors) = 0xFFFFFFFF; pg->boundaryColorsCount = 1; /* one default boundary color */ pg->focusScales.X = 0.0f; pg->focusScales.Y = 0.0f; pg->wrapMode = WrapModeClamp; cairo_matrix_init_identity (&pg->transform); pg->presetColors = (InterpolationColors *) GdipAlloc (sizeof (InterpolationColors)); if (!pg->presetColors) { GdipFree (pg->boundaryColors); return OutOfMemory; } pg->presetColors->count = 0; pg->presetColors->colors = NULL; pg->presetColors->positions = NULL; pg->blend = (Blend *) GdipAlloc (sizeof (Blend)); if (!pg->blend) { GdipFree (pg->boundaryColors); GdipFree (pg->presetColors); return OutOfMemory; } pg->blend->count = 1; pg->blend->factors = (float *) GdipAlloc (sizeof (float)); if (!pg->blend->factors) { GdipFree (pg->boundaryColors); GdipFree (pg->presetColors); GdipFree (pg->blend); return OutOfMemory; } pg->blend->positions = (float *) GdipAlloc (sizeof (float)); if (!pg->blend->positions) { GdipFree (pg->boundaryColors); GdipFree (pg->presetColors); GdipFree (pg->blend->factors); GdipFree (pg->blend); return OutOfMemory; } pg->blend->factors [0] = 1.0; pg->blend->positions[0] = 0.0; pg->rectangle.X = 0.0; pg->rectangle.Y = 0.0; pg->rectangle.Width = 0.0; pg->rectangle.Height = 0.0; pg->pattern = NULL; pg->useGammaCorrection = FALSE; return Ok; } static GpPathGradient* gdip_pathgradient_new (void) { GpPathGradient *result = (GpPathGradient *) GdipAlloc (sizeof (GpPathGradient)); if (result) { if (gdip_pathgradient_init (result) == Ok) return result; GdipFree (result); } return NULL; } GpStatus gdip_pgrad_clone_brush (GpBrush *brush, GpBrush **clonedBrush) { GpStatus status; GpPathGradient *pgbrush; GpPathGradient *newbrush; if (!brush || !clonedBrush) return InvalidParameter; newbrush = gdip_pathgradient_new (); if (!newbrush) return OutOfMemory; pgbrush = (GpPathGradient *) brush; newbrush->base = pgbrush->base; if (pgbrush->boundary) { status = GdipClonePath (pgbrush->boundary, &newbrush->boundary); if (status != Ok) { GdipDeleteBrush ((GpBrush *) newbrush); return status; } } else { newbrush->boundary = NULL; } newbrush->boundaryColors = GdipAlloc (sizeof(ARGB) * pgbrush->boundaryColorsCount); if (!newbrush->boundaryColors) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } memcpy (newbrush->boundaryColors, pgbrush->boundaryColors, sizeof(ARGB) * pgbrush->boundaryColorsCount); newbrush->boundaryColorsCount = pgbrush->boundaryColorsCount; newbrush->focusScales = pgbrush->focusScales; newbrush->center = pgbrush->center; newbrush->centerColor = pgbrush->centerColor; newbrush->wrapMode = pgbrush->wrapMode; newbrush->useGammaCorrection = pgbrush->useGammaCorrection; gdip_cairo_matrix_copy (&newbrush->transform, &pgbrush->transform); newbrush->rectangle.X = pgbrush->rectangle.X; newbrush->rectangle.Y = pgbrush->rectangle.Y; newbrush->rectangle.Width = pgbrush->rectangle.Width; newbrush->rectangle.Height = pgbrush->rectangle.Height; newbrush->presetColors = (InterpolationColors *) GdipAlloc (sizeof (InterpolationColors)); if (!newbrush->presetColors) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } newbrush->presetColors->count = pgbrush->presetColors->count; if (pgbrush->presetColors->count > 0) { newbrush->presetColors->colors = (ARGB *) GdipAlloc (pgbrush->presetColors->count * sizeof (ARGB)); if (!newbrush->presetColors->colors) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } memcpy (newbrush->presetColors->colors, pgbrush->presetColors->colors, pgbrush->presetColors->count * sizeof (ARGB)); newbrush->presetColors->positions = (float *) GdipAlloc (pgbrush->presetColors->count * sizeof (float)); if (!newbrush->presetColors->positions) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } memcpy (newbrush->presetColors->positions, pgbrush->presetColors->positions, pgbrush->presetColors->count * sizeof (float)); } else { memcpy (newbrush->presetColors, pgbrush->presetColors, sizeof (InterpolationColors)); } newbrush->blend = (Blend *) GdipAlloc (sizeof (Blend)); if (!newbrush->blend) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } newbrush->blend->count = pgbrush->blend->count; if (pgbrush->blend->count > 0) { newbrush->blend->factors = (float *) GdipAlloc (pgbrush->blend->count * sizeof (float)); if (!newbrush->blend->factors) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } memcpy (newbrush->blend->factors, pgbrush->blend->factors, pgbrush->blend->count * sizeof (ARGB)); newbrush->blend->positions = (float *) GdipAlloc (pgbrush->blend->count * sizeof (float)); if (!newbrush->blend->positions) { GdipDeleteBrush ((GpBrush *) newbrush); return OutOfMemory; } memcpy (newbrush->blend->positions, pgbrush->blend->positions, pgbrush->blend->count * sizeof (float)); } else { memcpy (newbrush->blend, pgbrush->blend, sizeof (Blend)); } /* Let the clone to create its own pattern */ newbrush->base.changed = TRUE; newbrush->pattern = NULL; *clonedBrush = (GpBrush *) newbrush; return Ok; } GpStatus gdip_pgrad_destroy (GpBrush *brush) { /* a. the NULL check for brush is done by the caller, GdipDeleteBrush */ /* b. brush itself is freed by the caller */ GpPathGradient *pgbrush = (GpPathGradient *) brush; if (pgbrush->boundary) { GdipDeletePath (pgbrush->boundary); pgbrush->boundary = NULL; } if (pgbrush->boundaryColors) { GdipFree (pgbrush->boundaryColors); pgbrush->boundaryColors = NULL; } if (pgbrush->pattern) { cairo_pattern_destroy (pgbrush->pattern); pgbrush->pattern = NULL; } if (pgbrush->blend) { if (pgbrush->blend->count > 0) { GdipFree (pgbrush->blend->factors); GdipFree (pgbrush->blend->positions); } GdipFree (pgbrush->blend); pgbrush->blend = NULL; } if (pgbrush->presetColors) { if (pgbrush->presetColors->count > 0) { GdipFree (pgbrush->presetColors->colors); GdipFree (pgbrush->presetColors->positions); } GdipFree (pgbrush->presetColors); pgbrush->presetColors = NULL; } return Ok; } static void add_color_stops_from_blend (cairo_pattern_t *pattern, Blend *blend, ARGB color1, ARGB color2) { int index; double sr, sg, sb, sa; double er, eg, eb, ea; double offset, factor; sa = (color1 >> 24) & 0xFF; sr = (color1 >> 16) & 0xFF; sg = (color1 >> 8) & 0xFF; sb = color1 & 0xFF; ea = (color2 >> 24) & 0xFF; er = (color2 >> 16) & 0xFF; eg = (color2 >> 8) & 0xFF; eb = color2 & 0xFF; for (index = 0; index < blend->count; index++) { factor = blend->factors [index]; offset = blend->positions [index]; cairo_pattern_add_color_stop_rgba (pattern, offset, ((sr * (1 - factor)) + (er * factor)) / 255, ((sg * (1 - factor)) + (eg * factor)) / 255, ((sb * (1 - factor)) + (eb * factor)) / 255, ((sa * (1 - factor)) + (ea * factor)) / 255); } } static void add_color_stops_from_interpolation_colors (cairo_pattern_t *pattern, InterpolationColors *presetColors) { int index; double r, g, b, a; double offset; ARGB color; /* MS accecpts positions above 1.0 also. Cairo assumes the values above 1.0 as 1.0 * and values below 0 are assumed as 0. So we get different results if any of the * offset values is out of [0.0, 1.0]. */ for (index = 0; index < presetColors->count; index++) { color = presetColors->colors [index]; a = (color >> 24) & 0xFF; r = (color >> 16) & 0xFF; g = (color >> 8) & 0xFF; b = color & 0xFF; offset = presetColors->positions [index]; cairo_pattern_add_color_stop_rgba (pattern, offset, r / 255, g / 255, b / 255, a / 255); } } GpStatus gdip_pgrad_setup (GpGraphics *graphics, GpBrush *brush) { GpPathGradient *pgbrush; GpStatus status; if (!graphics || !brush) return InvalidParameter; pgbrush = (GpPathGradient *) brush; if (pgbrush->boundary == NULL) return Ok; /* do nothing */ /* We create the new pattern for brush, if the brush is changed * or if pattern has not been created yet. */ if (pgbrush->base.changed || !pgbrush->pattern) { cairo_pattern_t *pat; float r = MIN (pgbrush->rectangle.Width / 2, pgbrush->rectangle.Height / 2); /* destroy the existing pattern */ if (pgbrush->pattern) { cairo_pattern_destroy (pgbrush->pattern); pgbrush->pattern = NULL; } /* FIXME: To fully implement this function we need cairo to support path gradients. * Right now we have radial gradient which can be used, in some cases, to get the right effect. */ /* Set the start radius as r and the end radius as 0 so that the center is the end "circle". * That way interpolation and blend positions go the right direction (edge to center).*/ pat = cairo_pattern_create_radial (pgbrush->center.X, pgbrush->center.Y, r, pgbrush->center.X, pgbrush->center.Y, 0.0f); status = gdip_get_pattern_status (pat); if (status != Ok) return status; GpMatrix matrix; gdip_cairo_matrix_copy (&matrix, &pgbrush->transform); status = GdipInvertMatrix (&matrix); if (status != Ok) return status; cairo_pattern_set_matrix (pat, &matrix); if ((pgbrush->blend->count > 1) && (pgbrush->boundaryColorsCount > 0)) { /* FIXME: blending done using the a radial shape (not the path shape) */ add_color_stops_from_blend (pat, pgbrush->blend, pgbrush->boundaryColors[0], pgbrush->centerColor); } else if (pgbrush->presetColors->count > 1) { /* FIXME: copied from lineargradiantbrush, most probably not right */ add_color_stops_from_interpolation_colors (pat, pgbrush->presetColors); } else { cairo_pattern_add_color_stop_rgba (pat, 1.0f, ARGB_RED_N (pgbrush->centerColor), ARGB_GREEN_N (pgbrush->centerColor), ARGB_BLUE_N (pgbrush->centerColor), ARGB_ALPHA_N (pgbrush->centerColor)); /* if a single other boundary color is present, then we can do the a real radial */ if (pgbrush->boundaryColorsCount == 1) { ARGB c = pgbrush->boundaryColors[0]; cairo_pattern_add_color_stop_rgba (pat, 0.0f, ARGB_RED_N (c), ARGB_GREEN_N (c), ARGB_BLUE_N (c), ARGB_ALPHA_N (c)); } else { /* FIXME: otherwise we (solid-)fill with the centerColor */ } } pgbrush->pattern = pat; } cairo_set_source (graphics->ct, pgbrush->pattern); return gdip_get_status (cairo_status (graphics->ct)); } static GpPointF gdip_get_center (GDIPCONST GpPointF *points, INT count) { /* Center is the mean of all the points. */ GpPointF center = {0.0, 0.0}; for (int i = 0; i < count; i++) { center.X += points[i].X; center.Y += points[i].Y; } center.X /= count; center.Y /= count; return center; } static BOOL gdip_all_colors_equal (GDIPCONST ARGB *colors, int count) { int i; for (i = 1; i < count; i++) { if (colors[i] != colors[i - 1]) return FALSE; } return TRUE; } static void gdip_rect_expand_by (GpRectF *rect, const GpPointF *point) { /* This method is somewhat stupid, because GpRect is x,y width,height, * instead of x0,y0 x1,y1. */ float x0 = rect->X; float y0 = rect->Y; float x1 = x0 + rect->Width; float y1 = y0 + rect->Height; if (point->X < x0) x0 = point->X; else if (point->X > x1) x1 = point->X; if (point->Y < y0) y0 = point->Y; else if (point->Y > y1) y1 = point->Y; rect->X = x0; rect->Y = y0; rect->Width = (x1 - x0); rect->Height = (y1 - y0); } /* coverity[+alloc : arg-*3] */ GpStatus WINGDIPAPI GdipCreatePathGradient (GDIPCONST GpPointF *points, INT count, GpWrapMode wrapMode, GpPathGradient **polyGradient) { GpPathGradient *gp; GpStatus status; GpPointF point; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!polyGradient) return InvalidParameter; if (!points || count < 2 || wrapMode < WrapModeTile || wrapMode > WrapModeClamp) { *polyGradient = NULL; return OutOfMemory; } gp = gdip_pathgradient_new (); if (!gp) return OutOfMemory; status = GdipCreatePath (FillModeAlternate, &gp->boundary); if (status != Ok) { GdipDeleteBrush ((GpBrush *) gp); return status; } status = GdipAddPathLine2 (gp->boundary, points, count); if (status != Ok) { GdipDeleteBrush ((GpBrush *) gp); return status; } gp->wrapMode = wrapMode; gp->center = gdip_get_center (points, count); gp->centerColor = 0xFF000000; /* set the bounding rectangle */ point = gp->boundary->points[0]; /* set the first point as the edge of the rectangle */ gp->rectangle.X = point.X; gp->rectangle.Y = point.Y; for (int i = 1; i < gp->boundary->count; i++) { point = gp->boundary->points[i]; gdip_rect_expand_by (&gp->rectangle, &point); } if (gp->rectangle.Width == 0 || gp->rectangle.Height == 0) { GdipDeleteBrush ((GpBrush *) gp); *polyGradient = NULL; return OutOfMemory; } *polyGradient = gp; return Ok; } /* coverity[+alloc : arg-*3] */ GpStatus WINGDIPAPI GdipCreatePathGradientI (GDIPCONST GpPoint *points, INT count, GpWrapMode wrapMode, GpPathGradient **polyGradient) { GpStatus status; GpPointF *pointsF; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!points) return InvalidParameter; if (count < 0) return OutOfMemory; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipCreatePathGradient (pointsF, count, wrapMode, polyGradient); GdipFree (pointsF); return status; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath (GDIPCONST GpPath *path, GpPathGradient **polyGradient) { GpStatus status; GpPathGradient *gp; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!polyGradient) return InvalidParameter; if (!path || (path->count < 2)) { *polyGradient = NULL; return OutOfMemory; } gp = gdip_pathgradient_new (); if (!gp) return OutOfMemory; status = GdipClonePath ((GpPath *) path, &gp->boundary); if (status != Ok) { GdipDeleteBrush ((GpBrush *) gp); return status; } gp->center = gdip_get_center (path->points, path->count); gp->centerColor = 0xFFFFFFFF; /* set the bounding rectangle */ /* set the first point as the edge of the rectangle */ gp->rectangle.X = path->points [0].X; gp->rectangle.Y = path->points [0].Y; for (int i = 1; i < path->count; i++) { gdip_rect_expand_by (&gp->rectangle, &path->points[i]); } *polyGradient = gp; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientCenterColor (GpPathGradient *brush, ARGB *colors) { if (!brush || !colors) return InvalidParameter; *colors = brush->centerColor; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientCenterColor (GpPathGradient *brush, ARGB colors) { if (!brush) return InvalidParameter; brush->centerColor = colors; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount (GpPathGradient *brush, ARGB *colors, INT *count) { if (!brush || !colors || !count || *count < brush->boundary->count) return InvalidParameter; for (int i = 0; i < brush->boundary->count; i++) { if (i < brush->boundaryColorsCount) colors[i] = brush->boundaryColors[i]; else colors[i] = brush->boundaryColors[brush->boundaryColorsCount - 1]; } *count = brush->boundaryColorsCount; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount (GpPathGradient *brush, GDIPCONST ARGB *colors, INT *count) { int boundaryColorsCount; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!brush || !colors || !count) return InvalidParameter; boundaryColorsCount = *count; if ((boundaryColorsCount < 1) || (boundaryColorsCount > brush->boundary->count)) return InvalidParameter; /* If all the colors are equal then GDI+ collapses them into a single element array */ if (boundaryColorsCount > 1 && gdip_all_colors_equal(colors, boundaryColorsCount)) { boundaryColorsCount = 1; } if (boundaryColorsCount != brush->boundaryColorsCount) { ARGB *boundaryColors = (ARGB *) GdipAlloc (sizeof(ARGB) * boundaryColorsCount); if (!boundaryColors) return OutOfMemory; GdipFree (brush->boundaryColors); brush->boundaryColors = boundaryColors; } memcpy (brush->boundaryColors, colors, sizeof (ARGB) * boundaryColorsCount); brush->boundaryColorsCount = boundaryColorsCount; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientPath (GpPathGradient *brush, GpPath *path) { // GDI+ does not implement this API. return NotImplemented; } GpStatus WINGDIPAPI GdipSetPathGradientPath (GpPathGradient *brush, GDIPCONST GpPath *path) { // GDI+ does not implement this API. return NotImplemented; } GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint (GpPathGradient *brush, GpPointF *point) { if (!brush || !point) return InvalidParameter; point->X = brush->center.X; point->Y = brush->center.Y; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI (GpPathGradient *brush, GpPoint *point) { if (!brush || !point) return InvalidParameter; gdip_Point_from_PointF (&brush->center, point); return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint (GpPathGradient *brush, GDIPCONST GpPointF *point) { if (!brush || !point) return InvalidParameter; brush->center.X = point->X; brush->center.Y = point->Y; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI (GpPathGradient *brush, GDIPCONST GpPoint *point) { PointF pointF; if (!brush || !point) return InvalidParameter; gdip_PointF_from_Point (point, &pointF); return GdipSetPathGradientCenterPoint (brush, &pointF); } GpStatus WINGDIPAPI GdipGetPathGradientRect (GpPathGradient *brush, GpRectF *rect) { if (!brush || !rect) return InvalidParameter; memcpy (rect, &brush->rectangle, sizeof (GpRectF)); return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientRectI (GpPathGradient *brush, GpRect *rect) { if (!brush || !rect) return InvalidParameter; gdip_Rect_from_RectF (&brush->rectangle, rect); return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientPointCount (GpPathGradient *brush, INT *count) { if (!brush || !count) return InvalidParameter; *count = brush->boundary->count; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection (GpPathGradient *brush, BOOL useGammaCorrection) { if (!brush) return InvalidParameter; brush->useGammaCorrection = useGammaCorrection; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient *brush, BOOL *useGammaCorrection) { if (!brush || !useGammaCorrection) return InvalidParameter; *useGammaCorrection = brush->useGammaCorrection; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount (GpPathGradient *brush, INT *count) { if (!brush || !count) return InvalidParameter; *count = brush->boundary->count; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientBlendCount (GpPathGradient *brush, INT *count) { if (!brush || !count) return InvalidParameter; *count = brush->blend->count; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientBlend (GpPathGradient *brush, REAL *blend, REAL *positions, INT count) { if (!brush || !blend || !positions || count <= 0) return InvalidParameter; if (count < brush->blend->count) return InsufficientBuffer; memcpy (blend, brush->blend->factors, brush->blend->count * sizeof (float)); // Don't copy anything to positions if the count is one, as positions requires at least 2 values in the array. if (brush->blend->count > 1) memcpy (positions, brush->blend->positions, brush->blend->count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientBlend (GpPathGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *positions, INT count) { float *blendFactors; float *blendPositions; if (!brush || !blend || !positions || count <= 0) return InvalidParameter; if (count >= 2 && (positions[0] != 0.0f || positions[count - 1] != 1.0f)) return InvalidParameter; if (brush->blend->count != count) { blendFactors = (float *) GdipAlloc (count * sizeof (float)); if (!blendFactors) return OutOfMemory; blendPositions = (float *) GdipAlloc (count * sizeof (float)); if (!blendPositions) { GdipFree (blendFactors); return OutOfMemory; } /* free the existing values */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); } brush->blend->factors = blendFactors; brush->blend->positions = blendPositions; } for (int index = 0; index < count; index++) { brush->blend->factors [index] = blend [index]; brush->blend->positions [index] = positions [index]; } brush->blend->count = count; /* we clear the preset colors when setting the blend */ if (brush->presetColors->count != 0) { GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); brush->presetColors->count = 0; brush->presetColors->colors = NULL; brush->presetColors->positions = NULL; } brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount (GpPathGradient *brush, INT *count) { if (!brush || !count) return InvalidParameter; *count = brush->presetColors->count; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend (GpPathGradient *brush, ARGB *blend, REAL *positions, INT count) { if (!brush || !blend) return InvalidParameter; if (count < 0) return OutOfMemory; if (!positions || count < 2) return InvalidParameter; if (brush->presetColors->count == 0) return GenericError; if (brush->presetColors->count != count) return InvalidParameter; memcpy (blend, brush->presetColors->colors, count * sizeof (ARGB)); memcpy (positions, brush->presetColors->positions, count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend (GpPathGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *positions, INT count) { ARGB *blendColors; float *blendPositions; if (!brush || !blend || !positions || count < 2 || positions[0] != 0.0f || positions[count - 1] != 1.0f) return InvalidParameter; if (brush->presetColors->count != count) { blendColors = (ARGB *) GdipAlloc (count * sizeof (ARGB)); if (!blendColors) return OutOfMemory; blendPositions = (float *) GdipAlloc (count * sizeof (float)); if (!blendPositions) { GdipFree (blendColors); return OutOfMemory; } /* free the existing values */ if (brush->presetColors->count != 0) { GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); } brush->presetColors->colors = blendColors; brush->presetColors->positions = blendPositions; } for (int index = 0; index < count; index++) { brush->presetColors->colors [index] = blend [index]; brush->presetColors->positions [index] = positions [index]; } brush->presetColors->count = count; /* we clear the blend when setting preset colors */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); brush->blend->count = 0; } brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend (GpPathGradient *brush, REAL focus, REAL scale) { float *blends, *positions, *presetPositions; ARGB *presetColors; float pos = 0.0; int count = 511; /* total no of samples */ int index; float sigma; float mean; float fall_off_len = 2.0; /* curve fall off length in terms of SIGMA */ float delta; /* distance between two samples */ /* we get a curve not starting from 0 and not ending at 1. * so we subtract the starting value and divide by the curve * height to make it fit in the 0 to scale range */ float curve_bottom; float curve_top; float curve_height; if (!brush || focus < 0 || focus > 1 || scale < 0 || scale > 1) return InvalidParameter; if (focus == 0 || focus == 1) { count = 256; } if (brush->blend->count != count) { blends = (float *) GdipAlloc (count * sizeof (float)); if (!blends) return OutOfMemory; positions = (float *) GdipAlloc (count * sizeof (float)); if (!positions) { GdipFree (blends); return OutOfMemory; } /* free the existing values */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); } brush->blend->factors = blends; brush->blend->positions = positions; } /* we clear the preset colors when setting the blend */ if (brush->presetColors->count != 1) { presetColors = (ARGB *) GdipAlloc (sizeof (ARGB)); if (!presetColors) return OutOfMemory; presetPositions = (float *) GdipAlloc (sizeof (float)); if (!presetPositions) { GdipFree (presetColors); return OutOfMemory; } GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); brush->presetColors->count = 1; brush->presetColors->colors = presetColors; brush->presetColors->positions = presetPositions; } brush->presetColors->colors [0] = 0x00000000; brush->presetColors->positions[0] = 0.0; /* Set the blend colors. We use integral of the Normal Distribution, * i.e. Cumulative Distribution Function (CFD). * * Normal distribution: * * y (x) = (1 / sqrt (2 * PI * sq (sigma))) * exp (-sq (x - mu)/ (2 * sq (sigma))) * * where, y = height of normal curve, * sigma = standard deviation * mu = mean * OR * y (x) = peak * exp ( - z * z / 2) * where, z = (x - mu) / sigma * * In this curve, peak would occur at mean i.e. for x = mu. This results in * a peak value of peak = (1 / sqrt (2 * PI * sq (sigma))). * * Cumulative distribution function: * Ref: http://mathworld.wolfram.com/NormalDistribution.html * * D (x) = (1 / 2) [1 + erf (z)] * where, z = (x - mu) / (sigma * sqrt (2)) * */ if (focus == 0) { /* right part of the curve with a complete fall in fall_off_len * SIGMAs */ sigma = 1.0 / fall_off_len; mean = 0.5; delta = 1.0 / 255.0; curve_bottom = 0.5 * (1.0 - gdip_erf (1.0, sigma, mean)); curve_top = 0.5 * (1.0 - gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; /* set the start */ brush->blend->positions [0] = focus; brush->blend->factors [0] = scale; for (index = 1, pos = delta; index < 255; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 - gdip_erf (pos, sigma, mean)) - curve_bottom); } /* set the end */ brush->blend->positions [count - 1] = 1.0; brush->blend->factors [count - 1] = 0.0; } else if (focus == 1) { /* left part of the curve with a complete rise in fall_off_len * SIGMAs */ sigma = 1.0 / fall_off_len; mean = 0.5; delta = 1.0 / 255.0; curve_bottom = 0.5 * (1.0 + gdip_erf (0.0, sigma, mean)); curve_top = 0.5 * (1.0 + gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; /* set the start */ brush->blend->positions [0] = 0.0; brush->blend->factors [0] = 0.0; for (index = 1, pos = delta; index < 255; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 + gdip_erf (pos, sigma, mean)) - curve_bottom); } /* set the end */ brush->blend->positions [count - 1] = focus; brush->blend->factors [count - 1] = scale; } else { /* left part of the curve with a complete fall in fall_off_len * SIGMAs */ sigma = focus / (2 * fall_off_len); mean = focus / 2.0; delta = focus / 255.0; /* set the start */ brush->blend->positions [0] = 0.0; brush->blend->factors [0] = 0.0; curve_bottom = 0.5 * (1.0 + gdip_erf (0.0, sigma, mean)); curve_top = 0.5 * (1.0 + gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; for (index = 1, pos = delta; index < 255; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 + gdip_erf (pos, sigma, mean)) - curve_bottom); } brush->blend->positions [index] = focus; brush->blend->factors [index] = scale; /* right part of the curve with a complete fall in fall_off_len * SIGMAs */ sigma = (1.0 - focus) / (2 * fall_off_len); mean = (1.0 + focus) / 2.0; delta = (1.0 - focus) / 255.0; curve_bottom = 0.5 * (1.0 - gdip_erf (1.0, sigma, mean)); curve_top = 0.5 * (1.0 - gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; index ++; pos = focus + delta; for (; index < 510; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 - gdip_erf (pos, sigma, mean)) - curve_bottom); } /* set the end */ brush->blend->positions [count - 1] = 1.0; brush->blend->factors [count - 1] = 0.0; } brush->blend->count = count; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend (GpPathGradient *brush, REAL focus, REAL scale) { float *blends, *positions, *presetPositions; ARGB *presetColors; int count = 3; if (!brush || focus < 0 || focus > 1 || scale < 0 || scale > 1) return InvalidParameter; if (focus == 0 || focus == 1) { count = 2; } if (brush->blend->count != count) { blends = (float *) GdipAlloc (count * sizeof (float)); if (!blends) return OutOfMemory; positions = (float *) GdipAlloc (count * sizeof (float)); if (!positions) { GdipFree (blends); return OutOfMemory; } /* free the existing values */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); } brush->blend->factors = blends; brush->blend->positions = positions; } /* we clear the preset colors when setting the blend */ if (brush->presetColors->count != 1) { presetColors = (ARGB *) GdipAlloc (sizeof (ARGB)); if (!presetColors) return OutOfMemory; presetPositions = (float *) GdipAlloc (sizeof (float)); if (!presetPositions) { GdipFree (presetColors); return OutOfMemory; } GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); brush->presetColors->count = 1; brush->presetColors->colors = presetColors; brush->presetColors->positions = presetPositions; } brush->presetColors->colors [0] = 0x00000000; brush->presetColors->positions[0] = 0.0; /* set the blend colors */ if (focus == 0) { brush->blend->positions [0] = focus; brush->blend->factors [0] = scale; brush->blend->positions [1] = 1; brush->blend->factors [1] = 0; } else if (focus == 1) { brush->blend->positions [0] = 0; brush->blend->factors [0] = 0; brush->blend->positions [1] = focus; brush->blend->factors [1] = scale; } else { brush->blend->positions [0] = 0; brush->blend->factors [0] = 0; brush->blend->positions [1] = focus; brush->blend->factors [1] = scale; brush->blend->positions [2] = 1; brush->blend->factors [2] = 0; } brush->blend->count = count; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientWrapMode (GpPathGradient *brush, GpWrapMode *wrapMode) { if (!brush || !wrapMode) return InvalidParameter; *wrapMode = brush->wrapMode; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientWrapMode (GpPathGradient *brush, GpWrapMode wrapMode) { if (!brush) return InvalidParameter; if (wrapMode > WrapModeClamp) return Ok; brush->wrapMode = wrapMode; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientTransform (GpPathGradient *brush, GpMatrix *matrix) { if (!brush || !matrix) return InvalidParameter; gdip_cairo_matrix_copy (matrix, &brush->transform); return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientTransform (GpPathGradient *brush, GpMatrix *matrix) { BOOL invertible; if (!brush || !matrix) return InvalidParameter; /* the matrix MUST be invertible to be used */ GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; gdip_cairo_matrix_copy (&brush->transform, matrix); brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipResetPathGradientTransform (GpPathGradient *brush) { if (!brush) return InvalidParameter; cairo_matrix_init_identity (&brush->transform); brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform (GpPathGradient *brush, GDIPCONST GpMatrix *matrix, GpMatrixOrder order) { BOOL invertible; if (!brush) return InvalidParameter; if (!matrix) return Ok; GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; if (order == MatrixOrderPrepend) cairo_matrix_multiply (&brush->transform, matrix, &brush->transform); else cairo_matrix_multiply (&brush->transform, &brush->transform, matrix); brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipTranslatePathGradientTransform (GpPathGradient *brush, REAL dx, REAL dy, GpMatrixOrder order) { GpStatus status; if (!brush) return InvalidParameter; status = GdipTranslateMatrix (&brush->transform, dx, dy, order); if (status != Ok) return status; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipScalePathGradientTransform (GpPathGradient *brush, REAL sx, REAL sy, GpMatrixOrder order) { GpStatus status; if (!brush) return InvalidParameter; status = GdipScaleMatrix (&brush->transform, sx, sy, order); if (status != Ok) return status; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipRotatePathGradientTransform (GpPathGradient *brush, REAL angle, GpMatrixOrder order) { GpStatus status; if (!brush) return InvalidParameter; status = GdipRotateMatrix (&brush->transform, angle, order); if (status != Ok) return status; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPathGradientFocusScales (GpPathGradient *brush, REAL *xScale, REAL *yScale) { if (!brush || !xScale || !yScale) return InvalidParameter; *xScale = brush->focusScales.X; *yScale = brush->focusScales.Y; return Ok; } GpStatus WINGDIPAPI GdipSetPathGradientFocusScales (GpPathGradient *brush, REAL xScale, REAL yScale) { if (!brush) return InvalidParameter; brush->focusScales.X = xScale; brush->focusScales.Y = yScale; brush->base.changed = TRUE; return Ok; } libgdiplus-6.0.4+dfsg/src/graphics-pathiterator.h0000644000175000017500000000533513542674535022606 0ustar directhexdirecthex/* * 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. * * Authors: * Duncan Mak (duncan@ximian.com) * Ravindra (rkumar@novell.com) * Sebastien Pouliot * * Copyright (C) 2003, 2006-2007 Novell, Inc (http://www.novell.com) */ #ifndef __GRAPHICS_PATHITERATOR_H__ #define __GRAPHICS_PATHITERATOR_H__ GpStatus WINGDIPAPI GdipCreatePathIter (GpPathIterator **iterator, GpPath *path); GpStatus WINGDIPAPI GdipDeletePathIter (GpPathIterator *iterator); GpStatus WINGDIPAPI GdipPathIterGetCount (GpPathIterator *iterator, INT *count); GpStatus WINGDIPAPI GdipPathIterGetSubpathCount (GpPathIterator *iterator, INT *count); GpStatus WINGDIPAPI GdipPathIterCopyData (GpPathIterator *iterator, INT *resultCount, GpPointF *points, BYTE *types, INT startIndex, INT endIndex); GpStatus WINGDIPAPI GdipPathIterHasCurve (GpPathIterator *iterator, BOOL *hasCurve); GpStatus WINGDIPAPI GdipPathIterNextMarkerPath (GpPathIterator *iterator, INT *resultCount, GpPath *path); GpStatus WINGDIPAPI GdipPathIterNextMarker (GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex); GpStatus WINGDIPAPI GdipPathIterNextPathType (GpPathIterator *iterator, INT *resultCount, BYTE *pathType, INT *startIndex, INT *endIndex); GpStatus WINGDIPAPI GdipPathIterNextSubpathPath (GpPathIterator *iterator, INT *resultCount, GpPath *path, BOOL *isClosed); GpStatus WINGDIPAPI GdipPathIterNextSubpath (GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex, BOOL *isClosed); GpStatus WINGDIPAPI GdipPathIterEnumerate (GpPathIterator *iterator, INT *resultCount, GpPointF *points, BYTE *types, INT count); GpStatus WINGDIPAPI GdipPathIterRewind (GpPathIterator *iterator); /* missing API GdipPathIterIsValid */ #endif libgdiplus-6.0.4+dfsg/src/general.c0000644000175000017500000005240313545154623017702 0ustar directhexdirecthex/* * general.c * * Copyright (c) 2003 Alexandre Pigolkine * Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine(pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Sebastien Pouliot * Frederik Carlier */ #include "general-private.h" #include "codecs-private.h" #include "graphics-private.h" #include "font-private.h" #include "stringformat-private.h" #include "carbon-private.h" #ifdef WIN32 #include "win32-private.h" #endif /* large table to avoid a division and three multiplications when premultiplying alpha into R, G and B */ #include "alpha-premul-table.inc" BOOL gdiplusInitialized = FALSE; static BOOL suppressBackgroundThread = FALSE; GpStatus WINGDIPAPI GdiplusStartup (ULONG_PTR *token, const GdiplusStartupInput *input, GdiplusStartupOutput *output) { GpStatus status; if (!token || !input) return InvalidParameter; if (input->SuppressBackgroundThread && !output) return InvalidParameter; if (input->GdiplusVersion != 1 && input->GdiplusVersion != 2) return UnsupportedGdiplusVersion; /* Don't initialize multiple time, e.g. for each appdomain. */ if (gdiplusInitialized) return Ok; gdiplusInitialized = TRUE; status = initCodecList (); if (status != Ok) return status; FcInit (); /* A fontconfig instance which didn't find a configfile is unbelievably cranky, so let's just write out a small xml file and make fontconfig happy */ if (FcConfigFilename (0) == NULL) { /* Newer versions of font-config have FcConfigParseAndLoadFromMemory, which we could use to avoid generating a temporary file. But meanwhile, we are stuck with this workaround. */ char namebuf[512]; #ifdef WIN32 FILE *fi = CreateTempFile (namebuf); #else strcpy ((char *) namebuf, "/tmp/ffXXXXXX"); int fd = mkstemp ((char *) namebuf); FILE *fi = fdopen (fd, "wb"); #endif if (fi) { fprintf (fi, "\n"); fprintf (fi, "\n"); #if defined(WIN32) fprintf (fi, "WINDOWSFONTDIR\n"); #elif defined(__APPLE__) fprintf (fi, "/System/Library/Fonts\n"); #else fprintf (fi, "~/.fonts\n"); #endif #if defined(WIN32) fprintf (fi, "WINDOWSTEMPDIR_FONTCONFIG_CACHE\n"); #else fprintf (fi, "~/.fontconfig\n"); #endif fprintf (fi, "\n"); fclose (fi); FcConfig* c = FcConfigCreate (); FcConfigParseAndLoad (c, (FcChar8*)namebuf, 1); remove (namebuf); FcConfigBuildFonts (c); FcConfigSetCurrent (c); // FcConfig is reference-counted, so it's OK to call destroy here. FcConfigDestroy (c); } } gdip_get_display_dpi(); gdip_create_generic_stringformats (); if (input->SuppressBackgroundThread) { output->NotificationHook = GdiplusNotificationHook; output->NotificationUnhook = GdiplusNotificationUnhook; } *token = 1; suppressBackgroundThread = input->SuppressBackgroundThread; return Ok; } void WINGDIPAPI GdiplusShutdown (ULONG_PTR token) { if (gdiplusInitialized) { releaseCodecList (); gdip_font_clear_pattern_cache (); gdip_delete_system_fonts (); gdip_delete_generic_stringformats (); #if HAVE_FCFINI FcFini (); #endif gdiplusInitialized = FALSE; /* in case we want to restart it */ suppressBackgroundThread = FALSE; } } /* Memory */ WINGDIPAPI void * GdipAlloc (size_t size) { if (!gdiplusInitialized) return NULL; return malloc (size); } void * gdip_calloc (size_t nelem, size_t elsize) { return calloc (nelem, elsize); } void * gdip_realloc (void *org, int size) { return realloc (org, size); } WINGDIPAPI void GdipFree (void *ptr) { free (ptr); } GpStatus WINGDIPAPI GdiplusNotificationHook (ULONG_PTR *token) { if (!suppressBackgroundThread) return GenericError; if (!token) return InvalidParameter; /* Initialize the token with a dummy value. */ *token = 1; return Ok; } void WINGDIPAPI GdiplusNotificationUnhook (ULONG_PTR token) { /* Does nothing in libgdiplus. */ } /* libgdiplus-specific API */ WINGDIPAPI char* GetLibgdiplusVersion () { return g_strdup (VERSION); } /* Helpers */ GpStatus gdip_get_status (cairo_status_t status) { if (status == CAIRO_STATUS_SUCCESS) return Ok; else { switch (status) { case CAIRO_STATUS_NO_MEMORY: return OutOfMemory; case CAIRO_STATUS_INVALID_MATRIX: case CAIRO_STATUS_INVALID_RESTORE: case CAIRO_STATUS_INVALID_POP_GROUP: return InvalidParameter; case CAIRO_STATUS_NO_CURRENT_POINT: return WrongState; default: return GenericError; } } } float gdip_get_display_dpi () { static float dpis = 0; if (dpis == 0) { #if __APPLE__ float h_dpi, v_dpi; gdip_get_display_dpi_carbon (&h_dpi, &v_dpi); dpis = h_dpi; return dpis; #elif defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE char *val; Display* display; display = XOpenDisplay (0); /* If the display is openable lets try to read dpi from it; otherwise use a default of 96.0f */ if (display) { val = XGetDefault (display, "Xft", "dpi"); if (val) { dpis = atof (val); } else { dpis = 96.0f; } XCloseDisplay (display); } else { dpis = 96.0f; } #elif WIN32 dpis = gdip_get_display_dpi_win32 (); #else dpis = 96.0f; #endif } return dpis; } /* Curve handling * * See Richard Rasala, Explicit Cubic Spline Interpolation Formulas, in * Andrew S. Glassner, Graphics Gems, Academic Press, 1990, 579-584. * * and the Tangent class in JPT (http://www.ccs.neu.edu/jpt/jpt_2_3/index.htm) * */ GpPointF * convert_points (const GpPoint *point, int count) { if (!point || count < 0) return NULL; GpPointF *retval = (GpPointF *) GdipAlloc (sizeof (GpPointF) * count); if (!retval) return NULL; for (int i = 0; i < count; i++) gdip_PointF_from_Point (&point[i], &retval[i]); return retval; } GpRectF * convert_rects (const GpRect *rect, int count) { if (!rect || count < 0) return NULL; GpRectF *retval = (GpRectF *) GdipAlloc (sizeof (GpRectF) * count); if (!retval) return NULL; for (int i = 0; i < count; i++) gdip_RectF_from_Rect (&rect[i], &retval[i]); return retval; } GpPointF * gdip_open_curve_tangents (int terms, const GpPointF *points, int count, float tension) { float coefficient = tension / 3.0; int i; GpPointF *tangents = (GpPointF *) GdipAlloc (sizeof (GpPointF) * count); if (!tangents) return NULL; /* initialize everything to zero to begin with */ for (i = 0; i < count; i++) { tangents [i].X = 0; tangents [i].Y = 0; } if (count <= 2) return tangents; for (i = 0; i < count; i++) { int r = i + 1; int s = i - 1; if (r >= count) r = count - 1; if (s < 0) s = 0; tangents [i].X += (coefficient * (points [r].X - points [s].X)); tangents [i].Y += (coefficient * (points [r].Y - points [s].Y)); } return tangents; } GpPointF * gdip_closed_curve_tangents (int terms, const GpPointF *points, int count, float tension) { float coefficient = tension / 3.0; int i; GpPointF *tangents = (GpPointF *) GdipAlloc (sizeof (GpPointF) * count); if (!tangents) return NULL; /* initialize everything to zero to begin with */ for (i = 0; i < count; i++) { tangents [i].X = 0; tangents [i].Y = 0; } if (count <= 2) return tangents; for (i = 0; i < count; i++) { int r = i + 1; int s = i - 1; if (r >= count) r -= count; if (s < 0) s += count; tangents [i].X += (coefficient * (points [r].X - points [s].X)); tangents [i].Y += (coefficient * (points [r].Y - points [s].Y)); } return tangents; } /* note: round[f] is C99 */ int iround (float d) { double int_part = floor (d); return ((d - int_part) >= 0.5) ? int_part + 1.0 : int_part; } /* This function is used by gradient brushes for calculating the erf required for * calculating the integral of the normal distribution equation. */ float gdip_erf (float x, float std, float mean) { /* std refers to standard deviation * * ERF: http://mathworld.wolfram.com/Erf.html * * erf (z) = (2 / sqrt (pi)) * infinite sum of [(pow (-1, n) * pow (z, 2n+1))/(n! * (2n+1))] * using Maclaurin series. */ float series; float constant = 2.0 / sqrt (PI); float z = (x - mean) / std; z /= sqrt (2.0); series = (z - pow (z, 3) / 3.0 + pow (z, 5) / 10.0 - pow (z, 7) / 42.0 + pow (z, 9) / 216.0 - pow (z, 11) / 1420.0); return constant * series; } /* convert a utf16 string to utf8 length = number of characters to convert, -1 to indicate the whole string */ gchar * utf16_to_utf8(const gunichar2 *ucs2, int length) { const gunichar2 *ptr; const gunichar2 *end; gunichar *dest; gunichar *uni; gchar *utf8; /* Count length */ if (length == -1) { ptr = ucs2; length = 0; while (*ptr != 0) { ptr++; length++; } } uni = GdipAlloc((length + 1) * sizeof(gunichar)); if (uni == NULL) { return NULL; } dest = uni; ptr = ucs2; end = ptr + length; while (ptr != end) { if (*ptr < 0xd800 || *ptr >= 0xe000) { *dest = *ptr; dest++; } else if (ptr + 1 != end && ptr[1] < 0xe000 && ptr[1] >= 0xdc00) { /* UTF-16 support: Convert high and low surrogate to 32-bit code. */ *dest++ = ((gunichar)ptr[0] - 0xd800) * 0x400 + ((gunichar)ptr[1] - 0xdc00) + 0x10000; ptr++; } ptr++; } *dest = 0; dest++; utf8 = (gchar *) g_ucs4_to_utf8 ((const gunichar *)uni, -1, NULL, NULL, NULL); GdipFree(uni); return utf8; } BOOL utf8_to_ucs2(const gchar *utf8, gunichar2 *ucs2, int ucs2_len) { int i; glong items_read; glong count; gunichar *ucs4; gunichar2 *ptr; items_read = 0; count = 0; ucs2_len--; /* Space for null terminator */ ucs4 = g_utf8_to_ucs4(utf8, -1, &items_read, &count, NULL); if (ucs4 == NULL) { return FALSE; } ptr = (gunichar2 *)ucs2; for (i = 0; (i < count) && (i < ucs2_len); i++) { if (ucs4[i] < 0x10000 && !(ucs4[i] >= 0xd800 && ucs4[i] < 0xe000)) { *ptr = (gunichar2)ucs4[i]; ptr++; } /* we're simply ignoring any chars that don't fit into ucs2 */ } ucs2[i] = 0; /* terminate */ /* free the intermediate ucs4 string */ GdipFree(ucs4); return TRUE; } int utf8_encode_ucs2char(gunichar2 unichar, BYTE *dest) { if (unichar < 0x0080) { /* 0000-007F */ dest[0] = (BYTE)(unichar); return (1); } if(unichar < 0x0800) { /* 0080-07FF */ dest[0] = (BYTE)(0xC0 | ((unichar & 0x07C0) >> 6)); dest[1] = (BYTE)(0x80 | (unichar & 0x003F)); return (2); } /* 0800-FFFF */ dest[0] = (BYTE)(0xE0 | ((unichar & 0xF000) >> 12)); dest[1] = (BYTE)(0x80 | ((unichar & 0x0FC0) >> 6)); dest[2] = (BYTE)(0x80 | (unichar & 0x003F)); return (3); } GpStatus gdip_get_pattern_status (cairo_pattern_t *pat) { if (!pat) return OutOfMemory; switch (cairo_pattern_status (pat)) { case CAIRO_STATUS_SUCCESS: return Ok; case CAIRO_STATUS_NO_MEMORY: cairo_pattern_destroy (pat); return OutOfMemory; default: cairo_pattern_destroy (pat); return InvalidParameter; } } /* * Our anti-aliasing hack (adding an X and Y offset when drawing) cannot work if the current matrix * scales the coordinates. E.g. 0 scale 100 == 0, while (0 + 0.5) scale 100 == 50. */ BOOL gdip_is_scaled (GpGraphics *graphics) { cairo_matrix_t matrix; cairo_get_matrix (graphics->ct, &matrix); return ((matrix.xx != 1.0f) || (matrix.yy != 1.0f)); } /* cairo has a (signed) 15(1)/16(2)bits pixel positioning, while GDI+ use (signed) 23 bits (infinity). * Using larger values confuse the bits used for subpixel positioning. * (1) http://lists.freedesktop.org/archives/cairo/2006-June/007251.html * (2) testing shows artefacts if using more than 15 *signed* bits (i.e. -16384 to 16383) */ void gdip_cairo_rectangle (GpGraphics *graphics, double x, double y, double width, double height, BOOL antialiasing) { double x2, y2; /* avoid unit conversion whenever possible */ if (!OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); width = gdip_unitx_convgr (graphics, width); height = gdip_unity_convgr (graphics, height); } /* apply antialiasing offset (if required and if no scaling is in effect) */ if (antialiasing && !gdip_is_scaled (graphics)) { x += graphics->aa_offset_x; y += graphics->aa_offset_y; } /* ensure that each point (x,y and x+width,y+height) are within the 16 bits bounds */ x2 = x + width; y2 = y + height; /* put everything between cairo limits */ x = CAIRO_LIMIT (x); y = CAIRO_LIMIT (y); x2 = CAIRO_LIMIT (x2); y2 = CAIRO_LIMIT (y2); /* and recompute the final width and length */ cairo_rectangle (graphics->ct, x, y, (x2 - x), (y2 - y)); } void gdip_cairo_move_to (GpGraphics *graphics, double x, double y, BOOL convert_units, BOOL antialiasing) { /* avoid unit conversion whenever possible */ if (convert_units && !OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); } /* apply antialiasing offset (if required and if no scaling is in effect) */ if (antialiasing && !gdip_is_scaled (graphics)) { /* note that we can't add AA to a 0 position (or scaling will not work) */ x += graphics->aa_offset_x; y += graphics->aa_offset_y; } /* put everything between cairo limits */ x = CAIRO_LIMIT (x); y = CAIRO_LIMIT (y); cairo_move_to (graphics->ct, x, y); } void gdip_cairo_line_to (GpGraphics *graphics, double x, double y, BOOL convert_units, BOOL antialiasing) { /* avoid unit conversion whenever possible */ if (convert_units && !OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); } /* apply antialiasing offset (if required and if no scaling is in effect) */ if (antialiasing && !gdip_is_scaled (graphics)) { x += graphics->aa_offset_x; y += graphics->aa_offset_y; } /* put everything between cairo limits */ x = CAIRO_LIMIT (x); y = CAIRO_LIMIT (y); cairo_line_to (graphics->ct, x, y); } void gdip_cairo_curve_to (GpGraphics *graphics, double x1, double y1, double x2, double y2, double x3, double y3, BOOL convert_units, BOOL antialiasing) { /* avoid unit conversion whenever possible */ if (convert_units && !OPTIMIZE_CONVERSION (graphics)) { x1 = gdip_unitx_convgr (graphics, x1); y1 = gdip_unity_convgr (graphics, y1); x2 = gdip_unitx_convgr (graphics, x2); y2 = gdip_unity_convgr (graphics, y2); x3 = gdip_unitx_convgr (graphics, x3); y3 = gdip_unity_convgr (graphics, y3); } /* apply antialiasing offset (if required and if no scaling is in effect) */ if (antialiasing && !gdip_is_scaled (graphics)) { x1 += graphics->aa_offset_x; y1 += graphics->aa_offset_y; x2 += graphics->aa_offset_x; y2 += graphics->aa_offset_y; x3 += graphics->aa_offset_x; y3 += graphics->aa_offset_y; } /* put everything between cairo limits */ x1 = CAIRO_LIMIT (x1); y1 = CAIRO_LIMIT (y1); x2 = CAIRO_LIMIT (x2); y2 = CAIRO_LIMIT (y2); x3 = CAIRO_LIMIT (x3); y3 = CAIRO_LIMIT (y3); cairo_curve_to (graphics->ct, x1, y1, x2, y2, x3, y3); } void gdip_cairo_set_matrix (GpGraphics *graphics, GpMatrix *matrixPageUnits) { float x0 = matrixPageUnits->x0; float y0 = matrixPageUnits->y0; /* avoid unit conversion whenever possible */ if (!OPTIMIZE_CONVERSION (graphics)) { x0 = gdip_unitx_convgr (graphics, x0); y0 = gdip_unity_convgr (graphics, y0); } /* do not apply antialiasing trick to transformation matrix */ /* put everything between cairo limits */ x0 = CAIRO_LIMIT (x0); y0 = CAIRO_LIMIT (y0); GpMatrix matrixCopy; gdip_cairo_matrix_copy (&matrixCopy, matrixPageUnits); matrixCopy.x0 = x0; matrixCopy.y0 = y0; cairo_set_matrix (graphics->ct, &matrixCopy); } void gdip_RectF_from_Rect (const GpRect* rect, GpRectF* rectf) { rectf->X = rect->X; rectf->Y = rect->Y; rectf->Width = rect->Width; rectf->Height = rect->Height; } void gdip_Rect_from_RectF (const GpRectF* rectf, GpRect* rect) { rect->X = iround (rectf->X); rect->Y = iround (rectf->Y); rect->Width = iround (rectf->Width); rect->Height = iround (rectf->Height); } void gdip_PointF_from_Point (const GpPoint* point, GpPointF* pointf) { pointf->X = point->X; pointf->Y = point->Y; } void gdip_Point_from_PointF (const GpPointF* pointf, GpPoint* point) { point->X = iround (pointf->X); point->Y = iround (pointf->Y); } /* Pre-process negative width and height, without modifying the originals */ void gdip_normalize_rectangle (const GpRectF *rect, GpRectF *normalized) { float width = rect->Width; float height = rect->Height; if (width < 0) { normalized->X = rect->X + width; normalized->Width = fabs (width); } else { normalized->X = rect->X; normalized->Width = width; } if (rect->Height < 0) { normalized->Y = rect->Y + height; normalized->Height = fabs (height); } else { normalized->Y = rect->Y; normalized->Height = height; } } BOOL gdip_is_rectF_empty (const GpRectF *rect, BOOL allowNegative) { if (!rect) return FALSE; if (rect->Width == 0 || rect->Height == 0) return TRUE; return allowNegative && (rect->Width < 0 || rect->Height < 0); } static DWORD crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; DWORD gdip_crc32 (const BYTE *buf, size_t size) { // This is a modified version of the implementation of crc32 in the Darwin kernel. // The original code can be found at https://opensource.apple.com/source/xnu/xnu-792.13.8/bsd/libkern/crc32.c // The code has been modified to match GDI+ by setting the initial value to 0 and by returning // crc, instead of ~crc. DWORD crc = 0; while (size--) crc = crc32_tab[(crc ^ *buf++) & 0xFF] ^ (crc >> 8); return crc; } libgdiplus-6.0.4+dfsg/src/tiffcodec.c0000644000175000017500000012664013542674535020226 0ustar directhexdirecthex/* * * tiffcodec.c : Contains function definitions for encoding decoding tiff images * * * Copyright (C) Novell, Inc. 2003-2004. * * 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. * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Jordi Mas (jordi@ximian.com) * * Copyright (C) Novell, Inc. 2003-2004. */ #include "config.h" #include "codecs-private.h" #include "tiffcodec.h" GUID gdip_tif_image_format_guid = {0xb96b3cb1U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; #ifdef HAVE_LIBTIFF /* Thankfully, libtiff sucks far less than libjpeg */ #include #ifdef HAVE_BYTESWAP_H #include #endif #ifndef TIFFTAG_EXIFIFD #define TIFFTAG_EXIFIFD 34665 #endif /* Codecinfo related data*/ static ImageCodecInfo tiff_codec; static const WCHAR tiff_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'T', 'I', 'F', 'F', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in TIFF Codec */ static const WCHAR tiff_extension[] = {'*', '.', 'T', 'I', 'F',';', '*', '.', 'T', 'I', 'F','F', 0}; /* *.TIF;*.TIFF */ static const WCHAR tiff_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 't', 'i', 'f', 'f', 0}; /* image/tiff */ static const WCHAR tiff_format[] = {'T', 'I', 'F', 'F', 0}; /* TIFF */ static const BYTE tiff_sig_pattern[] = { 0x49, 0x49, 0x4D, 0x4D }; static const BYTE tiff_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF }; /*Wrapper functions and client data strucutre for delegate functions from StreamHelper class of System.Drawing Namespace*/ typedef struct { GetBytesDelegate getBytesFunc; PutBytesDelegate putBytesFunc; SeekDelegate seekFunc; CloseDelegate closeFunc; SizeDelegate sizeFunc; } gdip_tiff_clientData; static tsize_t gdip_tiff_fileread (thandle_t clientData, tdata_t buffer, tsize_t size) { return (tsize_t)fread(buffer, 1, size, (FILE*)clientData); } static tsize_t gdip_tiff_filewrite (thandle_t clientData, tdata_t buffer, tsize_t size) { return (tsize_t)fwrite (buffer, 1, size, (FILE*)clientData); } static toff_t gdip_tiff_fileseek (thandle_t clientData, toff_t offSet, int whence) { int seek_ok = fseek ((FILE*)clientData, offSet, whence); if (seek_ok == 0) return offSet; return -1; } static int gdip_tiff_fileclose (thandle_t clientData) { /* This is a TIFF cleanup function; but we own the FILE* and close it in image.c so this is a null op */ return 0; } static toff_t gdip_tiff_filesize (thandle_t clientData) { long ret; long cur_pos = ftell ((FILE*)clientData); fseek ((FILE*)clientData, 0, SEEK_END); ret = ftell ((FILE*)clientData); fseek ((FILE*)clientData, cur_pos, SEEK_SET); return (toff_t)ret; } static int gdip_tiff_filedummy_map (thandle_t clientData, tdata_t *phase, toff_t* size) { return 0; } static void gdip_tiff_filedummy_unmap (thandle_t clientData, tdata_t base, toff_t size) { } static tsize_t gdip_tiff_read (thandle_t clientData, tdata_t buffer, tsize_t size) { return (tsize_t)((gdip_tiff_clientData *) clientData)->getBytesFunc (buffer, size, 0); } static tsize_t gdip_tiff_read_none (thandle_t clientData, tdata_t buffer, tsize_t size) { return 0; } static tsize_t gdip_tiff_write (thandle_t clientData, tdata_t buffer, tsize_t size) { return (tsize_t)((gdip_tiff_clientData *) clientData)->putBytesFunc (buffer, size); } static toff_t gdip_tiff_seek (thandle_t clientData, toff_t offSet, int whence) { return (toff_t)((gdip_tiff_clientData *) clientData)->seekFunc (offSet, whence); } static int gdip_tiff_close (thandle_t clientData) { /* We should not close the user provided streams */ /* ((gdip_tiff_clientData *) clientData)->closeFunc (); */ return 1; } static toff_t gdip_tiff_size (thandle_t clientData) { return (toff_t)((gdip_tiff_clientData *) clientData)->sizeFunc (); } static int gdip_tiff_dummy_map (thandle_t clientData, tdata_t *phase, toff_t* size) { return 0; } static void gdip_tiff_dummy_unmap (thandle_t clientData, tdata_t base, toff_t size) { } ImageCodecInfo * gdip_getcodecinfo_tiff () { tiff_codec.Clsid = (CLSID) { 0x557cf405, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; tiff_codec.FormatID = gdip_tif_image_format_guid; tiff_codec.CodecName = (const WCHAR*) tiff_codecname; tiff_codec.DllName = NULL; tiff_codec.FormatDescription = (const WCHAR*) tiff_format; tiff_codec.FilenameExtension = (const WCHAR*) tiff_extension; tiff_codec.MimeType = (const WCHAR*) tiff_mimetype; tiff_codec.Flags = ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; tiff_codec.Version = 1; tiff_codec.SigCount = 2; tiff_codec.SigSize = 2; tiff_codec.SigPattern = tiff_sig_pattern; tiff_codec.SigMask = tiff_sig_mask; /* Mute the lib */ TIFFSetErrorHandler(NULL); TIFFSetWarningHandler(NULL); return &tiff_codec; } static GpStatus gdip_load_tiff_properties (TIFF *tiff, ActiveBitmapData *bitmap_data) { BYTE *text; uint32 i; uint16 s; uint16 s2; double d; float f; uint16 samples_per_pixel; uint16 bits_per_sample; uint16 planar_configuration; uint32 image_length; uint16 strips_per_image; uint32 rows_per_strip; uint32 tile_length; uint32 tile_width; uint16 compression = 0; samples_per_pixel = 0; bits_per_sample = 0; planar_configuration = 0; image_length = 0; strips_per_image = 0; rows_per_strip = 0; tile_length = 0; tile_width = 0; i = 0; s = 0; s2 = 0; if (TIFFGetField(tiff, TIFFTAG_ARTIST, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagArtist, text); } if (TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bits_per_sample)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagBitsPerSample, bits_per_sample); } { uint16 *rmap; uint16 *gmap; uint16 *bmap; if (TIFFGetField(tiff, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) { BYTE *buffer; uint16 *ptr; if ((rmap != NULL) && (gmap != NULL) && (bmap != NULL)) { buffer = GdipAlloc (3 * bits_per_sample * sizeof (uint16)); if (buffer != NULL) { ptr = (uint16 *)buffer; for (i = 0; i < bits_per_sample; i++) { ptr[0] = rmap[i]; ptr[1] = gmap[i]; ptr[2] = bmap[i]; ptr += 3; } gdip_bitmapdata_property_add(bitmap_data, PropertyTagColorMap, 3 * bits_per_sample * sizeof(uint16), PropertyTagTypeShort, buffer); GdipFree(buffer); } } } } if (TIFFGetField(tiff, TIFFTAG_COMPRESSION, &s)) { compression = s; gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagCompression, s); } if (TIFFGetField(tiff, TIFFTAG_COPYRIGHT, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagCopyright, text); } if (TIFFGetField(tiff, TIFFTAG_DATETIME, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagDateTime, text); } if (TIFFGetField(tiff, TIFFTAG_DOCUMENTNAME, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagDocumentName, text); } if (TIFFGetField(tiff, TIFFTAG_DOTRANGE, &s, &s2)) { gdip_bitmapdata_property_add_srational(bitmap_data, PropertyTagDotRange, s, s2); } { uint16 count; uint16 *samples; if (TIFFGetField(tiff, TIFFTAG_EXTRASAMPLES, &count, &samples)) { if ((count > 0) && (samples != NULL)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagExtraSamples, count * sizeof(uint16), PropertyTagTypeShort, samples); } } } if (TIFFGetField(tiff, TIFFTAG_FILLORDER, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagFillOrder, s); } if (TIFFGetField(tiff, TIFFTAG_GROUP3OPTIONS, &i, &i)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagT4Option, i); } if (TIFFGetField(tiff, TIFFTAG_GROUP4OPTIONS, &i)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagT6Option, i); } if (TIFFGetField(tiff, TIFFTAG_HALFTONEHINTS, &s, &s2)) { gdip_bitmapdata_property_add_srational(bitmap_data, PropertyTagHalftoneHints, s, s2); } if (TIFFGetField(tiff, TIFFTAG_HOSTCOMPUTER, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagHostComputer, text); } if (TIFFGetField(tiff, TIFFTAG_IMAGEDESCRIPTION, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagImageDescription, text); } if (TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &i)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagImageWidth, i); } if (TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &image_length)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagImageHeight, image_length); } if (TIFFGetField(tiff, TIFFTAG_INKNAMES, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagInkNames, text); } if (TIFFGetField(tiff, TIFFTAG_INKSET, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagInkSet, s); } #ifdef NotImplemented /* Don't know how this property should be stored, datatype is void */ { uint32 count; void *tables; if (TIFFGetField(tiff, TIFFTAG_JPEGTABLES, &count, &tables)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagJPEGTables, text); } } #endif if (TIFFGetField(tiff, TIFFTAG_JPEGQUALITY, &i)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagJPEGQuality, i); } if (TIFFGetField(tiff, TIFFTAG_MAKE, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagEquipMake, text); } if (TIFFGetField(tiff, TIFFTAG_MAXSAMPLEVALUE, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagMaxSampleValue, s); } if (TIFFGetField(tiff, TIFFTAG_MINSAMPLEVALUE, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagMinSampleValue, s); } if (TIFFGetField(tiff, TIFFTAG_MODEL, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagEquipModel, text); } if (TIFFGetField(tiff, TIFFTAG_ORIENTATION, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagOrientation, s); } if (TIFFGetField(tiff, TIFFTAG_PAGENAME, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagPageName, text); } if (TIFFGetField(tiff, TIFFTAG_PAGENUMBER, &s, &s2)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPageNumber, s); } if (TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPhotometricInterp, s); } if (TIFFGetField(tiff, TIFFTAG_PLANARCONFIG, &planar_configuration)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPlanarConfig, planar_configuration); } if (compression == COMPRESSION_ADOBE_DEFLATE) { if (TIFFGetField(tiff, TIFFTAG_PREDICTOR, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPredictor, s); } } { float *chromacities = NULL; /* 6-entry array */ if (TIFFGetField(tiff, TIFFTAG_PRIMARYCHROMATICITIES, &chromacities) && (chromacities != NULL)) { BYTE *buffer; uint32 *ptr; buffer = GdipAlloc(6 * (sizeof(uint32) + sizeof(uint32))); if (buffer != NULL) { ptr = (uint32 *)buffer; for (i = 0; i < 6; i++) { ptr[0] = (uint32)(chromacities[i] * 1000000); ptr[1] = 1000000; ptr += 2; } gdip_bitmapdata_property_add (bitmap_data, PropertyTagPrimaryChromaticities, 6 * (sizeof(uint32) + sizeof(uint32)), PropertyTagTypeRational, buffer); GdipFree(buffer); } } } if (TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagResolutionUnit, s); } if (TIFFGetField(tiff, TIFFTAG_ROWSPERSTRIP, &rows_per_strip)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagRowsPerStrip, rows_per_strip); } if (TIFFGetField(tiff, TIFFTAG_SAMPLEFORMAT, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagSampleFormat, s); } if (TIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagSamplesPerPixel, samples_per_pixel); } if (samples_per_pixel > 0) { float *ref_blackwhite; /* 2 * SamplesPerPixel array */ if (TIFFGetField(tiff, TIFFTAG_REFERENCEBLACKWHITE, &ref_blackwhite)) { BYTE *buffer; uint32 *ptr; buffer = GdipAlloc(2 * samples_per_pixel * (sizeof(uint32) + sizeof(uint32))); if (buffer != NULL) { ptr = (uint32 *)buffer; for (i = 0; i < 2 * samples_per_pixel; i++) { ptr[0] = (uint32)(ref_blackwhite[i] * 1000000); ptr[1] = 1000000; ptr += 2; } gdip_bitmapdata_property_add (bitmap_data, PropertyTagREFBlackWhite, 6 * (sizeof(uint32) + sizeof(uint32)), PropertyTagTypeRational, buffer); GdipFree(buffer); } } } if (TIFFGetField(tiff, TIFFTAG_SMAXSAMPLEVALUE, &d)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagSMaxSampleValue, d * 1000000, 1000000); } if (TIFFGetField(tiff, TIFFTAG_SMINSAMPLEVALUE, &d)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagSMinSampleValue, d * 1000000, 1000000); } if (TIFFGetField(tiff, TIFFTAG_SOFTWARE, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagSoftwareUsed, text); } if ((rows_per_strip != 0) && (planar_configuration != 0)) { uint32 *bytecounts; uint32 *offsets; int count; strips_per_image = floor ((image_length + rows_per_strip - 1) / rows_per_strip); if (planar_configuration == 1) { count = strips_per_image; } else { count = samples_per_pixel * strips_per_image; } if (TIFFGetField(tiff, TIFFTAG_STRIPBYTECOUNTS, &bytecounts)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagStripBytesCount, count * sizeof(uint32), PropertyTagTypeLong, bytecounts); } if (TIFFGetField(tiff, TIFFTAG_STRIPOFFSETS, &offsets)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagStripOffsets, count * sizeof(uint32), PropertyTagTypeLong, offsets); } } if (TIFFGetField(tiff, TIFFTAG_SUBFILETYPE, &i)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagNewSubfileType, i); } if (TIFFGetField(tiff, TIFFTAG_TARGETPRINTER, &text)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagTargetPrinter, text); } if (TIFFGetField(tiff, TIFFTAG_THRESHHOLDING, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagThreshHolding, s); } if (TIFFGetField(tiff, TIFFTAG_TILEWIDTH, &tile_width)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagTileWidth, tile_width); } if (TIFFGetField(tiff, TIFFTAG_TILELENGTH, &tile_length)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagTileLength, tile_length); } if ((planar_configuration != 0) && (tile_width != 0) && (tile_length != 0)) { uint32 *byte_counts; uint32 *offsets; uint32 tiles_across; uint32 tiles_down; int tiles_per_image; int count; tiles_across = (image_length + tile_width - 1) / tile_width; tiles_down = (image_length + tile_length - 1) / tile_length; tiles_per_image = tiles_across * tiles_down; if (planar_configuration == 1) { count = tiles_per_image; } else { count = samples_per_pixel * tiles_per_image; } if (TIFFGetField(tiff, TIFFTAG_TILEBYTECOUNTS, &byte_counts)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagTileByteCounts, count * sizeof(uint32), PropertyTagTypeLong, byte_counts); } if (TIFFGetField(tiff, TIFFTAG_TILEOFFSETS, &offsets)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagTileOffset, count * sizeof(uint32), PropertyTagTypeLong, offsets); } } if (samples_per_pixel == 1) { uint16 *sample; if (TIFFGetField(tiff, TIFFTAG_TRANSFERFUNCTION, &sample)) { gdip_bitmapdata_property_add (bitmap_data, PropertyTagTransferFuncition, (1 << bits_per_sample) * (ULONG) sizeof(uint16), PropertyTagTypeShort, sample); } } else if (samples_per_pixel == 3) { uint16 *r; uint16 *g; uint16 *b; if (TIFFGetField(tiff, TIFFTAG_TRANSFERFUNCTION, &r, &g, &b)) { BYTE *buffer; uint16 *ptr; buffer = GdipAlloc(3 * (1 << samples_per_pixel) * sizeof(uint16)); if (buffer != NULL) { ptr = (uint16 *)buffer; for (i = 0; i < 1 << bits_per_sample; i++) { ptr[i] = r[i]; ptr[i + 1] = g[i]; ptr[i + 2] = b[i]; } gdip_bitmapdata_property_add (bitmap_data, PropertyTagTransferFuncition, 3 * (1 << samples_per_pixel) * sizeof(uint16), PropertyTagTypeShort, buffer); GdipFree(buffer); } } } { float *whitepoints; if (TIFFGetField(tiff, TIFFTAG_WHITEPOINT, &whitepoints)) { BYTE *buffer; uint32 *ptr; buffer = GdipAlloc(2 * (sizeof(uint32) + sizeof(uint32))); if (buffer != NULL) { ptr = (uint32 *)buffer; ptr[0] = whitepoints[0] * 1000000; ptr[1] = 1000000; ptr[2] = whitepoints[1] * 1000000; ptr[3] = 1000000; gdip_bitmapdata_property_add (bitmap_data, PropertyTagTransferFuncition, 2 * (sizeof(uint32) + sizeof(uint32)), PropertyTagTypeRational, buffer); GdipFree(buffer); } gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagWhitePoint, whitepoints[0] * 1000000, 1000000); } } if (TIFFGetField(tiff, TIFFTAG_XPOSITION, &f)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagXPosition, f * 1000000, 1000000); } if (TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &f)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagXResolution, f, 1); } { float *coefficients; if (TIFFGetField(tiff, TIFFTAG_YCBCRCOEFFICIENTS, &coefficients)) { BYTE buffer[sizeof(uint32) * 6]; uint32 *ptr; ptr = (uint32 *)&buffer; ptr[0] = (uint32)(coefficients[0] * 1000000); ptr[1] = 1000000; ptr[2] = (uint32)(coefficients[1] * 1000000); ptr[3] = 1000000; ptr[4] = (uint32)(coefficients[2] * 1000000); ptr[5] = 1000000; gdip_bitmapdata_property_add(bitmap_data, PropertyTagYCbCrCoefficients, sizeof(uint32) * 6, PropertyTagTypeRational, buffer); } } if (TIFFGetField(tiff, TIFFTAG_YCBCRPOSITIONING, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagYCbCrPositioning, s); } if (TIFFGetField(tiff, TIFFTAG_YCBCRSUBSAMPLING, &s, &s2)) { gdip_bitmapdata_property_add_srational(bitmap_data, PropertyTagYCbCrSubsampling, s, s2); } if (TIFFGetField(tiff, TIFFTAG_YPOSITION, &f)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagYPosition, f * 1000000, 1000000); } if (TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &f)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagYResolution, f, 1); } #ifdef NotImplemented /* Not sure what type the data is */ { uint32 count; void *profile_data; if (TIFFGetField(tiff, TIFFTAG_ICCPROFILE, &count, &profile_data)) { gdip_bitmapdata_property_add(bitmap_data, PropertyTagICCProfile, count * sizeof(void *), , profile_data); } } #endif /* EXIF section */ if (TIFFGetField(tiff, TIFFTAG_EXIFIFD, &i)) { gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagExifIFD, i); } return Ok; } static GpStatus gdip_save_tiff_properties (TIFF *tiff, ActiveBitmapData *bitmap_data, int samples_per_pixel, int bits_per_sample) { int index; guint32 i; guint32 l; int j; uint16 s; uint16 s2; double d; float f; i = 0; s = 0; s2 = 0; d = 0; if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagArtist, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_ARTIST, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagCopyright, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_COPYRIGHT, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagDateTime, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_DATETIME, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagDocumentName, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_DOCUMENTNAME, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagDotRange, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); gdip_property_get_short(2, bitmap_data->property[index].value, &s2); TIFFSetField(tiff, TIFFTAG_DOTRANGE, s, s2); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagExtraSamples, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_EXTRASAMPLES, bitmap_data->property[index].length, bitmap_data->property[index].value); } else { TIFFSetField (tiff, TIFFTAG_EXTRASAMPLES, 1, EXTRASAMPLE_UNSPECIFIED); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagFillOrder, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_FILLORDER, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagT4Option, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &l); TIFFSetField(tiff, TIFFTAG_GROUP3OPTIONS, l); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagT6Option, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &l); TIFFSetField(tiff, TIFFTAG_GROUP4OPTIONS, l); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagHalftoneHints, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); gdip_property_get_short(2, bitmap_data->property[index].value, &s2); TIFFSetField(tiff, TIFFTAG_HALFTONEHINTS, s, s2); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagHostComputer, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_HOSTCOMPUTER, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagImageDescription, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_IMAGEDESCRIPTION, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagInkNames, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_INKNAMES, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagInkSet, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_INKSET, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagJPEGQuality, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &l); TIFFSetField(tiff, TIFFTAG_JPEGQUALITY, l); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagEquipMake, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_MAKE, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagMaxSampleValue, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_MAXSAMPLEVALUE, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagMinSampleValue, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_MINSAMPLEVALUE, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagEquipModel, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_MODEL, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagOrientation, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_ORIENTATION, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagPageName, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_PAGENAME, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagPhotometricInterp, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagPredictor, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_PREDICTOR, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagPrimaryChromaticities, &index) == Ok) { float chromacities[6]; for (j = 0; j < 6; j++) { gdip_property_get_long(j * 8, bitmap_data->property[index].value, &i); chromacities[j] = (float)i / 1000000; } TIFFSetField(tiff, TIFFTAG_PRIMARYCHROMATICITIES, &chromacities); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagResolutionUnit, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagSampleFormat, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, s); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagREFBlackWhite, &index) == Ok) { float *ref_blackwhite; /* 2 * SamplesPerPixel array */ ref_blackwhite = GdipAlloc(2 * samples_per_pixel * sizeof(float)); if (ref_blackwhite != NULL) { for (j = 0; j < (2 * samples_per_pixel); j++) { gdip_property_get_long(j * 8, bitmap_data->property[index].value, &i); ref_blackwhite[j] = (float)i / 1000000; } TIFFSetField(tiff, TIFFTAG_REFERENCEBLACKWHITE, &ref_blackwhite); GdipFree(ref_blackwhite); } } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagSMaxSampleValue, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); d = (double)i / 10000000; TIFFSetField(tiff, TIFFTAG_SMAXSAMPLEVALUE, d); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagSMinSampleValue, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); d = (double)i / 10000000; TIFFSetField(tiff, TIFFTAG_SMINSAMPLEVALUE, d); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagSoftwareUsed, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_SOFTWARE, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagNewSubfileType, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_SUBFILETYPE, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagNewSubfileType, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &l); TIFFSetField(tiff, TIFFTAG_SUBFILETYPE, l); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagTargetPrinter, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_TARGETPRINTER, bitmap_data->property[index].value); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagThreshHolding, &index) == Ok) { gdip_property_get_short(0, bitmap_data->property[index].value, &s); TIFFSetField(tiff, TIFFTAG_THRESHHOLDING, s); } if (samples_per_pixel == 1) { if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagTransferFuncition, &index) == Ok) { TIFFSetField(tiff, TIFFTAG_TRANSFERFUNCTION, bitmap_data->property[index].value); } } else if (samples_per_pixel == 3) { if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagTransferFuncition, &index) == Ok) { uint16 *rmap; uint16 *gmap; uint16 *bmap; rmap = GdipAlloc ((1 << samples_per_pixel) * (ULONG) sizeof (uint16)); gmap = GdipAlloc ((1 << samples_per_pixel) * (ULONG) sizeof (uint16)); bmap = GdipAlloc ((1 << samples_per_pixel) * (ULONG) sizeof (uint16)); if ((rmap != NULL) && (gmap != NULL) && (bmap != NULL)) { for (j = 0; j < 1 << bits_per_sample; j++) { gdip_property_get_short((j * 3), bitmap_data->property[index].value, &rmap[j]); gdip_property_get_short((j * 3) + 1, bitmap_data->property[index].value, &gmap[j]); gdip_property_get_short((j * 3) + 2, bitmap_data->property[index].value, &bmap[j]); } TIFFSetField(tiff, TIFFTAG_TRANSFERFUNCTION, rmap, gmap, bmap); } if (rmap != NULL) { GdipFree(rmap); } if (gmap != NULL) { GdipFree(gmap); } if (bmap != NULL) { GdipFree(bmap); } } } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagXPosition, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); f = (float)i / 10000000; TIFFSetField(tiff, TIFFTAG_XPOSITION, f); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagXResolution, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); f = (float)i; TIFFSetField(tiff, TIFFTAG_XRESOLUTION, f); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagYCbCrCoefficients, &index) == Ok) { float coefficients[3]; gdip_property_get_long(0, bitmap_data->property[index].value, &i); coefficients[0] = (float)i / 1000000; gdip_property_get_long(8, bitmap_data->property[index].value, &i); coefficients[1] = (float)i / 1000000; gdip_property_get_long(16, bitmap_data->property[index].value, &i); coefficients[2] = (float)i / 1000000; TIFFSetField(tiff, TIFFTAG_YCBCRCOEFFICIENTS, coefficients); } if (TIFFGetField(tiff, TIFFTAG_YCBCRPOSITIONING, &s)) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagYCbCrPositioning, s); } if (TIFFGetField(tiff, TIFFTAG_YCBCRSUBSAMPLING, &s, &s2)) { gdip_bitmapdata_property_add_srational(bitmap_data, PropertyTagYCbCrSubsampling, s, s2); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagYPosition, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); f = (float)i / 1000000; TIFFSetField(tiff, TIFFTAG_YPOSITION, f); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagYResolution, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); f = (float)i; TIFFSetField(tiff, TIFFTAG_YRESOLUTION, f); } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagExifIFD, &index) == Ok) { gdip_property_get_long(0, bitmap_data->property[index].value, &i); TIFFSetField(tiff, TIFFTAG_EXIFIFD, d); } return Ok; } /*TODO Handle TIFF Encoder Parameters*/ static GpStatus gdip_save_tiff_image (TIFF* tiff, GpImage *image, GDIPCONST EncoderParameters *params) { int frame; int x; int y; int i; int num_of_pages; int page; ActiveBitmapData *bitmap_data; BYTE *pixbuf; int samples_per_pixel; int bits_per_sample; unsigned long long int size; if (tiff == NULL) { return InvalidParameter; } /* Count all pages, we need to know ahead */ num_of_pages = 0; for (frame = 0; frame < image->num_of_frames; frame++) { num_of_pages += image->frames[frame].count; for (i = 0; i < image->frames[frame].count; i++) { if (gdip_is_an_indexed_pixelformat (image->frames[frame].bitmap[i].pixel_format)) { return NotImplemented; /* FIXME? */ } } } page = 0; for (frame = 0; frame < image->num_of_frames; frame++) { for (i = 0; i < image->frames[frame].count; i++) { bitmap_data = &image->frames[frame].bitmap[i]; if (num_of_pages > 1) { if ((frame > 0) && (i > 0)) { TIFFCreateDirectory(tiff); } TIFFSetField (tiff, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE); TIFFSetField (tiff, TIFFTAG_PAGENUMBER, page, num_of_pages); } if (((bitmap_data->pixel_format & PixelFormatAlpha) != 0) || (bitmap_data->pixel_format == PixelFormat32bppRGB)) { samples_per_pixel = 4; bits_per_sample = 8; } else { samples_per_pixel = 3; bits_per_sample = 8; } gdip_save_tiff_properties(tiff, bitmap_data, samples_per_pixel, bits_per_sample); TIFFSetField (tiff, TIFFTAG_SAMPLESPERPIXEL, samples_per_pixel); TIFFSetField (tiff, TIFFTAG_IMAGEWIDTH, bitmap_data->width); TIFFSetField (tiff, TIFFTAG_IMAGELENGTH, bitmap_data->height); TIFFSetField (tiff, TIFFTAG_BITSPERSAMPLE, bits_per_sample); TIFFSetField (tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE); TIFFSetField (tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); TIFFSetField (tiff, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField (tiff, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize (tiff, bitmap_data->stride)); TIFFSetField (tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); size = (unsigned long long int)bitmap_data->width * samples_per_pixel; if (size > G_MAXINT32) { goto error; } pixbuf = GdipAlloc (size); if (pixbuf == NULL) { goto error; } if (samples_per_pixel == 4) { for (y = 0; y < bitmap_data->height; y++) { for (x = 0; x < bitmap_data->width; x++) { #ifdef WORDS_BIGENDIAN pixbuf[x*4+0] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 1); pixbuf[x*4+1] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 2); pixbuf[x*4+2] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 3); pixbuf[x*4+3] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 0); #else pixbuf[x*4+0] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 2); pixbuf[x*4+1] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 1); pixbuf[x*4+2] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 0); pixbuf[x*4+3] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 3); #endif } TIFFWriteScanline (tiff, pixbuf, y, 0); } } else { for (y = 0; y < bitmap_data->height; y++) { for (x = 0; x < bitmap_data->width; x++) { #ifdef WORDS_BIGENDIAN pixbuf[x*3+0] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 1); pixbuf[x*3+1] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 2); pixbuf[x*3+2] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 3); #else pixbuf[x*3+0] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 2); pixbuf[x*3+1] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 1); pixbuf[x*3+2] = *((BYTE*)bitmap_data->scan0 + (bitmap_data->stride * y) + (x*4) + 0); #endif } TIFFWriteScanline (tiff, pixbuf, y, 0); } } GdipFree(pixbuf); TIFFWriteDirectory (tiff); page++; } } TIFFClose (tiff); return Ok; error: TIFFClose (tiff); return OutOfMemory; } static GpStatus gdip_load_tiff_image (TIFF *tiff, GpImage **image) { int i; char error_message[1024]; int num_of_pages; GpImage *result; int page; TIFFRGBAImage tiff_image; FrameData *frame; ActiveBitmapData *bitmap_data; char *pixbuf; char *pixbuf_row; guint32 *pixbuf_ptr; guint16 samples_per_pixel; float dpi; if (tiff == NULL) { *image = NULL; /* we cannot call TIFFClose(tiff); with a NULL value since it will crash - bnc #569940 */ return OutOfMemory; } result = NULL; pixbuf_row = NULL; pixbuf = NULL; memset (&tiff_image, 0, sizeof (TIFFRGBAImage)); num_of_pages = TIFFNumberOfDirectories(tiff); /* Handle cases where there are too many directories or there is a infinite loop in the directory structure. * This relies on libtiff returning 65535 in the error case, which has been the case since v4.0.4 released in 2015. */ if (num_of_pages >= 65535) goto error; result = gdip_bitmap_new(); if (!result) goto error; result->type = ImageTypeBitmap; frame = gdip_frame_add(result, &gdip_image_frameDimension_page_guid); if (!frame) goto error; for (page = 0; page < num_of_pages; page++) { unsigned long long int size; bitmap_data = gdip_frame_add_bitmapdata(frame); if (bitmap_data == NULL) { goto error; } if (!TIFFSetDirectory(tiff, page)) { goto error; } gdip_load_tiff_properties(tiff, bitmap_data); if (!TIFFRGBAImageBegin (&tiff_image, tiff, 0, error_message)) { goto error; } if (TIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel)) { if (samples_per_pixel != 4) { bitmap_data->pixel_format = PixelFormat24bppRGB; } else { bitmap_data->pixel_format = PixelFormat32bppARGB; bitmap_data->image_flags |= ImageFlagsHasAlpha; } } if (TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &dpi)) { bitmap_data->dpi_horz = dpi; } else { bitmap_data->dpi_horz = 0; } if (TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &dpi)) { bitmap_data->dpi_vert = dpi; } else { bitmap_data->dpi_vert = 0; } if (bitmap_data->dpi_horz && bitmap_data->dpi_vert) bitmap_data->image_flags |= ImageFlagsHasRealDPI; /* width and height are uint32, but TIFF uses 32 bits offsets (so it's real size limit is 4GB), * however libtiff uses signed int (int32 not uint32) as offsets so we limit ourselves to 2GB */ size = tiff_image.width; /* stride is a (signed) _int_ and once multiplied by 4 it should hold a value that can be allocated by GdipAlloc * this effectively limits 'width' to 536870911 pixels */ size *= sizeof (guint32); if (size > G_MAXINT32) goto error; bitmap_data->stride = size; bitmap_data->width = tiff_image.width; bitmap_data->height = tiff_image.height; bitmap_data->reserved = GBD_OWN_SCAN0; bitmap_data->image_flags |= ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly; /* ensure total 'size' does not overflow an integer and fits inside our 2GB limit */ size *= tiff_image.height; if (size > G_MAXINT32) goto error; pixbuf = GdipAlloc (size); if (pixbuf == NULL) { goto error; } /* Flip the image. TIFF has its origin at bottom left, and is in ARGB instead of ABGR */ if (!TIFFRGBAImageGet(&tiff_image, (uint32 *)pixbuf, tiff_image.width, tiff_image.height)) { goto error; } pixbuf_row = GdipAlloc(bitmap_data->stride); if (pixbuf_row == NULL) { goto error; } /* First, flip rows */ for (i = 0; i < tiff_image.height / 2; i++) { memcpy(pixbuf_row, pixbuf + (bitmap_data->stride * i), bitmap_data->stride); memcpy(pixbuf + (bitmap_data->stride * i), pixbuf + (bitmap_data->stride * (tiff_image.height - i - 1)), bitmap_data->stride); memcpy(pixbuf + (bitmap_data->stride * (tiff_image.height - i - 1)), pixbuf_row, bitmap_data->stride); } /* Now flip from ARGB to ABGR processing one pixel (4 bytes) at the time */ pixbuf_ptr = (guint32 *)pixbuf; for (i = 0; i < (size >> 2); i++) { *pixbuf_ptr = (*pixbuf_ptr & 0xff000000) | ((*pixbuf_ptr & 0x00ff0000) >> 16) | (*pixbuf_ptr & 0x0000ff00) | ((*pixbuf_ptr & 0x000000ff) << 16); pixbuf_ptr++; } GdipFree(pixbuf_row); bitmap_data->scan0 = (BYTE*) pixbuf; pixbuf_row = NULL; pixbuf = NULL; TIFFRGBAImageEnd (&tiff_image); } gdip_bitmap_setactive(result, &gdip_image_frameDimension_page_guid, 0); TIFFClose(tiff); *image = result; return Ok; error: /* coverity[dead_error_line] */ if (pixbuf_row != NULL) { GdipFree(pixbuf_row); } if (pixbuf != NULL) { GdipFree(pixbuf); } if (result != NULL) { gdip_bitmap_dispose(result); } TIFFRGBAImageEnd (&tiff_image); TIFFClose(tiff); return OutOfMemory; } GpStatus gdip_load_tiff_image_from_file (FILE *fp, GpImage **image) { TIFF *tif = NULL; tif = TIFFClientOpen("", "r", (thandle_t) fp, gdip_tiff_fileread, gdip_tiff_filewrite, gdip_tiff_fileseek, gdip_tiff_fileclose, gdip_tiff_filesize, gdip_tiff_filedummy_map, gdip_tiff_filedummy_unmap); return gdip_load_tiff_image (tif, image); } GpStatus gdip_save_tiff_image_to_file (BYTE *filename, GpImage *image, GDIPCONST EncoderParameters *params) { TIFF* tiff; tiff = TIFFOpen((char *)filename, "w"); if (!tiff) return FileNotFound; return gdip_save_tiff_image (tiff, image, params); } GpStatus gdip_load_tiff_image_from_stream_delegate (GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage **image) { TIFF *tif = NULL; gdip_tiff_clientData clientData; clientData.getBytesFunc = getBytesFunc; clientData.putBytesFunc = putBytesFunc; clientData.seekFunc = seekFunc; clientData.closeFunc = closeFunc; clientData.sizeFunc = sizeFunc; tif = TIFFClientOpen("", "r", (thandle_t) &clientData, gdip_tiff_read, gdip_tiff_write, gdip_tiff_seek, gdip_tiff_close, gdip_tiff_size, gdip_tiff_dummy_map, gdip_tiff_dummy_unmap); return gdip_load_tiff_image (tif, image); } GpStatus gdip_save_tiff_image_to_stream_delegate (GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage *image, GDIPCONST EncoderParameters *params) { TIFF* tiff; gdip_tiff_clientData clientData; clientData.getBytesFunc = getBytesFunc; clientData.putBytesFunc = putBytesFunc; clientData.seekFunc = seekFunc; clientData.closeFunc = closeFunc; clientData.sizeFunc = sizeFunc; tiff = TIFFClientOpen("", "w", (thandle_t) &clientData, gdip_tiff_read_none, gdip_tiff_write, gdip_tiff_seek, gdip_tiff_close, gdip_tiff_size, gdip_tiff_dummy_map, gdip_tiff_dummy_unmap); if (!tiff) return InvalidParameter; return gdip_save_tiff_image (tiff, image, params); } #else /* no libtiff */ #include "image.h" ImageCodecInfo * gdip_getcodecinfo_tiff () { return NULL; } GpStatus gdip_load_tiff_image_from_file (FILE *fp, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_load_tiff_image_from_stream_delegate (GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_save_tiff_image_to_file (BYTE *filename, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } GpStatus gdip_save_tiff_image_to_stream_delegate (GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } #endif GpStatus gdip_fill_encoder_parameter_list_tiff (EncoderParameters *buffer, UINT size) { TiffEncoderParameters *tiffBuffer = (TiffEncoderParameters *) buffer; if (!buffer || size != sizeof (TiffEncoderParameters)) return InvalidParameter; tiffBuffer->count = 4; tiffBuffer->compression.Guid = GdipEncoderCompression; tiffBuffer->compression.NumberOfValues = 5; tiffBuffer->compression.Type = EncoderParameterValueTypeLong; tiffBuffer->compressionData[0] = EncoderValueCompressionLZW; tiffBuffer->compressionData[1] = EncoderValueCompressionCCITT3; tiffBuffer->compressionData[2] = EncoderValueCompressionRle; tiffBuffer->compressionData[3] = EncoderValueCompressionCCITT4; tiffBuffer->compressionData[4] = EncoderValueCompressionNone; tiffBuffer->compression.Value = &tiffBuffer->compressionData; tiffBuffer->colorDepth.Guid = GdipEncoderColorDepth; tiffBuffer->colorDepth.NumberOfValues = 5; tiffBuffer->colorDepth.Type = EncoderParameterValueTypeLong; tiffBuffer->colorDepthData[0] = 1; tiffBuffer->colorDepthData[1] = 4; tiffBuffer->colorDepthData[2] = 8; tiffBuffer->colorDepthData[3] = 24; tiffBuffer->colorDepthData[4] = 32; tiffBuffer->colorDepth.Value = &tiffBuffer->colorDepthData; tiffBuffer->saveFlag.Guid = GdipEncoderSaveFlag; tiffBuffer->saveFlag.NumberOfValues = 1; tiffBuffer->saveFlag.Type = EncoderParameterValueTypeLong; tiffBuffer->saveFlagValue = EncoderValueMultiFrame; tiffBuffer->saveFlag.Value = &tiffBuffer->saveFlagValue; tiffBuffer->saveAsCYMK.Guid = GdipEncoderSaveAsCMYK; tiffBuffer->saveAsCYMK.NumberOfValues = 1; tiffBuffer->saveAsCYMK.Type = EncoderParameterValueTypeLong; tiffBuffer->saveAsCYMKValue = 1; tiffBuffer->saveAsCYMK.Value = &tiffBuffer->saveAsCYMKValue; return Ok; } libgdiplus-6.0.4+dfsg/src/fontcollection.h0000644000175000017500000000451013542674535021316 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __FONTCOLLECTION_H__ #define __FONTCOLLECTION_H__ /* FontCollection public API (only!) */ GpStatus WINGDIPAPI GdipDeletePrivateFontCollection (GpFontCollection **fontCollection); GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount (GpFontCollection *fontCollection, INT *numFound); GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList (GpFontCollection *fontCollection, INT numSought, GpFontFamily *gpfamilies[], INT *numFound); GpStatus WINGDIPAPI GdipNewInstalledFontCollection (GpFontCollection **fontCollection); GpStatus WINGDIPAPI GdipNewPrivateFontCollection (GpFontCollection **fontCollection); GpStatus WINGDIPAPI GdipPrivateAddFontFile (GpFontCollection *fontCollection, GDIPCONST WCHAR *filename); GpStatus WINGDIPAPI GdipPrivateAddMemoryFont (GpFontCollection *fontCollection, GDIPCONST void *memory, INT length); #endif libgdiplus-6.0.4+dfsg/src/solidbrush.h0000644000175000017500000000300613233636545020445 0ustar directhexdirecthex/* * 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. * * Authors: * Ravindra (rkumar@novell.com) * Sebastien Pouliot * * Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef __SOLIDBRUSH_H__ #define __SOLIDBRUSH_H__ #include "brush.h" GpStatus WINGDIPAPI GdipCreateSolidFill (ARGB color, GpSolidFill **brush); GpStatus WINGDIPAPI GdipGetSolidFillColor (GpSolidFill *brush, ARGB *color); GpStatus WINGDIPAPI GdipSetSolidFillColor (GpSolidFill *brush, ARGB color); #endif libgdiplus-6.0.4+dfsg/src/gifcodec.c0000644000175000017500000013243713542674535020044 0ustar directhexdirecthex/* * gifcodec.c : Contains function definitions for encoding decoding gif images * * Copyright (C) 2003-2004,2007 Novell, Inc (http://www.novell.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. * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Jordi Mas (jordi@ximian.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot */ #include "config.h" #include "codecs-private.h" #include "gifcodec.h" GUID gdip_gif_image_format_guid = {0xb96b3cb0U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; #ifdef HAVE_LIBGIF #include #include #include "gifcodec.h" /* START GifQuantizeBuffer copy from giflib The giflib 5.2.0 release notes mention: > The undocumented and deprecated GifQuantizeBuffer() entry point > has been moved to the util library to reduce libgif size and attack > surface. Applications needing this function are couraged to link the > util library or make their own copy. Since the util library doesn't get installed in most distros we can't link against it and need to make our own copy called LibgdiplusGifQuantizeBuffer. This is taken from giflib 52b62de83d5facbbbde042b85bf3f61182e3bebd. > The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond > > 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. */ /***************************************************************************** quantize.c - quantize a high resolution image into lower one Based on: "Color Image Quantization for frame buffer Display", by Paul Heckbert SIGGRAPH 1982 page 297-307. This doesn't really belong in the core library, was undocumented, and was removed in 4.2. Then it turned out some client apps were actually using it, so it was restored in 5.0. SPDX-License-Identifier: MIT ******************************************************************************/ #include #include #include "gif_lib.h" //#include "gif_lib_private.h" //#define ABS(x) ((x) > 0 ? (x) : (-(x))) #define COLOR_ARRAY_SIZE 32768 #define BITS_PER_PRIM_COLOR 5 #define MAX_PRIM_COLOR 0x1f static int SortRGBAxis; typedef struct QuantizedColorType { GifByteType RGB[3]; GifByteType NewColorIndex; long Count; struct QuantizedColorType *Pnext; } QuantizedColorType; typedef struct NewColorMapType { GifByteType RGBMin[3], RGBWidth[3]; unsigned int NumEntries; /* # of QuantizedColorType in linked list below */ unsigned long Count; /* Total number of pixels in all the entries */ QuantizedColorType *QuantizedColors; } NewColorMapType; static int SubdivColorMap(NewColorMapType * NewColorSubdiv, unsigned int ColorMapSize, unsigned int *NewColorMapSize); static int SortCmpRtn(const void *Entry1, const void *Entry2); /****************************************************************************** Quantize high resolution image into lower one. Input image consists of a 2D array for each of the RGB colors with size Width by Height. There is no Color map for the input. Output is a quantized image with 2D array of indexes into the output color map. Note input image can be 24 bits at the most (8 for red/green/blue) and the output has 256 colors at the most (256 entries in the color map.). ColorMapSize specifies size of color map up to 256 and will be updated to real size before returning. Also non of the parameter are allocated by this routine. This function returns GIF_OK if successful, GIF_ERROR otherwise. ******************************************************************************/ int LibgdiplusGifQuantizeBuffer(unsigned int Width, unsigned int Height, int *ColorMapSize, GifByteType * RedInput, GifByteType * GreenInput, GifByteType * BlueInput, GifByteType * OutputBuffer, GifColorType * OutputColorMap) { unsigned int Index, NumOfEntries; int i, j, MaxRGBError[3]; unsigned int NewColorMapSize; long Red, Green, Blue; NewColorMapType NewColorSubdiv[256]; QuantizedColorType *ColorArrayEntries, *QuantizedColor; ColorArrayEntries = (QuantizedColorType *)malloc( sizeof(QuantizedColorType) * COLOR_ARRAY_SIZE); if (ColorArrayEntries == NULL) { return GIF_ERROR; } for (i = 0; i < COLOR_ARRAY_SIZE; i++) { ColorArrayEntries[i].RGB[0] = i >> (2 * BITS_PER_PRIM_COLOR); ColorArrayEntries[i].RGB[1] = (i >> BITS_PER_PRIM_COLOR) & MAX_PRIM_COLOR; ColorArrayEntries[i].RGB[2] = i & MAX_PRIM_COLOR; ColorArrayEntries[i].Count = 0; } /* Sample the colors and their distribution: */ for (i = 0; i < (int)(Width * Height); i++) { Index = ((RedInput[i] >> (8 - BITS_PER_PRIM_COLOR)) << (2 * BITS_PER_PRIM_COLOR)) + ((GreenInput[i] >> (8 - BITS_PER_PRIM_COLOR)) << BITS_PER_PRIM_COLOR) + (BlueInput[i] >> (8 - BITS_PER_PRIM_COLOR)); ColorArrayEntries[Index].Count++; } /* Put all the colors in the first entry of the color map, and call the * recursive subdivision process. */ for (i = 0; i < 256; i++) { NewColorSubdiv[i].QuantizedColors = NULL; NewColorSubdiv[i].Count = NewColorSubdiv[i].NumEntries = 0; for (j = 0; j < 3; j++) { NewColorSubdiv[i].RGBMin[j] = 0; NewColorSubdiv[i].RGBWidth[j] = 255; } } /* Find the non empty entries in the color table and chain them: */ for (i = 0; i < COLOR_ARRAY_SIZE; i++) if (ColorArrayEntries[i].Count > 0) break; QuantizedColor = NewColorSubdiv[0].QuantizedColors = &ColorArrayEntries[i]; NumOfEntries = 1; while (++i < COLOR_ARRAY_SIZE) if (ColorArrayEntries[i].Count > 0) { QuantizedColor->Pnext = &ColorArrayEntries[i]; QuantizedColor = &ColorArrayEntries[i]; NumOfEntries++; } QuantizedColor->Pnext = NULL; NewColorSubdiv[0].NumEntries = NumOfEntries; /* Different sampled colors */ NewColorSubdiv[0].Count = ((long)Width) * Height; /* Pixels */ NewColorMapSize = 1; if (SubdivColorMap(NewColorSubdiv, *ColorMapSize, &NewColorMapSize) != GIF_OK) { free((char *)ColorArrayEntries); return GIF_ERROR; } if (NewColorMapSize < *ColorMapSize) { /* And clear rest of color map: */ for (i = NewColorMapSize; i < *ColorMapSize; i++) OutputColorMap[i].Red = OutputColorMap[i].Green = OutputColorMap[i].Blue = 0; } /* Average the colors in each entry to be the color to be used in the * output color map, and plug it into the output color map itself. */ for (i = 0; i < NewColorMapSize; i++) { if ((j = NewColorSubdiv[i].NumEntries) > 0) { QuantizedColor = NewColorSubdiv[i].QuantizedColors; Red = Green = Blue = 0; while (QuantizedColor) { QuantizedColor->NewColorIndex = i; Red += QuantizedColor->RGB[0]; Green += QuantizedColor->RGB[1]; Blue += QuantizedColor->RGB[2]; QuantizedColor = QuantizedColor->Pnext; } OutputColorMap[i].Red = (Red << (8 - BITS_PER_PRIM_COLOR)) / j; OutputColorMap[i].Green = (Green << (8 - BITS_PER_PRIM_COLOR)) / j; OutputColorMap[i].Blue = (Blue << (8 - BITS_PER_PRIM_COLOR)) / j; } } /* Finally scan the input buffer again and put the mapped index in the * output buffer. */ MaxRGBError[0] = MaxRGBError[1] = MaxRGBError[2] = 0; for (i = 0; i < (int)(Width * Height); i++) { Index = ((RedInput[i] >> (8 - BITS_PER_PRIM_COLOR)) << (2 * BITS_PER_PRIM_COLOR)) + ((GreenInput[i] >> (8 - BITS_PER_PRIM_COLOR)) << BITS_PER_PRIM_COLOR) + (BlueInput[i] >> (8 - BITS_PER_PRIM_COLOR)); Index = ColorArrayEntries[Index].NewColorIndex; OutputBuffer[i] = Index; if (MaxRGBError[0] < ABS(OutputColorMap[Index].Red - RedInput[i])) MaxRGBError[0] = ABS(OutputColorMap[Index].Red - RedInput[i]); if (MaxRGBError[1] < ABS(OutputColorMap[Index].Green - GreenInput[i])) MaxRGBError[1] = ABS(OutputColorMap[Index].Green - GreenInput[i]); if (MaxRGBError[2] < ABS(OutputColorMap[Index].Blue - BlueInput[i])) MaxRGBError[2] = ABS(OutputColorMap[Index].Blue - BlueInput[i]); } #ifdef DEBUG fprintf(stderr, "Quantization L(0) errors: Red = %d, Green = %d, Blue = %d.\n", MaxRGBError[0], MaxRGBError[1], MaxRGBError[2]); #endif /* DEBUG */ free((char *)ColorArrayEntries); *ColorMapSize = NewColorMapSize; return GIF_OK; } /****************************************************************************** Routine to subdivide the RGB space recursively using median cut in each axes alternatingly until ColorMapSize different cubes exists. The biggest cube in one dimension is subdivide unless it has only one entry. Returns GIF_ERROR if failed, otherwise GIF_OK. *******************************************************************************/ static int SubdivColorMap(NewColorMapType * NewColorSubdiv, unsigned int ColorMapSize, unsigned int *NewColorMapSize) { unsigned int i, j, Index = 0; QuantizedColorType *QuantizedColor, **SortArray; while (ColorMapSize > *NewColorMapSize) { /* Find candidate for subdivision: */ long Sum, Count; int MaxSize = -1; unsigned int NumEntries, MinColor, MaxColor; for (i = 0; i < *NewColorMapSize; i++) { for (j = 0; j < 3; j++) { if ((((int)NewColorSubdiv[i].RGBWidth[j]) > MaxSize) && (NewColorSubdiv[i].NumEntries > 1)) { MaxSize = NewColorSubdiv[i].RGBWidth[j]; Index = i; SortRGBAxis = j; } } } if (MaxSize == -1) return GIF_OK; /* Split the entry Index into two along the axis SortRGBAxis: */ /* Sort all elements in that entry along the given axis and split at * the median. */ SortArray = (QuantizedColorType **)malloc( sizeof(QuantizedColorType *) * NewColorSubdiv[Index].NumEntries); if (SortArray == NULL) return GIF_ERROR; for (j = 0, QuantizedColor = NewColorSubdiv[Index].QuantizedColors; j < NewColorSubdiv[Index].NumEntries && QuantizedColor != NULL; j++, QuantizedColor = QuantizedColor->Pnext) SortArray[j] = QuantizedColor; /* * Because qsort isn't stable, this can produce differing * results for the order of tuples depending on platform * details of how qsort() is implemented. * * We mitigate this problem by sorting on all three axes rather * than only the one specied by SortRGBAxis; that way the instability * can only become an issue if there are multiple color indices * referring to identical RGB tuples. Older versions of this * sorted on only the one axis. */ qsort(SortArray, NewColorSubdiv[Index].NumEntries, sizeof(QuantizedColorType *), SortCmpRtn); /* Relink the sorted list into one: */ for (j = 0; j < NewColorSubdiv[Index].NumEntries - 1; j++) SortArray[j]->Pnext = SortArray[j + 1]; SortArray[NewColorSubdiv[Index].NumEntries - 1]->Pnext = NULL; NewColorSubdiv[Index].QuantizedColors = QuantizedColor = SortArray[0]; free((char *)SortArray); /* Now simply add the Counts until we have half of the Count: */ Sum = NewColorSubdiv[Index].Count / 2 - QuantizedColor->Count; NumEntries = 1; Count = QuantizedColor->Count; while (QuantizedColor->Pnext != NULL && (Sum -= QuantizedColor->Pnext->Count) >= 0 && QuantizedColor->Pnext->Pnext != NULL) { QuantizedColor = QuantizedColor->Pnext; NumEntries++; Count += QuantizedColor->Count; } /* Save the values of the last color of the first half, and first * of the second half so we can update the Bounding Boxes later. * Also as the colors are quantized and the BBoxes are full 0..255, * they need to be rescaled. */ MaxColor = QuantizedColor->RGB[SortRGBAxis]; /* Max. of first half */ /* coverity[var_deref_op] */ MinColor = QuantizedColor->Pnext->RGB[SortRGBAxis]; /* of second */ MaxColor <<= (8 - BITS_PER_PRIM_COLOR); MinColor <<= (8 - BITS_PER_PRIM_COLOR); /* Partition right here: */ NewColorSubdiv[*NewColorMapSize].QuantizedColors = QuantizedColor->Pnext; QuantizedColor->Pnext = NULL; NewColorSubdiv[*NewColorMapSize].Count = Count; NewColorSubdiv[Index].Count -= Count; NewColorSubdiv[*NewColorMapSize].NumEntries = NewColorSubdiv[Index].NumEntries - NumEntries; NewColorSubdiv[Index].NumEntries = NumEntries; for (j = 0; j < 3; j++) { NewColorSubdiv[*NewColorMapSize].RGBMin[j] = NewColorSubdiv[Index].RGBMin[j]; NewColorSubdiv[*NewColorMapSize].RGBWidth[j] = NewColorSubdiv[Index].RGBWidth[j]; } NewColorSubdiv[*NewColorMapSize].RGBWidth[SortRGBAxis] = NewColorSubdiv[*NewColorMapSize].RGBMin[SortRGBAxis] + NewColorSubdiv[*NewColorMapSize].RGBWidth[SortRGBAxis] - MinColor; NewColorSubdiv[*NewColorMapSize].RGBMin[SortRGBAxis] = MinColor; NewColorSubdiv[Index].RGBWidth[SortRGBAxis] = MaxColor - NewColorSubdiv[Index].RGBMin[SortRGBAxis]; (*NewColorMapSize)++; } return GIF_OK; } /**************************************************************************** Routine called by qsort to compare two entries. *****************************************************************************/ static int SortCmpRtn(const void *Entry1, const void *Entry2) { QuantizedColorType *entry1 = (*((QuantizedColorType **) Entry1)); QuantizedColorType *entry2 = (*((QuantizedColorType **) Entry2)); /* sort on all axes of the color space! */ int hash1 = entry1->RGB[SortRGBAxis] * 256 * 256 + entry1->RGB[(SortRGBAxis+1) % 3] * 256 + entry1->RGB[(SortRGBAxis+2) % 3]; int hash2 = entry2->RGB[SortRGBAxis] * 256 * 256 + entry2->RGB[(SortRGBAxis+1) % 3] * 256 + entry2->RGB[(SortRGBAxis+2) % 3]; return hash1 - hash2; } /* END GifQuantizeBuffer copy from giflib */ /* Data structure used for callback */ typedef struct { GetBytesDelegate getBytesFunc; SeekDelegate seekFunc; } gif_callback_data; /* Codecinfo related data*/ static ImageCodecInfo gif_codec; static const WCHAR gif_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'G', 'I', 'F', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in GIF Codec */ static const WCHAR gif_extension[] = {'*', '.', 'G', 'I', 'F',0}; /* *.GIF */ static const WCHAR gif_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'g', 'i', 'f', 0}; /* image/gif */ static const WCHAR gif_format[] = {'G', 'I', 'F', 0}; /* GIF */ static const BYTE gif_sig_pattern[] = { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }; static const BYTE gif_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; ImageCodecInfo * gdip_getcodecinfo_gif () { gif_codec.Clsid = (CLSID) { 0x557cf402, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; gif_codec.FormatID = gdip_gif_image_format_guid; gif_codec.CodecName = (const WCHAR*) gif_codecname; gif_codec.DllName = NULL; gif_codec.FormatDescription = (const WCHAR*) gif_format; gif_codec.FilenameExtension = (const WCHAR*) gif_extension; gif_codec.MimeType = (const WCHAR*) gif_mimetype; gif_codec.Flags = ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; gif_codec.Version = 1; gif_codec.SigCount = 2; gif_codec.SigSize = 6; gif_codec.SigPattern = gif_sig_pattern; gif_codec.SigMask = gif_sig_mask; return &gif_codec; } /* Read callback function for the gif libbrary*/ static int gdip_gif_fileinputfunc (GifFileType *gif, GifByteType *data, int len) { return fread (data, 1, len, (FILE*) gif->UserData); } static int gdip_gif_inputfunc (GifFileType *gif, GifByteType *data, int len) { int read = 0; gif_callback_data *gcd = (gif_callback_data*) gif->UserData; read = gcd->getBytesFunc (data, len, 0); return read; } /* This is the DGifSlurp and AddExtensionBlock code courtesy of giflib, It's modified to not dump comments after the image block, since those are still valid */ static int AddExtensionBlockMono(SavedImage *New, int Function, int Len, BYTE ExtData[]) { ExtensionBlock *ep; if (New->ExtensionBlocks == NULL) { New->ExtensionBlocks=(ExtensionBlock *)GdipAlloc(sizeof(ExtensionBlock)); } else { New->ExtensionBlocks = (ExtensionBlock*) gdip_realloc (New->ExtensionBlocks, sizeof(ExtensionBlock) * (New->ExtensionBlockCount + 1)); } if (New->ExtensionBlocks == NULL) { return (GIF_ERROR); } ep = &New->ExtensionBlocks[New->ExtensionBlockCount++]; ep->Function = Function; ep->ByteCount=Len; #if GIFLIB_MAJOR >= 5 ep->Bytes = (GifByteType *)GdipAlloc(ep->ByteCount); #else ep->Bytes = (char *)GdipAlloc(ep->ByteCount); #endif if (ep->Bytes == NULL) { return (GIF_ERROR); } if (ExtData) { memcpy(ep->Bytes, ExtData, Len); } return (GIF_OK); } static void FreeExtensionMono(SavedImage *Image) { ExtensionBlock *ep; if ((Image == NULL) || (Image->ExtensionBlocks == NULL)) { return; } for (ep = Image->ExtensionBlocks; ep < (Image->ExtensionBlocks + Image->ExtensionBlockCount); ep++) { (void)GdipFree((char *)ep->Bytes); } GdipFree((char *)Image->ExtensionBlocks); Image->ExtensionBlocks = NULL; } #ifndef SIZE_MAX #define SIZE_MAX UINTPTR_MAX #endif static int DGifSlurpMono(GifFileType * GifFile, SavedImage *TrailingExtensions) { int ImageSize; int Function; GifRecordType RecordType; SavedImage *sp; GifByteType *ExtData; SavedImage temp_save; temp_save.ExtensionBlocks = NULL; temp_save.ExtensionBlockCount = 0; if (TrailingExtensions != NULL) { TrailingExtensions->ExtensionBlocks = NULL; TrailingExtensions->ExtensionBlockCount = 0; } sp = NULL; do { if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) { return (GIF_ERROR); } switch (RecordType) { case IMAGE_DESC_RECORD_TYPE: { if (DGifGetImageDesc(GifFile) == GIF_ERROR) { return (GIF_ERROR); } sp = &GifFile->SavedImages[GifFile->ImageCount - 1]; /* Allocate memory for the image */ if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 && sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) { return GIF_ERROR; } ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height; if (ImageSize == 0 || ImageSize > (SIZE_MAX / sizeof(GifPixelType))) { return GIF_ERROR; } sp->RasterBits = (BYTE *) GdipAlloc (ImageSize * sizeof(GifPixelType)); if (sp->RasterBits == NULL) { return GIF_ERROR; } if (sp->ImageDesc.Interlace) { int i, j; /* * The way an interlaced image should be read - * offsets and jumps... */ int InterlacedOffset[] = { 0, 4, 2, 1 }; int InterlacedJumps[] = { 8, 8, 4, 2 }; /* Need to perform 4 passes on the image */ for (i = 0; i < 4; i++) { for (j = InterlacedOffset[i]; j < sp->ImageDesc.Height; j += InterlacedJumps[i]) { if (DGifGetLine(GifFile, sp->RasterBits + j * sp->ImageDesc.Width, sp->ImageDesc.Width) == GIF_ERROR) return GIF_ERROR; } } } else if (DGifGetLine(GifFile, sp->RasterBits, ImageSize) == GIF_ERROR) { return (GIF_ERROR); } if (temp_save.ExtensionBlocks) { sp->ExtensionBlocks = temp_save.ExtensionBlocks; sp->ExtensionBlockCount = temp_save.ExtensionBlockCount; temp_save.ExtensionBlocks = NULL; temp_save.ExtensionBlockCount = 0; } break; } case EXTENSION_RECORD_TYPE: { if (DGifGetExtension(GifFile, &Function, &ExtData) == GIF_ERROR) { return (GIF_ERROR); } while (ExtData != NULL) { /* Create an extension block with our data */ if (AddExtensionBlockMono(&temp_save, Function, ExtData[0], &ExtData[1]) == GIF_ERROR) { return (GIF_ERROR); } if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) { return (GIF_ERROR); } /* Graphics control blocks cannot contain any sub blocks. */ if (Function == 0xF9 && ExtData) { return GIF_ERROR; } } break; } case TERMINATE_RECORD_TYPE: { break; } default: { /* Should be trapped by DGifGetRecordType */ break; } } } while (RecordType != TERMINATE_RECORD_TYPE); /* The gif file must contain at least one image block. */ if (GifFile->ImageCount == 0) return GIF_ERROR; /* In case the Gif has an extension block without an associated * image we return it in TrailingExtensions, if provided */ if ((TrailingExtensions != NULL) && (temp_save.ExtensionBlocks != NULL)) { *TrailingExtensions = temp_save; } return (GIF_OK); } static GpStatus gdip_load_gif_image (void *stream, GpImage **image, BOOL from_file) { GpStatus status; GifFileType *gif; BYTE *readptr; BYTE *writeptr; int i; int l; int num_of_images; BOOL animated; const GUID *dimension; FrameData *frame; GpBitmap *result; ActiveBitmapData *bitmap_data; SavedImage si; SavedImage global_extensions; ColorPalette *global_palette; BOOL loop_counter; unsigned short loop_value; int disposal; int last_disposal; int transparent_index; int screen_width; int screen_height; GifImageDesc *img_desc; status = Ok; disposal = 0; last_disposal = 0; loop_value = 0; global_palette = NULL; result = NULL; loop_counter = FALSE; if (from_file) { #if GIFLIB_MAJOR >= 5 gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL); #else gif = DGifOpen(stream, &gdip_gif_fileinputfunc); #endif } else { #if GIFLIB_MAJOR >= 5 gif = DGifOpen (stream, &gdip_gif_inputfunc, NULL); #else gif = DGifOpen (stream, &gdip_gif_inputfunc); #endif } if (gif == NULL) { status = OutOfMemory; goto error; } /* Read the image */ if (DGifSlurpMono (gif, &global_extensions) != GIF_OK) { status = OutOfMemory; goto error; } /* We can have either multiple pages (page dimension) or an animation (time dimension) If we find an Application Extension, it's an animated gif, otherwise we've got multiple pages */ screen_width = gif->SWidth; screen_height = gif->SHeight; animated = FALSE; num_of_images = gif->ImageCount; for (i = 0; i < num_of_images; i++) { for (l = 0; l < gif->SavedImages[i].ExtensionBlockCount; l++) { switch(gif->SavedImages[i].ExtensionBlocks[l].Function) { case APPLICATION_EXT_FUNC_CODE: { if (num_of_images > 1) { animated = TRUE; } /* Mention of the Netscape format is here: http://list-archive.xemacs.org/xemacs-beta/199910/msg00070.html */ /* We seem to be dealing with a bug in the gif lib here, it breaks the sub-bart part of the * extension data up into a separate ExtensionBlock (of type 0x00) */ if (gif->SavedImages[i].ExtensionBlocks[l].ByteCount > 10) { if (memcmp(gif->SavedImages[i].ExtensionBlocks[l].Bytes, "NETSCAPE2.0", 11) == 0) { loop_counter = TRUE; /* The next Block is a subblock of the app extension. The 3 bytes are the loop counter */ if ((l + 1) < gif->SavedImages[i].ExtensionBlockCount) { if ((gif->SavedImages[i].ExtensionBlocks[l + 1].Function == 0) && (gif->SavedImages[i].ExtensionBlocks[l + 1].ByteCount == 3) && (gif->SavedImages[i].ExtensionBlocks[l + 1].Bytes[0] == 1)) { loop_value = (BYTE)(gif->SavedImages[i].ExtensionBlocks[l + 1].Bytes[2] << 8) + (BYTE)gif->SavedImages[i].ExtensionBlocks[l + 1].Bytes[1]; } } } } break; } case 0: { break; } } } } if (animated) { dimension = &gdip_image_frameDimension_time_guid; } else { dimension = &gdip_image_frameDimension_page_guid; } result = gdip_bitmap_new(); if (!result) { status = OutOfMemory; goto error; } result->type = ImageTypeBitmap; frame = gdip_frame_add(result, dimension); if (!frame) { status = OutOfMemory; goto error; } /* Copy the palette over, if there is one */ if (gif->SColorMap != NULL) { global_palette = GdipAlloc (sizeof(ColorPalette) + sizeof(ARGB) * gif->SColorMap->ColorCount); if (!global_palette) { status = OutOfMemory; goto error; } global_palette->Flags = 0; global_palette->Count = gif->SColorMap->ColorCount; for (i = 0; i < gif->SColorMap->ColorCount; i++) { global_palette->Entries[i] = MAKE_ARGB_ARGB(0xff, gif->SColorMap->Colors[i].Red, gif->SColorMap->Colors[i].Green, gif->SColorMap->Colors[i].Blue); } } else { /* Assume a grayscale image for the global palette. Individual images might still have a different one. */ global_palette = GdipAlloc (sizeof(ColorPalette) + 256 * sizeof(ARGB)); if (!global_palette) { status = OutOfMemory; goto error; } global_palette->Flags = PaletteFlagsGrayScale; global_palette->Count = 256; for (i=0; i < 256; i++) { global_palette->Entries[i] = MAKE_ARGB_RGB(i, i, i); } } result->cairo_format = CAIRO_FORMAT_A8; /* create our bitmaps */ for (i = 0; i < num_of_images; i++) { /* Add ActiveBitmapData to our frame */ bitmap_data = gdip_frame_add_bitmapdata(frame); if (bitmap_data == NULL) { status = OutOfMemory; goto error; } si = gif->SavedImages[i]; img_desc = &si.ImageDesc; if (img_desc->Top < 0 || img_desc->Height < 0 || img_desc->Left < 0 || img_desc->Width < 0 || (img_desc->Width + img_desc->Left) > screen_width || (img_desc->Height + img_desc->Top) > screen_height) { status = OutOfMemory; goto error; } for (l = 0; l < global_extensions.ExtensionBlockCount; l++) { ExtensionBlock eb = global_extensions.ExtensionBlocks[l]; if (eb.Function == COMMENT_EXT_FUNC_CODE) { int index; if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagExifUserComment, &index) != Ok) { BYTE *bytes = (BYTE*) GdipAlloc (eb.ByteCount + 1); if (bytes == NULL) { status = OutOfMemory; goto error; } memcpy (bytes, eb.Bytes, eb.ByteCount); bytes [eb.ByteCount] = '\0'; gdip_bitmapdata_property_add_ASCII (bitmap_data, PropertyTagExifUserComment, bytes); GdipFree (bytes); } } } for (l = 0; l < si.ExtensionBlockCount; l++) { ExtensionBlock eb = si.ExtensionBlocks[l]; switch(eb.Function) { case GRAPHICS_EXT_FUNC_CODE: { /* Pull animation time and/or transparent color */ if (eb.ByteCount > 3) { /* Sanity */ guint32 delay; disposal = ((eb.Bytes [0] >> 2) & 7); if ((eb.Bytes[0] & 0x01) != 0) { /* 0 = no transparency, so we need to shift range */ bitmap_data->transparent = -eb.Bytes[3] - 1; } delay = (eb.Bytes[2] << 8) + (eb.Bytes[1]); gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagFrameDelay, delay); if (loop_counter) { gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagLoopCount, loop_value); } } break; } case COMMENT_EXT_FUNC_CODE: { int index; BYTE *text; /* Per-image comments override global */ if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagExifUserComment, &index) == Ok) { gdip_bitmapdata_property_remove_index(bitmap_data, index); } /* String is not null terminated */ text = (BYTE*)GdipAlloc(eb.ByteCount + 1); if (!text) { status = OutOfMemory; goto error; } memcpy(text, eb.Bytes, eb.ByteCount); text[eb.ByteCount] = '\0'; gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagExifUserComment, text); GdipFree(text); break; } } } /* copy the local color map if there is one, otherwise we duplicate the global one */ if (img_desc->ColorMap != NULL) { ColorMapObject *local_palette_obj; /* TODO: what do we do with combined gif + local palettes? */ local_palette_obj = img_desc->ColorMap; bitmap_data->palette = GdipAlloc (sizeof(ColorPalette) + sizeof(ARGB) * local_palette_obj->ColorCount); if (!bitmap_data->palette) { status = OutOfMemory; goto error; } bitmap_data->palette->Flags = 0; bitmap_data->palette->Count = local_palette_obj->ColorCount; for (l = 0; l < local_palette_obj->ColorCount; l++) { bitmap_data->palette->Entries[l] = MAKE_ARGB_ARGB(0xff, local_palette_obj->Colors[l].Red, local_palette_obj->Colors[l].Green, local_palette_obj->Colors[l].Blue); } } else { bitmap_data->palette = gdip_palette_clone(global_palette); if (!bitmap_data->palette) { status = OutOfMemory; goto error; } } if (bitmap_data->transparent < 0) { BYTE *v; bitmap_data->palette->Flags |= PaletteFlagsHasAlpha; transparent_index = (bitmap_data->transparent + 1) * -1; if (transparent_index >= bitmap_data->palette->Count) { status = OutOfMemory; goto error; } v = (BYTE*)&bitmap_data->palette->Entries [transparent_index]; #ifdef WORDS_BIGENDIAN v[0] = 0x00; #else v[3] = 0x00; #endif /* WORDS_BIGENDIAN */ } else { transparent_index = -1; } bitmap_data->pixel_format = PixelFormat8bppIndexed; bitmap_data->width = screen_width; bitmap_data->height = screen_height; bitmap_data->stride = bitmap_data->width; gdip_align_stride (bitmap_data->stride); bitmap_data->left = img_desc->Left; bitmap_data->top = img_desc->Top; unsigned long long int size = (unsigned long long int)bitmap_data->stride * bitmap_data->height; if (size > G_MAXINT32) { status = OutOfMemory; goto error; } bitmap_data->scan0 = GdipAlloc (size); if (!bitmap_data->scan0) { status = OutOfMemory; goto error; } bitmap_data->reserved = GBD_OWN_SCAN0; bitmap_data->image_flags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize | ImageFlagsHasRealDPI | ImageFlagsColorSpaceRGB; if (bitmap_data->transparent < 0) bitmap_data->image_flags |= ImageFlagsHasAlpha; bitmap_data->dpi_horz = gdip_get_display_dpi (); bitmap_data->dpi_vert = bitmap_data->dpi_horz; readptr = (BYTE*) si.RasterBits; writeptr = bitmap_data->scan0; for (l = 0; l < bitmap_data->height; l++) { if (l >= img_desc->Top && l - img_desc->Top < img_desc->Height) { /* Ignore 'disposal' 0 (don't care) and 4, 5, 6, 7 (undocumented) */ if (i == 0 || transparent_index == -1 || (last_disposal != 1 && last_disposal != 3)) { writeptr += img_desc->Left; memcpy (writeptr, readptr, img_desc->Width); writeptr -= img_desc->Left; writeptr += bitmap_data->stride; readptr += img_desc->Width; } else { int ridx, widx; ActiveBitmapData *last_bitmap; last_bitmap = &frame->bitmap [i - 1]; if (l == img_desc->Top) { /* Copy the previous bitmap as the base for this one */ /* TODO: This will be wrong if each image has a different palette */ /* There's a comment up there too */ memcpy (bitmap_data->scan0, last_bitmap->scan0, size); } for (ridx = 0, widx = bitmap_data->left; ridx < img_desc->Width; widx++, ridx++) { BYTE bt = readptr [ridx]; if (bt == transparent_index) continue; writeptr [widx] = bt; } readptr += img_desc->Width; writeptr += bitmap_data->stride; } } else { writeptr += bitmap_data->stride; } } last_disposal = disposal; disposal = 0; } gdip_bitmap_setactive(result, dimension, 0); if (global_palette != NULL) { GdipFree(global_palette); } FreeExtensionMono(&global_extensions); #if (GIFLIB_MAJOR > 5) || ((GIFLIB_MAJOR == 5) && (GIFLIB_MINOR >= 1)) DGifCloseFile (gif, NULL); #else DGifCloseFile (gif); #endif *image = result; return Ok; error: if (global_palette != NULL) { GdipFree(global_palette); } if (result != NULL) { gdip_bitmap_dispose (result); } if (gif != NULL) { FreeExtensionMono (&global_extensions); #if (GIFLIB_MAJOR > 5) || ((GIFLIB_MAJOR == 5) && (GIFLIB_MINOR >= 1)) DGifCloseFile (gif, NULL); #else DGifCloseFile (gif); #endif } *image = NULL; return status; } GpStatus gdip_load_gif_image_from_file (FILE *fp, GpImage **image) { return gdip_load_gif_image (fp, image, TRUE); } GpStatus gdip_load_gif_image_from_stream_delegate (GetBytesDelegate getBytesFunc, SeekDelegate seekFunc, GpImage **image) { gif_callback_data gif_data; gif_data.getBytesFunc = getBytesFunc; gif_data.seekFunc = seekFunc; return gdip_load_gif_image (&gif_data, image, FALSE); } /* Write callback function for the gif libbrary*/ static int gdip_gif_outputfunc (GifFileType *gif, const GifByteType *data, int len) { int written = 0; PutBytesDelegate putBytesFunc = (PutBytesDelegate) gif->UserData; written = putBytesFunc ((void *)data, len); return written; } static GpStatus gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file) { GpStatus status; GifFileType *fp; int i, x, y; GifByteType *red; GifByteType *green; GifByteType *blue; GifByteType *red_ptr; GifByteType *green_ptr; GifByteType *blue_ptr; GifByteType *pixbuf; GifByteType *pixbuf_org; int cmap_size; ColorMapObject *cmap = NULL; int k; BYTE *v; int c; int index; BOOL animated; int frame; ActiveBitmapData *bitmap_data; unsigned long long int pixbuf_size; if (!stream) { return InvalidParameter; } if (from_file) { #if GIFLIB_MAJOR >= 5 fp = EGifOpenFileName (stream, 0, NULL); #else fp = EGifOpenFileName (stream, 0); #endif } else { #if GIFLIB_MAJOR >= 5 fp = EGifOpen (stream, gdip_gif_outputfunc, NULL); #else fp = EGifOpen (stream, gdip_gif_outputfunc); #endif } if (!fp) { return FileNotFound; } red = NULL; green = NULL; blue = NULL; pixbuf_org = NULL; for (frame = 0; frame < image->num_of_frames; frame++) { animated = FALSE; if (memcmp(&image->frames[frame].frame_dimension, &gdip_image_frameDimension_time_guid, sizeof(GUID)) == 0) { animated = TRUE; } for (k = 0; k < image->frames[frame].count; k++) { bitmap_data = &image->frames[frame].bitmap[k]; pixbuf_size = (unsigned long long int)bitmap_data->width * bitmap_data->height * sizeof(GifByteType); if (pixbuf_size > G_MAXINT32) { status = OutOfMemory; goto error; } if (gdip_is_an_indexed_pixelformat(bitmap_data->pixel_format)) { BYTE w; switch (bitmap_data->pixel_format) { case PixelFormat1bppIndexed: cmap_size = 2; break; case PixelFormat4bppIndexed: cmap_size = 16; break; case PixelFormat8bppIndexed: cmap_size = 256; break; default: status = GenericError; goto error; } #if GIFLIB_MAJOR >= 5 cmap = GifMakeMapObject(cmap_size, 0); #else cmap = MakeMapObject(cmap_size, 0); #endif pixbuf = GdipAlloc(pixbuf_size); if (pixbuf == NULL) { status = OutOfMemory; goto error; } pixbuf_org = pixbuf; for (c = 0; (c < cmap_size) && (c < bitmap_data->palette->Count); c++) { v = (BYTE*)&bitmap_data->palette->Entries[c]; #ifdef WORDS_BIGENDIAN cmap->Colors[c].Red = v[1]; cmap->Colors[c].Green = v[2]; cmap->Colors[c].Blue = v[3]; #else cmap->Colors[c].Red = v[2]; cmap->Colors[c].Green = v[1]; cmap->Colors[c].Blue = v[0]; #endif /* WORDS_BIGENDIAN */ } switch(bitmap_data->pixel_format) { case PixelFormat1bppIndexed: { for (y = 0; y < bitmap_data->height; y++) { v = bitmap_data->scan0 + y * bitmap_data->stride; for (x = 0; x + 7 < bitmap_data->width; x += 8) { w = *v; *(pixbuf++) = ((w & 0x80) != 0); *(pixbuf++) = ((w & 0x40) != 0); *(pixbuf++) = ((w & 0x20) != 0); *(pixbuf++) = ((w & 0x10) != 0); *(pixbuf++) = ((w & 0x08) != 0); *(pixbuf++) = ((w & 0x04) != 0); *(pixbuf++) = ((w & 0x02) != 0); *(pixbuf++) = ((w & 0x01) != 0); v++; } w = *v; switch (bitmap_data->width & 7) { case 7: pixbuf[6] = ((w & 0x02) != 0); /* fall through */ case 6: pixbuf[5] = ((w & 0x04) != 0); /* fall through */ case 5: pixbuf[4] = ((w & 0x08) != 0); /* fall through */ case 4: pixbuf[3] = ((w & 0x10) != 0); /* fall through */ case 3: pixbuf[2] = ((w & 0x20) != 0); /* fall through */ case 2: pixbuf[1] = ((w & 0x40) != 0); /* fall through */ case 1: pixbuf[0] = ((w & 0x80) != 0); } pixbuf += (bitmap_data->width & 7); } break; } case PixelFormat4bppIndexed: { for (y = 0; y < bitmap_data->height; y++) { v = bitmap_data->scan0 + y * bitmap_data->stride; for (x = 0; x + 1 < bitmap_data->width; x += 2) { w = *v; *(pixbuf++) = ((w >> 4) & 0xF); *(pixbuf++) = ( w & 0xF); v++; } if ((bitmap_data->width & 1) != 0) { *(pixbuf++) = ((*v >> 4) & 0xF); } } break; } case PixelFormat8bppIndexed: { for (y = 0; y < bitmap_data->height; y++) { memcpy(pixbuf + y * bitmap_data->width, bitmap_data->scan0 + y * bitmap_data->stride, bitmap_data->width); } break; } } /* Restore pointer, 1bpp and 4bpp above alter it */ pixbuf = pixbuf_org; } else { cmap_size = 256; #if GIFLIB_MAJOR >= 5 cmap = GifMakeMapObject (cmap_size, 0); #else cmap = MakeMapObject (cmap_size, 0); #endif red = GdipAlloc(pixbuf_size); green = GdipAlloc(pixbuf_size); blue = GdipAlloc(pixbuf_size); pixbuf = GdipAlloc(pixbuf_size); if ((red == NULL) || (green == NULL) || (blue == NULL) || (pixbuf == NULL)) { status = OutOfMemory; goto error; } pixbuf_org = pixbuf; red_ptr = red; green_ptr = green; blue_ptr = blue; for (y = 0; y < bitmap_data->height; y++) { v = bitmap_data->scan0 + y * bitmap_data->stride; for (x = 0; x < bitmap_data->width; x++) { #ifdef WORDS_BIGENDIAN *red_ptr++ = v[1]; *green_ptr++ = v[2]; *blue_ptr++ = v[3]; #else *red_ptr++ = v[2]; *green_ptr++ = v[1]; *blue_ptr++ = v[0]; #endif v += 4; } } if (LibgdiplusGifQuantizeBuffer(bitmap_data->width, bitmap_data->height, &cmap_size, red, green, blue, pixbuf, cmap->Colors) == GIF_ERROR) { status = GenericError; goto error; } } #if GIFLIB_MAJOR >= 5 cmap->BitsPerPixel = GifBitSize (cmap_size); #else cmap->BitsPerPixel = BitSize (cmap_size); #endif cmap->ColorCount = 1 << cmap->BitsPerPixel; if ((frame == 0) && (k == 0)) { /* First Image defines the global colormap */ if (EGifPutScreenDesc (fp, bitmap_data->width, bitmap_data->height, cmap->BitsPerPixel, 0, cmap) == GIF_ERROR) { status = GenericError; goto error; } /* An animated image must have the application extension */ if (animated) { /* Store the LoopCount extension */ if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagLoopCount, &index) == Ok) { BYTE Buffer[3]; BYTE *ptr = bitmap_data->property[index].value; Buffer[0] = 1; Buffer[1] = ptr[0]; Buffer[2] = ptr[1]; #if GIFLIB_MAJOR >= 5 EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE); EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0"); EGifPutExtensionBlock(fp, 3, Buffer); EGifPutExtensionTrailer(fp); #else EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0"); EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer); #endif } } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagExifUserComment, &index) == Ok) { EGifPutComment(fp, (const char *)bitmap_data->property[index].value); } } /* Every image has a control extension specifying the time delay */ if (animated || bitmap_data->transparent < 0) { BYTE buffer[4]; buffer[0] = 0x03; /* 0000 0100 = do not dispose */ if (bitmap_data->transparent < 0) { buffer[0] |= 0x01; /* 0000 0001 = transparent */ } if (gdip_bitmapdata_property_find_id(bitmap_data, PropertyTagFrameDelay, &index) == Ok) { BYTE *ptr; ptr = bitmap_data->property[index].value; buffer[1] = ptr[0]; buffer[2] = ptr[1]; } else { buffer[1] = 0; buffer[2] = 0; } if (bitmap_data->transparent < 0) { buffer[3] = (bitmap_data->transparent + 1) * -1; } else { buffer[3] = 0; } EGifPutExtension(fp, GRAPHICS_EXT_FUNC_CODE, 4, buffer); } /* Store the image description */ /* This call will leak GifFile->Image.ColorMap */ if (EGifPutImageDesc (fp, bitmap_data->left, bitmap_data->top, bitmap_data->width, bitmap_data->height, FALSE, cmap) == GIF_ERROR) { status = GenericError; goto error; } for (i = 0; i < bitmap_data->height; ++i) { if (EGifPutLine (fp, pixbuf, bitmap_data->width) == GIF_ERROR) { status = GenericError; goto error; } pixbuf += bitmap_data->width; } #if GIFLIB_MAJOR >= 5 GifFreeMapObject (cmap); #else FreeMapObject (cmap); #endif if (red != NULL) { GdipFree (red); } if (green != NULL) { GdipFree (green); } if (blue != NULL) { GdipFree (blue); } if (pixbuf_org != NULL) { GdipFree (pixbuf_org); } red = NULL; green = NULL; blue = NULL; pixbuf_org = NULL; } } #if (GIFLIB_MAJOR > 5) || ((GIFLIB_MAJOR == 5) && (GIFLIB_MINOR >= 1)) EGifCloseFile (fp, NULL); #else EGifCloseFile (fp); #endif return Ok; error: if (cmap != NULL) { #if GIFLIB_MAJOR >= 5 GifFreeMapObject (cmap); #else FreeMapObject (cmap); #endif } if (red != NULL) { GdipFree (red); } if (green != NULL) { GdipFree (green); } if (blue != NULL) { GdipFree (blue); } if (pixbuf_org != NULL) { GdipFree (pixbuf_org); } return status; } GpStatus gdip_save_gif_image_to_file (BYTE *filename, GpImage *image) { return gdip_save_gif_image ((void *)filename, image, TRUE); } GpStatus gdip_save_gif_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return gdip_save_gif_image ( (void *)putBytesFunc, image, FALSE); } #else /* No libgif */ #include "image.h" ImageCodecInfo * gdip_getcodecinfo_gif () { return NULL; } GpStatus gdip_load_gif_image_from_file (FILE *fp, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_save_gif_image_to_file (BYTE *filename, GpImage *image) { return UnknownImageFormat; } GpStatus gdip_save_gif_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } GpStatus gdip_load_gif_image_from_stream_delegate (GetBytesDelegate getBytesFunc, SeekDelegate seekFunc, GpImage **image) { *image = NULL; return UnknownImageFormat; } #endif GpStatus gdip_fill_encoder_parameter_list_gif (EncoderParameters *buffer, UINT size) { GifEncoderParameters *gifBuffer = (GifEncoderParameters *) buffer; if (!buffer || size != sizeof (GifEncoderParameters)) return InvalidParameter; gifBuffer->count = 2; gifBuffer->imageItems.Guid = GdipEncoderImageItems; gifBuffer->imageItems.NumberOfValues = 0; gifBuffer->imageItems.Type = 9; // Undocumented type. gifBuffer->imageItems.Value = NULL; gifBuffer->saveFlag.Guid = GdipEncoderSaveFlag; gifBuffer->saveFlag.NumberOfValues = 1; gifBuffer->saveFlag.Type = EncoderParameterValueTypeLong; gifBuffer->saveFlagValue = EncoderValueMultiFrame; gifBuffer->saveFlag.Value = &gifBuffer->saveFlagValue; return Ok; } libgdiplus-6.0.4+dfsg/src/jpegcodec.h0000644000175000017500000000241513542672033020210 0ustar directhexdirecthex/* * jpegcodec.h : Contains function declarations for encoding decoding jpeg images * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * * Copyright (C) 2003-2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef _JPEGCODEC_H #define _JPEGCODEC_H #include "bitmap-private.h" #include "bmpcodec.h" GpStatus gdip_load_jpeg_image_from_file (FILE *fp, const char *filename, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_jpeg_image_from_stream_delegate (dstream_t *loader, GpImage **image) GDIP_INTERNAL; GpStatus gdip_save_jpeg_image_to_file (FILE *fp, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; GpStatus gdip_save_jpeg_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; ImageCodecInfo *gdip_getcodecinfo_jpeg () GDIP_INTERNAL; GpStatus gdip_fill_encoder_parameter_list_jpeg (EncoderParameters *buffer, UINT size) GDIP_INTERNAL; typedef struct { UINT count; EncoderParameter transformation; EncoderParameter quality; EncoderParameter luminanceTable; EncoderParameter chrominanceTable; EncoderParameter imageItems; LONG transformationData[5]; UINT qualityRange[2]; } JpegEncoderParameters; #endif /* _JPEGCODEC_H */ libgdiplus-6.0.4+dfsg/src/solidbrush-private.h0000644000175000017500000000354512377405421022120 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __SOLIDBRUSH_PRIVATE_H__ #define __SOLIDBRUSH_PRIVATE_H__ #include "brush-private.h" typedef struct _SolidFill { Brush base; int color; /* We cache the color components */ double A; double R; double G; double B; } SolidFill; #include "solidbrush.h" #endif libgdiplus-6.0.4+dfsg/src/text.h0000644000175000017500000000476013542674535017267 0ustar directhexdirecthex/* * Copyright (c) 2003 Alexandre Pigolkine, Novell Inc. * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Sebastien Pouliot */ #ifndef __TEXT_H__ #define __TEXT_H__ /* Text public API (only!) */ GpStatus WINGDIPAPI GdipDrawString (GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, GpBrush *brush); GpStatus WINGDIPAPI GdipMeasureString (GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, RectF *boundingBox, INT *codepointsFitted, INT *linesFilled); GpStatus WINGDIPAPI GdipMeasureCharacterRanges (GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, INT regionCount, GpRegion **regions); GpStatus WINGDIPAPI GdipDrawDriverString (GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix); GpStatus WINGDIPAPI GdipMeasureDriverString (GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix, RectF *boundingBox); #endif libgdiplus-6.0.4+dfsg/src/gdiplusimaging.h0000644000175000017500000003725713542674535021315 0ustar directhexdirecthex/* * 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. */ #ifndef __GDIPLUSIMAGING_H__ #define __GDIPLUSIMAGING_H__ #include "win32structs.h" typedef struct { CLSID Clsid; GUID FormatID; const WCHAR* CodecName; const WCHAR* DllName; const WCHAR* FormatDescription; const WCHAR* FilenameExtension; const WCHAR* MimeType; DWORD Flags; DWORD Version; DWORD SigCount; DWORD SigSize; const BYTE* SigPattern; const BYTE* SigMask; } ImageCodecInfo; typedef enum { ImageCodecFlagsEncoder = 0x00000001, ImageCodecFlagsDecoder = 0x00000002, ImageCodecFlagsSupportBitmap = 0x00000004, ImageCodecFlagsSupportVector = 0x00000008, ImageCodecFlagsSeekableEncode = 0x00000010, ImageCodecFlagsBlockingDecode = 0x00000020, ImageCodecFlagsBuiltin = 0x00010000, ImageCodecFlagsSystem = 0x00020000, ImageCodecFlagsUser = 0x00040000 } ImageCodecFlags; typedef enum { ImageLockModeRead = 0x0001, ImageLockModeWrite = 0x0002, ImageLockModeUserInputBuf = 0x0004 } ImageLockMode; typedef struct { PROPID id; ULONG length; WORD type; VOID* value; } PropertyItem; typedef enum { ImageFlagsNone = 0, ImageFlagsScalable = 0x0001, ImageFlagsHasAlpha = 0x0002, ImageFlagsHasTranslucent = 0x0004, ImageFlagsPartiallyScalable = 0x0008, ImageFlagsColorSpaceRGB = 0x0010, ImageFlagsColorSpaceCMYK = 0x0020, ImageFlagsColorSpaceGRAY = 0x0040, ImageFlagsColorSpaceYCBCR = 0x0080, ImageFlagsColorSpaceYCCK = 0x0100, ImageFlagsHasRealDPI = 0x1000, ImageFlagsHasRealPixelSize = 0x2000, ImageFlagsReadOnly = 0x00010000, ImageFlagsCaching = 0x00020000, ImageFlagsUndocumented = 0x00040000 } ImageFlags; typedef struct { UINT Width; UINT Height; INT Stride; PixelFormat PixelFormat; VOID *Scan0; UINT_PTR Reserved; /* FIXME: the rest of the structure isn't part of MS GDI+ definition */ ColorPalette *palette; int property_count; /* Number of properties */ PropertyItem *property; /* Properties associated with image */ float dpi_horz; /* */ float dpi_vert; /* */ ImageFlags image_flags; /* Alpha, ColorSpace, etc. */ unsigned int left; /* left display coordinate of frame */ unsigned int top; /* top display coordinate of frame */ unsigned int x; /* LockBits: left coordinate of locked rectangle */ unsigned int y; /* LockBits: top coordinate of locked rectangle */ int transparent; /* Index of transparent color (<24bit only) */ } BitmapData; typedef enum { RotateNoneFlipNone = 0, Rotate90FlipNone = 1, Rotate180FlipNone = 2, Rotate270FlipNone = 3, RotateNoneFlipX = 4, Rotate90FlipX = 5, Rotate180FlipX = 6, Rotate270FlipX = 7, RotateNoneFlipY = Rotate180FlipX, Rotate90FlipY = Rotate270FlipX, Rotate180FlipY = RotateNoneFlipX, Rotate270FlipY = Rotate90FlipX, RotateNoneFlipXY = Rotate180FlipNone, Rotate90FlipXY = Rotate270FlipNone, Rotate180FlipXY = RotateNoneFlipNone, Rotate270FlipXY = Rotate90FlipNone } RotateFlipType; typedef struct { GUID Guid; ULONG NumberOfValues; ULONG Type; VOID* Value; } EncoderParameter; typedef struct { UINT Count; EncoderParameter Parameter[1]; } EncoderParameters; // Image property types #define PropertyTagTypeByte 1 #define PropertyTagTypeASCII 2 #define PropertyTagTypeShort 3 #define PropertyTagTypeLong 4 #define PropertyTagTypeRational 5 #define PropertyTagTypeSByte 6 #define PropertyTagTypeUndefined 7 #define PropertyTagTypeSShort 8 #define PropertyTagTypeSLONG 9 #define PropertyTagTypeSRational 10 #define PropertyTagTypeFloat 11 #define PropertyTagTypeDouble 12 // Image property ID tags #define PropertyTagExifIFD 0x8769 #define PropertyTagGpsIFD 0x8825 #define PropertyTagNewSubfileType 0x00FE #define PropertyTagSubfileType 0x00FF #define PropertyTagImageWidth 0x0100 #define PropertyTagImageHeight 0x0101 #define PropertyTagBitsPerSample 0x0102 #define PropertyTagCompression 0x0103 #define PropertyTagPhotometricInterp 0x0106 #define PropertyTagThreshHolding 0x0107 #define PropertyTagCellWidth 0x0108 #define PropertyTagCellHeight 0x0109 #define PropertyTagFillOrder 0x010A #define PropertyTagDocumentName 0x010D #define PropertyTagImageDescription 0x010E #define PropertyTagEquipMake 0x010F #define PropertyTagEquipModel 0x0110 #define PropertyTagStripOffsets 0x0111 #define PropertyTagOrientation 0x0112 #define PropertyTagSamplesPerPixel 0x0115 #define PropertyTagRowsPerStrip 0x0116 #define PropertyTagStripBytesCount 0x0117 #define PropertyTagMinSampleValue 0x0118 #define PropertyTagMaxSampleValue 0x0119 #define PropertyTagXResolution 0x011A #define PropertyTagYResolution 0x011B #define PropertyTagPlanarConfig 0x011C #define PropertyTagPageName 0x011D #define PropertyTagXPosition 0x011E #define PropertyTagYPosition 0x011F #define PropertyTagFreeOffset 0x0120 #define PropertyTagFreeByteCounts 0x0121 #define PropertyTagGrayResponseUnit 0x0122 #define PropertyTagGrayResponseCurve 0x0123 #define PropertyTagT4Option 0x0124 #define PropertyTagT6Option 0x0125 #define PropertyTagResolutionUnit 0x0128 #define PropertyTagPageNumber 0x0129 #define PropertyTagTransferFuncition 0x012D // Deliberate typo to match GDI+. #define PropertyTagSoftwareUsed 0x0131 #define PropertyTagDateTime 0x0132 #define PropertyTagArtist 0x013B #define PropertyTagHostComputer 0x013C #define PropertyTagPredictor 0x013D #define PropertyTagWhitePoint 0x013E #define PropertyTagPrimaryChromaticities 0x013F #define PropertyTagColorMap 0x0140 #define PropertyTagHalftoneHints 0x0141 #define PropertyTagTileWidth 0x0142 #define PropertyTagTileLength 0x0143 #define PropertyTagTileOffset 0x0144 #define PropertyTagTileByteCounts 0x0145 #define PropertyTagInkSet 0x014C #define PropertyTagInkNames 0x014D #define PropertyTagNumberOfInks 0x014E #define PropertyTagDotRange 0x0150 #define PropertyTagTargetPrinter 0x0151 #define PropertyTagExtraSamples 0x0152 #define PropertyTagSampleFormat 0x0153 #define PropertyTagSMinSampleValue 0x0154 #define PropertyTagSMaxSampleValue 0x0155 #define PropertyTagTransferRange 0x0156 #define PropertyTagJPEGProc 0x0200 #define PropertyTagJPEGInterFormat 0x0201 #define PropertyTagJPEGInterLength 0x0202 #define PropertyTagJPEGRestartInterval 0x0203 #define PropertyTagJPEGLosslessPredictors 0x0205 #define PropertyTagJPEGPointTransforms 0x0206 #define PropertyTagJPEGQTables 0x0207 #define PropertyTagJPEGDCTables 0x0208 #define PropertyTagJPEGACTables 0x0209 #define PropertyTagYCbCrCoefficients 0x0211 #define PropertyTagYCbCrSubsampling 0x0212 #define PropertyTagYCbCrPositioning 0x0213 #define PropertyTagREFBlackWhite 0x0214 #define PropertyTagICCProfile 0x8773 #define PropertyTagGamma 0x0301 #define PropertyTagICCProfileDescriptor 0x0302 #define PropertyTagSRGBRenderingIntent 0x0303 #define PropertyTagImageTitle 0x0320 #define PropertyTagCopyright 0x8298 #define PropertyTagResolutionXUnit 0x5001 #define PropertyTagResolutionYUnit 0x5002 #define PropertyTagResolutionXLengthUnit 0x5003 #define PropertyTagResolutionYLengthUnit 0x5004 #define PropertyTagPrintFlags 0x5005 #define PropertyTagPrintFlagsVersion 0x5006 #define PropertyTagPrintFlagsCrop 0x5007 #define PropertyTagPrintFlagsBleedWidth 0x5008 #define PropertyTagPrintFlagsBleedWidthScale 0x5009 #define PropertyTagHalftoneLPI 0x500A #define PropertyTagHalftoneLPIUnit 0x500B #define PropertyTagHalftoneDegree 0x500C #define PropertyTagHalftoneShape 0x500D #define PropertyTagHalftoneMisc 0x500E #define PropertyTagHalftoneScreen 0x500F #define PropertyTagJPEGQuality 0x5010 #define PropertyTagGridSize 0x5011 #define PropertyTagThumbnailFormat 0x5012 #define PropertyTagThumbnailWidth 0x5013 #define PropertyTagThumbnailHeight 0x5014 #define PropertyTagThumbnailColorDepth 0x5015 #define PropertyTagThumbnailPlanes 0x5016 #define PropertyTagThumbnailRawBytes 0x5017 #define PropertyTagThumbnailSize 0x5018 #define PropertyTagThumbnailCompressedSize 0x5019 #define PropertyTagColorTransferFunction 0x501A #define PropertyTagThumbnailData 0x501B #define PropertyTagThumbnailImageWidth 0x5020 #define PropertyTagThumbnailImageHeight 0x5021 #define PropertyTagThumbnailBitsPerSample 0x5022 #define PropertyTagThumbnailCompression 0x5023 #define PropertyTagThumbnailPhotometricInterp 0x5024 #define PropertyTagThumbnailImageDescription 0x5025 #define PropertyTagThumbnailEquipMake 0x5026 #define PropertyTagThumbnailEquipModel 0x5027 #define PropertyTagThumbnailStripOffsets 0x5028 #define PropertyTagThumbnailOrientation 0x5029 #define PropertyTagThumbnailSamplesPerPixel 0x502A #define PropertyTagThumbnailRowsPerStrip 0x502B #define PropertyTagThumbnailStripBytesCount 0x502C #define PropertyTagThumbnailResolutionX 0x502D #define PropertyTagThumbnailResolutionY 0x502E #define PropertyTagThumbnailPlanarConfig 0x502F #define PropertyTagThumbnailResolutionUnit 0x5030 #define PropertyTagThumbnailTransferFunction 0x5031 #define PropertyTagThumbnailSoftwareUsed 0x5032 #define PropertyTagThumbnailDateTime 0x5033 #define PropertyTagThumbnailArtist 0x5034 #define PropertyTagThumbnailWhitePoint 0x5035 #define PropertyTagThumbnailPrimaryChromaticities 0x5036 #define PropertyTagThumbnailYCbCrCoefficients 0x5037 #define PropertyTagThumbnailYCbCrSubsampling 0x5038 #define PropertyTagThumbnailYCbCrPositioning 0x5039 #define PropertyTagThumbnailRefBlackWhite 0x503A #define PropertyTagThumbnailCopyRight 0x503B #define PropertyTagLuminanceTable 0x5090 #define PropertyTagChrominanceTable 0x5091 #define PropertyTagFrameDelay 0x5100 #define PropertyTagLoopCount 0x5101 #if (GDIPVER >= 0x0110) #define PropertyTagGlobalPalette 0x5102 #define PropertyTagIndexBackground 0x5103 #define PropertyTagIndexTransparent 0x5104 #endif //(GDIPVER >= 0x0110) #define PropertyTagPixelUnit 0x5110 #define PropertyTagPixelPerUnitX 0x5111 #define PropertyTagPixelPerUnitY 0x5112 #define PropertyTagPaletteHistogram 0x5113 #define PropertyTagExifExposureTime 0x829A #define PropertyTagExifFNumber 0x829D #define PropertyTagExifExposureProg 0x8822 #define PropertyTagExifSpectralSense 0x8824 #define PropertyTagExifISOSpeed 0x8827 #define PropertyTagExifOECF 0x8828 #define PropertyTagExifVer 0x9000 #define PropertyTagExifDTOrig 0x9003 #define PropertyTagExifDTDigitized 0x9004 #define PropertyTagExifCompConfig 0x9101 #define PropertyTagExifCompBPP 0x9102 #define PropertyTagExifShutterSpeed 0x9201 #define PropertyTagExifAperture 0x9202 #define PropertyTagExifBrightness 0x9203 #define PropertyTagExifExposureBias 0x9204 #define PropertyTagExifMaxAperture 0x9205 #define PropertyTagExifSubjectDist 0x9206 #define PropertyTagExifMeteringMode 0x9207 #define PropertyTagExifLightSource 0x9208 #define PropertyTagExifFlash 0x9209 #define PropertyTagExifFocalLength 0x920A #define PropertyTagExifSubjectArea 0x9214 #define PropertyTagExifMakerNote 0x927C #define PropertyTagExifUserComment 0x9286 #define PropertyTagExifDTSubsec 0x9290 #define PropertyTagExifDTOrigSS 0x9291 #define PropertyTagExifDTDigSS 0x9292 #define PropertyTagExifFPXVer 0xA000 #define PropertyTagExifColorSpace 0xA001 #define PropertyTagExifPixXDim 0xA002 #define PropertyTagExifPixYDim 0xA003 #define PropertyTagExifRelatedWav 0xA004 #define PropertyTagExifInterop 0xA005 #define PropertyTagExifFlashEnergy 0xA20B #define PropertyTagExifSpatialFR 0xA20C #define PropertyTagExifFocalXRes 0xA20E #define PropertyTagExifFocalYRes 0xA20F #define PropertyTagExifFocalResUnit 0xA210 #define PropertyTagExifSubjectLoc 0xA214 #define PropertyTagExifExposureIndex 0xA215 #define PropertyTagExifSensingMethod 0xA217 #define PropertyTagExifFileSource 0xA300 #define PropertyTagExifSceneType 0xA301 #define PropertyTagExifCfaPattern 0xA302 #define PropertyTagExifCustomRendered 0xA401 #define PropertyTagExifExposureMode 0xA402 #define PropertyTagExifWhiteBalance 0xA403 #define PropertyTagExifDigitalZoomRatio 0xA404 #define PropertyTagExifFocalLengthIn35mmFilm 0xA405 #define PropertyTagExifSceneCaptureType 0xA406 #define PropertyTagExifGainControl 0xA407 #define PropertyTagExifContrast 0xA408 #define PropertyTagExifSaturation 0xA409 #define PropertyTagExifSharpness 0xA40A #define PropertyTagExifDeviceSettingDesc 0xA40B #define PropertyTagExifSubjectDistanceRange 0xA40C #define PropertyTagExifUniqueImageID 0xA420 #define PropertyTagGpsVer 0x0000 #define PropertyTagGpsLatitudeRef 0x0001 #define PropertyTagGpsLatitude 0x0002 #define PropertyTagGpsLongitudeRef 0x0003 #define PropertyTagGpsLongitude 0x0004 #define PropertyTagGpsAltitudeRef 0x0005 #define PropertyTagGpsAltitude 0x0006 #define PropertyTagGpsGpsTime 0x0007 #define PropertyTagGpsGpsSatellites 0x0008 #define PropertyTagGpsGpsStatus 0x0009 #define PropertyTagGpsGpsMeasureMode 0x00A #define PropertyTagGpsGpsDop 0x000B #define PropertyTagGpsSpeedRef 0x000C #define PropertyTagGpsSpeed 0x000D #define PropertyTagGpsTrackRef 0x000E #define PropertyTagGpsTrack 0x000F #define PropertyTagGpsImgDirRef 0x0010 #define PropertyTagGpsImgDir 0x0011 #define PropertyTagGpsMapDatum 0x0012 #define PropertyTagGpsDestLatRef 0x0013 #define PropertyTagGpsDestLat 0x0014 #define PropertyTagGpsDestLongRef 0x0015 #define PropertyTagGpsDestLong 0x0016 #define PropertyTagGpsDestBearRef 0x0017 #define PropertyTagGpsDestBear 0x0018 #define PropertyTagGpsDestDistRef 0x0019 #define PropertyTagGpsDestDist 0x001A #define PropertyTagGpsProcessingMethod 0x001B #define PropertyTagGpsAreaInformation 0x001C #define PropertyTagGpsDate 0x001D #define PropertyTagGpsDifferential 0x001E #endif libgdiplus-6.0.4+dfsg/src/customlinecap-private.h0000644000175000017500000000536012377405421022605 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __CUSTOMLINECAP_PRIVATE_H__ #define __CUSTOMLINECAP_PRIVATE_H__ #include "gdiplus-private.h" typedef struct _CapClass { CustomLineCapType type; GpStatus (*setup) (GpGraphics *graphics, GpCustomLineCap *cap); GpStatus (*clone_cap) (GpCustomLineCap *cap, GpCustomLineCap **clonedCap); GpStatus (*destroy) (GpCustomLineCap *cap); GpStatus (*draw) (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *cap, float x, float y, float otherend_x, float otherend_y); } CapClass; typedef struct _CustomLineCap { CapClass *vtable; GpPath *fill_path; GpPath *stroke_path; GpLineCap base_cap; GpLineCap start_cap; GpLineCap end_cap; GpLineJoin stroke_join; float base_inset; float width_scale; } CustomLineCap; void gdip_custom_linecap_init (GpCustomLineCap *cap, CapClass *vt) GDIP_INTERNAL; GpStatus gdip_linecap_setup (GpGraphics *graphics, GpCustomLineCap *customCap) GDIP_INTERNAL; GpStatus gdip_linecap_draw (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *customCap, float x, float y, float otherend_x, float otherend_y) GDIP_INTERNAL; double gdip_custom_linecap_angle (float x, float y, float otherend_x, float otherend_y); #include "customlinecap.h" #endif libgdiplus-6.0.4+dfsg/src/hatchbrush.h0000644000175000017500000000110313542674535020422 0ustar directhexdirecthex/* * hatchbrush.h * * Author: * Ravindra (rkumar@novell.com) * * Copyright (C) 2004, 2007 Novell, Inc. http://www.novell.com */ #ifndef __HATCHBRUSH_H__ #define __HATCHBRUSH_H__ #include "brush.h" GpStatus WINGDIPAPI GdipCreateHatchBrush (GpHatchStyle hatchstyle, ARGB forecol, ARGB backcolor, GpHatch **brush); GpStatus WINGDIPAPI GdipGetHatchStyle (GpHatch *brush, GpHatchStyle *hatchstyle); GpStatus WINGDIPAPI GdipGetHatchForegroundColor (GpHatch *brush, ARGB *forecol); GpStatus WINGDIPAPI GdipGetHatchBackgroundColor (GpHatch *brush, ARGB *backcol); #endif libgdiplus-6.0.4+dfsg/src/region-private.h0000644000175000017500000000533513542674535021235 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __REGION_PRIVATE_H__ #define __REGION_PRIVATE_H__ #include "gdiplus-private.h" #include "matrix-private.h" #include "region-bitmap.h" #include "region-path-tree.h" /* In the integer world infinity has limited bounds ;-) */ #define REGION_INFINITE_POSITION -4194304 #define REGION_INFINITE_LENGTH 8388608 typedef enum { RegionTypeRect, RegionTypePath, RegionTypeInfinite } RegionType; typedef enum { RegionDataRect = 0x10000000, RegionDataPath = 0x10000001, RegionDataEmptyRect = 0x10000002, RegionDataInfiniteRect = 0x10000003 } RegionDataType; typedef struct { DWORD size; DWORD checksum; DWORD magic; DWORD combiningOps; } RegionHeader; struct _Region { guint32 type; int cnt; GpRectF* rects; GpPathTree* tree; GpRegionBitmap* bitmap; }; BOOL gdip_is_InfiniteRegion (const GpRegion *region) GDIP_INTERNAL; BOOL gdip_is_Point_in_RectF_inclusive (float x, float y, GpRectF* rect) GDIP_INTERNAL; void gdip_clear_region (GpRegion *region) GDIP_INTERNAL; GpStatus gdip_copy_region (GpRegion *source, GpRegion *dest) GDIP_INTERNAL; #include "region.h" #endif libgdiplus-6.0.4+dfsg/src/graphics.c0000644000175000017500000021064013545154623020064 0ustar directhexdirecthex/* * graphics.c * * Copyright (c) 2003 Alexandre Pigolkine, Novell Inc. * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Sebastien Pouliot * Frederik Carlier */ #include "graphics-private.h" #include "general-private.h" #include "graphics-cairo-private.h" #include "graphics-metafile-private.h" #include "region-private.h" #include "graphics-path-private.h" #include "brush-private.h" #include "matrix-private.h" #include "bitmap-private.h" #include "metafile-private.h" #include #define NO_CAIRO_AA #define MAX_GRAPHICS_STATE_STACK 512 float gdip_unit_conversion (Unit from, Unit to, float dpi, GraphicsType type, float nSrc) { float inchs = 0; switch (from) { case UnitDocument: inchs = nSrc / 300.0f; break; case UnitInch: inchs = nSrc; break; case UnitMillimeter: inchs = nSrc / 25.4f; break; case UnitDisplay: if (type == gtPostScript) { /* Uses 1/100th on printers */ inchs = nSrc / 100; } else { /* Pixel for video display */ inchs = nSrc / dpi; } break; case UnitPixel: case UnitWorld: inchs = nSrc / dpi; break; case UnitPoint: inchs = nSrc / 72.0f; break; case UnitCairoPoint: if (type == gtPostScript) { /* Uses 1/100th on printers */ inchs = nSrc / 72.0f; } else { /* Pixel for video display */ inchs = nSrc / dpi; } break; default: return nSrc; } switch (to) { case UnitDocument: return inchs * 300.0f; case UnitInch: return inchs; case UnitMillimeter: return inchs * 25.4f; case UnitDisplay: if (type == gtPostScript) { /* Uses 1/100th on printers */ return inchs * 100; } else { /* Pixel for video display */ return inchs * dpi; } case UnitPixel: case UnitWorld: return inchs * dpi; case UnitPoint: return inchs * 72.0f; case UnitCairoPoint: if (type == gtPostScript) { /* Uses 1/100th on printers */ return inchs * 72.0f; } else { /* Pixel for video display */ return inchs * dpi; } default: return nSrc; } } static void gdip_graphics_reset (GpGraphics *graphics) { /* if required, previous_matrix will be assigned later (e.g. containers) */ cairo_matrix_init_identity (&graphics->previous_matrix); GdipResetClip (graphics); cairo_matrix_init_identity (graphics->clip_matrix); graphics->page_unit = UnitDisplay; graphics->scale = 1.0f; graphics->interpolation = InterpolationModeBilinear; graphics->composite_quality = CompositingQualityDefault; graphics->composite_mode = CompositingModeSourceOver; graphics->text_mode = TextRenderingHintSystemDefault; graphics->pixel_mode = PixelOffsetModeDefault; graphics->text_contrast = DEFAULT_TEXT_CONTRAST; GdipSetSmoothingMode(graphics, SmoothingModeNone); } static void gdip_graphics_common_init (GpGraphics *graphics) { graphics->image = NULL; graphics->type = gtUndefined; cairo_identity_matrix (graphics->ct); GdipCreateMatrix (&graphics->copy_of_ctm); cairo_matrix_init_identity (graphics->copy_of_ctm); GdipCreateRegion (&graphics->clip); GdipCreateMatrix (&graphics->clip_matrix); graphics->bounds.X = graphics->bounds.Y = graphics->bounds.Width = graphics->bounds.Height = 0; graphics->orig_bounds.X = graphics->orig_bounds.Y = graphics->orig_bounds.Width = graphics->orig_bounds.Height = 0; graphics->last_pen = NULL; graphics->last_brush = NULL; graphics->saved_status = NULL; graphics->saved_status_pos = 0; graphics->render_origin_x = 0; graphics->render_origin_y = 0; graphics->dpi_x = graphics->dpi_y = 0; graphics->state = GraphicsStateValid; #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE graphics->display = (Display*)NULL; graphics->drawable = (Drawable)NULL; #endif gdip_graphics_reset (graphics); } static void gdip_graphics_cairo_init (GpGraphics *graphics, cairo_surface_t *surface) { graphics->backend = GraphicsBackEndCairo; graphics->metafile = NULL; graphics->ct = cairo_create (surface); #ifndef NO_CAIRO_AA cairo_set_shape_format (graphics->ct, CAIRO_FORMAT_A1); #endif /* cairo_select_font_face (graphics->ct, "serif:12"); */ cairo_select_font_face (graphics->ct, "serif:12", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); gdip_graphics_common_init (graphics); } GpGraphics * gdip_graphics_new (cairo_surface_t *surface) { GpGraphics *result = (GpGraphics *) GdipAlloc (sizeof (GpGraphics)); if (result) gdip_graphics_cairo_init (result, surface); return result; } static void gdip_graphics_metafile_init (GpGraphics *graphics, GpMetafile *metafile) { graphics->backend = GraphicsBackEndMetafile; /* some API requires a valid cairo context (even on a metafile-based graphics) */ graphics->metasurface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1); graphics->ct = cairo_create (graphics->metasurface); graphics->metafile = metafile; gdip_graphics_common_init (graphics); } GpGraphics* gdip_metafile_graphics_new (GpMetafile *metafile) { GpGraphics *result = (GpGraphics *) GdipAlloc (sizeof (GpGraphics)); if (result) gdip_graphics_metafile_init (result, metafile); return result; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateFromHDC (HDC hdc, GpGraphics **graphics) { GpGraphics *clone = (GpGraphics *)hdc; #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE cairo_surface_t *surface; int x, y; unsigned int w, h, border_w, depth; #endif if (!gdiplusInitialized) return GdiplusNotInitialized; if (!graphics) return InvalidParameter; if (!hdc) return OutOfMemory; #if defined(WIN32) // HDC returns to a device context. The remainer of this function assumes that hdc really // is a GpGrahpics, but that's almost guaranteed to be not the case on Windows. Just fail // quickly instead of segfauling. return NotImplemented; #endif #ifdef CAIRO_HAS_PS_SURFACE if (clone->type == gtPostScript) { *graphics = clone; return Ok; } #endif if (clone->type == gtMemoryBitmap) return GdipGetImageGraphicsContext (clone->image, graphics); #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE Window root; XGetGeometry (clone->display, clone->drawable, &root, &x, &y, &w, &h, &border_w, &depth); surface = cairo_xlib_surface_create(clone->display, clone->drawable, DefaultVisual(clone->display, DefaultScreen(clone->display)), w, h); *graphics = gdip_graphics_new (surface); if (!*graphics) { cairo_surface_destroy (surface); return OutOfMemory; } (*graphics)->dpi_x = (*graphics)->dpi_y = gdip_get_display_dpi (); cairo_surface_destroy (surface); if ((*graphics)->drawable) (*graphics)->drawable = clone->drawable; if ((*graphics)->display) (*graphics)->display = clone->display; return Ok; #endif return NotImplemented; } GpStatus WINGDIPAPI GdipCreateFromHDC2 (HDC hdc, HANDLE hDevice, GpGraphics **graphics) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!graphics) return InvalidParameter; if (hDevice) return NotImplemented; return GdipCreateFromHDC (hdc, graphics); } GpStatus WINGDIPAPI GdipCreateFromHWND (HWND hwnd, GpGraphics **graphics) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!graphics) return InvalidParameter; return NotImplemented; } GpStatus WINGDIPAPI GdipCreateFromHWNDICM (HWND hwnd, GpGraphics **graphics) { return GdipCreateFromHWND (hwnd, graphics); } #ifdef CAIRO_HAS_QUARTZ_SURFACE // coverity[+alloc : arg-*3] GpStatus GdipCreateFromContext_macosx (void *ctx, int width, int height, GpGraphics **graphics) { cairo_surface_t *surface; if (!graphics) return InvalidParameter; surface = cairo_quartz_surface_create (0, width, height); *graphics = gdip_graphics_new (surface); if (!*graphics) { cairo_surface_destroy (surface); return OutOfMemory; } (*graphics)->dpi_x = (*graphics)->dpi_y = gdip_get_display_dpi (); cairo_surface_destroy (surface); (*graphics)->bounds.Width = width; (*graphics)->bounds.Height = height; (*graphics)->orig_bounds.Width = width; (*graphics)->orig_bounds.Height = height; (*graphics)->type = gtOSXDrawable; (*graphics)->cg_context = ctx; return Ok; } #endif #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE // coverity[+alloc : arg-*2] GpStatus GdipCreateFromXDrawable_linux(Drawable d, Display *dpy, GpGraphics **graphics) { Window root_ignore; GpRect bounds; int bwidth_ignore, depth_ignore; cairo_surface_t *surface; if (!graphics) return InvalidParameter; XGetGeometry (dpy, d, &root_ignore, &bounds.X, &bounds.Y, (unsigned int *)&bounds.Width, (unsigned int *)&bounds.Height, (unsigned int *)&bwidth_ignore, (unsigned int *)&depth_ignore); surface = cairo_xlib_surface_create(dpy, d, DefaultVisual(dpy, DefaultScreen(dpy)), bounds.Width, bounds.Height); *graphics = gdip_graphics_new(surface); if (!*graphics) { cairo_surface_destroy (surface); return OutOfMemory; } (*graphics)->dpi_x = (*graphics)->dpi_y = gdip_get_display_dpi (); cairo_surface_destroy (surface); (*graphics)->type = gtX11Drawable; (*graphics)->display = dpy; (*graphics)->drawable = d; GdipSetVisibleClip_linux (*graphics, &bounds); return Ok; } #endif #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE static int ignore_error_handler (Display *dpy, XErrorEvent *event) { return Success; } #endif GpStatus WINGDIPAPI GdipDeleteGraphics (GpGraphics *graphics) { if (!graphics) return InvalidParameter; if (graphics->state != GraphicsStateValid) return ObjectBusy; /* We don't destroy image because we did not create one. */ if (graphics->copy_of_ctm) { GdipDeleteMatrix (graphics->copy_of_ctm); graphics->copy_of_ctm = NULL; } if (graphics->clip) { GdipDeleteRegion (graphics->clip); graphics->clip = NULL; } if (graphics->clip_matrix) { GdipDeleteMatrix (graphics->clip_matrix); graphics->clip_matrix = NULL; } if (graphics->ct) { #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE int (*old_error_handler)(Display *dpy, XErrorEvent *ev) = NULL; if (graphics->type == gtX11Drawable) old_error_handler = XSetErrorHandler (ignore_error_handler); #endif cairo_destroy (graphics->ct); graphics->ct = NULL; #if defined(HAVE_X11) && CAIRO_HAS_XLIB_SURFACE if (graphics->type == gtX11Drawable) XSetErrorHandler (old_error_handler); #endif } if (graphics->backend == GraphicsBackEndMetafile) { /* if recording this is where we save the metafile (stream or file) */ if (graphics->metafile->recording) gdip_metafile_stop_recording (graphics->metafile); cairo_surface_destroy (graphics->metasurface); graphics->metasurface = NULL; } if (graphics->saved_status) { GpState* pos_state = graphics->saved_status; int i; for (i = 0; i < MAX_GRAPHICS_STATE_STACK; i++, pos_state++) { if (pos_state->clip) GdipDeleteRegion (pos_state->clip); } GdipFree (graphics->saved_status); graphics->saved_status = NULL; } GdipFree (graphics); return Ok; } GpStatus WINGDIPAPI GdipGetDC (GpGraphics *graphics, HDC *hdc) { if (!graphics || !hdc) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *hdc = (void *)graphics; graphics->state = GraphicsStateBusy; return Ok; } GpStatus WINGDIPAPI GdipReleaseDC (GpGraphics *graphics, HDC hdc) { if (!graphics || !hdc || graphics->state != GraphicsStateBusy) return InvalidParameter; if (hdc != (void *)graphics) return InvalidParameter; graphics->state = GraphicsStateValid; return Ok; } GpStatus WINGDIPAPI GdipRestoreGraphics (GpGraphics *graphics, GraphicsState state) { GpStatus status; GpState *pos_state; if (!graphics) return InvalidParameter; if (state <= 0 || (state - 1) >= MAX_GRAPHICS_STATE_STACK || (state - 1) > graphics->saved_status_pos) return InvalidParameter; pos_state = graphics->saved_status; pos_state += (state - 1); /* Save from GpState to Graphics */ gdip_cairo_matrix_copy (graphics->copy_of_ctm, &pos_state->matrix); gdip_cairo_matrix_copy (&graphics->previous_matrix, &pos_state->previous_matrix); GdipSetRenderingOrigin (graphics, pos_state->org_x, pos_state->org_y); if (graphics->clip) GdipDeleteRegion (graphics->clip); status = GdipCloneRegion (pos_state->clip, &graphics->clip); if (status != Ok) return status; gdip_cairo_matrix_copy (graphics->clip_matrix, &pos_state->clip_matrix); graphics->composite_mode = pos_state->composite_mode; graphics->composite_quality = pos_state->composite_quality; graphics->interpolation = pos_state->interpolation; graphics->page_unit = pos_state->page_unit; graphics->scale = pos_state->scale; GdipSetSmoothingMode(graphics, pos_state->draw_mode); graphics->text_mode = pos_state->text_mode; graphics->pixel_mode = pos_state->pixel_mode; graphics->text_contrast = pos_state->text_contrast; graphics->saved_status_pos = state; /* re-adjust clipping (region and matrix) */ gdip_cairo_set_matrix (graphics, graphics->copy_of_ctm); /* GdipCloneRegion was called, but for some reason, not registred as an allocation */ /* coverity[freed_arg] */ return cairo_SetGraphicsClip (graphics); } GpStatus WINGDIPAPI GdipSaveGraphics (GpGraphics *graphics, GraphicsState *state) { GpStatus status; GpState* pos_state; if (!graphics || !state) return InvalidParameter; if (!graphics->saved_status) { graphics->saved_status = gdip_calloc (MAX_GRAPHICS_STATE_STACK, sizeof (GpState)); if (!graphics->saved_status) return OutOfMemory; graphics->saved_status_pos = 0; } if (graphics->saved_status_pos >= MAX_GRAPHICS_STATE_STACK) return OutOfMemory; pos_state = graphics->saved_status; pos_state += graphics->saved_status_pos; /* Save from Graphics to GpState */ gdip_cairo_matrix_copy (&pos_state->matrix, graphics->copy_of_ctm); GdipGetRenderingOrigin (graphics, &pos_state->org_x, &pos_state->org_y); gdip_cairo_matrix_copy (&pos_state->previous_matrix, &graphics->previous_matrix); if (pos_state->clip) GdipDeleteRegion (pos_state->clip); status = GdipCloneRegion (graphics->clip, &pos_state->clip); if (status != Ok) return status; gdip_cairo_matrix_copy (&pos_state->clip_matrix, graphics->clip_matrix); pos_state->composite_mode = graphics->composite_mode; pos_state->composite_quality = graphics->composite_quality; pos_state->interpolation = graphics->interpolation; pos_state->page_unit = graphics->page_unit; pos_state->scale = graphics->scale; pos_state->draw_mode = graphics->draw_mode; pos_state->text_mode = graphics->text_mode; pos_state->pixel_mode = graphics->pixel_mode; pos_state->text_contrast = graphics->text_contrast; *state = graphics->saved_status_pos + 1; // make sure GraphicsState is non-zero for compat with GDI+ graphics->saved_status_pos++; return Ok; } static void apply_world_to_bounds (GpGraphics *graphics) { GpPointF pts[2]; pts[0].X = graphics->orig_bounds.X; pts[0].Y = graphics->orig_bounds.Y; pts[1].X = graphics->orig_bounds.X + graphics->orig_bounds.Width; pts[1].Y = graphics->orig_bounds.Y + graphics->orig_bounds.Height; GdipTransformMatrixPoints (graphics->clip_matrix, pts, 2); if (pts[0].X > pts[1].X) { graphics->bounds.X = pts[1].X; graphics->bounds.Width = iround (pts[0].X - pts[1].X); } else { graphics->bounds.X = pts[0].X; graphics->bounds.Width = iround (pts[1].X - pts[0].X); } if (pts[0].Y > pts[1].Y) { graphics->bounds.Y = pts[1].Y; graphics->bounds.Height = iround (pts[0].Y - pts[1].Y); } else { graphics->bounds.Y = pts[0].Y; graphics->bounds.Height = iround (pts[1].Y - pts[0].Y); } } GpStatus WINGDIPAPI GdipResetWorldTransform (GpGraphics *graphics) { if (!graphics) return InvalidParameter; if (!gdip_is_matrix_empty (&graphics->previous_matrix)) { /* inside a container only reset to the previous transform */ gdip_cairo_matrix_copy (graphics->copy_of_ctm, &graphics->previous_matrix); gdip_cairo_matrix_copy (graphics->clip_matrix, &graphics->previous_matrix); GdipInvertMatrix (graphics->clip_matrix); } else { cairo_matrix_init_identity (graphics->copy_of_ctm); cairo_matrix_init_identity (graphics->clip_matrix); } apply_world_to_bounds (graphics); switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_ResetWorldTransform (graphics); case GraphicsBackEndMetafile: return metafile_ResetWorldTransform (graphics); default: return GenericError; } } GpStatus WINGDIPAPI GdipSetWorldTransform (GpGraphics *graphics, GpMatrix *matrix) { BOOL invertible; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!matrix) return InvalidParameter; // Inverting an identity matrix result in the identity matrix. if (gdip_is_matrix_empty (matrix)) return GdipResetWorldTransform (graphics); // The matrix must be invertible to be used. GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; GpMatrix matrixCopy; gdip_cairo_matrix_copy (&matrixCopy, matrix); if (!gdip_is_matrix_empty (&graphics->previous_matrix)) { /* inside a container the transform is appended to the previous transform */ GdipMultiplyMatrix (&matrixCopy, &graphics->previous_matrix, MatrixOrderAppend); } gdip_cairo_matrix_copy (graphics->copy_of_ctm, &matrixCopy); gdip_cairo_matrix_copy (graphics->clip_matrix, &matrixCopy); /* we already know it's invertible */ GdipInvertMatrix (graphics->clip_matrix); apply_world_to_bounds (graphics); switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_SetWorldTransform (graphics, &matrixCopy); case GraphicsBackEndMetafile: return metafile_SetWorldTransform (graphics, &matrixCopy); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetWorldTransform (GpGraphics *graphics, GpMatrix *matrix) { if (!graphics || !matrix) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; /* get the effective matrix from cairo */ gdip_cairo_matrix_copy (matrix, graphics->copy_of_ctm); /* if we're inside a container then the previous matrix are hidden */ if (!gdip_is_matrix_empty (&graphics->previous_matrix)) { cairo_matrix_t inverted; /* substract the previous matrix from the effective matrix */ gdip_cairo_matrix_copy (&inverted, &graphics->previous_matrix); cairo_matrix_invert (&inverted); return GdipMultiplyMatrix (matrix, &inverted, MatrixOrderAppend); } return Ok; } GpStatus WINGDIPAPI GdipMultiplyWorldTransform (GpGraphics *graphics, GpMatrix *matrix, GpMatrixOrder order) { GpStatus s; BOOL invertible; GpMatrix inverted; if (!graphics) return InvalidParameter; /* the matrix MUST be invertible to be used */ s = GdipIsMatrixInvertible (matrix, &invertible); if (!invertible || (s != Ok)) return InvalidParameter; s = GdipMultiplyMatrix (graphics->copy_of_ctm, matrix, order); if (s != Ok) return s; /* Multiply the inverted matrix with the clipping matrix */ gdip_cairo_matrix_copy (&inverted, matrix); s = GdipInvertMatrix (&inverted); if (s != Ok) return s; s = GdipMultiplyMatrix (graphics->clip_matrix, &inverted, order); if (s != Ok) return s; apply_world_to_bounds (graphics); switch (graphics->backend) { case GraphicsBackEndCairo: /* not a typo - we apply to calculated matrix to cairo context */ return cairo_SetWorldTransform (graphics, graphics->copy_of_ctm); case GraphicsBackEndMetafile: return metafile_MultiplyWorldTransform (graphics, matrix, order); default: return GenericError; } } GpStatus WINGDIPAPI GdipRotateWorldTransform (GpGraphics *graphics, REAL angle, GpMatrixOrder order) { GpStatus s; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; s = GdipRotateMatrix (graphics->copy_of_ctm, angle, order); if (s != Ok) return s; s = GdipRotateMatrix (graphics->clip_matrix, -angle, gdip_matrix_reverse_order (order)); if (s != Ok) return s; apply_world_to_bounds (graphics); switch (graphics->backend) { case GraphicsBackEndCairo: /* not a typo - we apply to calculated matrix to cairo context */ return cairo_SetWorldTransform (graphics, graphics->copy_of_ctm); case GraphicsBackEndMetafile: return metafile_RotateWorldTransform (graphics, angle, order); default: return GenericError; } } GpStatus WINGDIPAPI GdipScaleWorldTransform (GpGraphics *graphics, REAL sx, REAL sy, GpMatrixOrder order) { GpStatus s; if (!graphics || (sx == 0.0f) || (sy == 0.0f)) return InvalidParameter; s = GdipScaleMatrix (graphics->copy_of_ctm, sx, sy, order); if (s != Ok) return s; s = GdipScaleMatrix (graphics->clip_matrix, (1.0f / sx), (1.0f / sy), gdip_matrix_reverse_order (order)); if (s != Ok) return s; apply_world_to_bounds (graphics); switch (graphics->backend) { case GraphicsBackEndCairo: /* not a typo - we apply to calculated matrix to cairo context */ return cairo_SetWorldTransform (graphics, graphics->copy_of_ctm); case GraphicsBackEndMetafile: return metafile_ScaleWorldTransform (graphics, sx, sy, order); default: return GenericError; } } GpStatus WINGDIPAPI GdipTranslateWorldTransform (GpGraphics *graphics, REAL dx, REAL dy, GpMatrixOrder order) { GpStatus s; if (!graphics) return InvalidParameter; s = GdipTranslateMatrix (graphics->copy_of_ctm, dx, dy, order); if (s != Ok) return s; s = GdipTranslateMatrix (graphics->clip_matrix, -dx, -dy, gdip_matrix_reverse_order (order)); if (s != Ok) return s; apply_world_to_bounds (graphics); switch (graphics->backend) { case GraphicsBackEndCairo: /* not a typo - we apply to calculated matrix to cairo context */ return cairo_SetWorldTransform (graphics, graphics->copy_of_ctm); case GraphicsBackEndMetafile: return metafile_TranslateWorldTransform (graphics, dx, dy, order); default: return GenericError; } } /* * Draw operations - validate parameters and delegate to cairo/metafile backends */ GpStatus WINGDIPAPI GdipDrawArc (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || width <= 0 || height <= 0) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawArc (graphics, pen, x, y, width, height, startAngle, sweepAngle); case GraphicsBackEndMetafile: return metafile_DrawArc (graphics, pen, x, y, width, height, startAngle, sweepAngle); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawArcI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return GdipDrawArc (graphics, pen, x, y, width, height, startAngle, sweepAngle); } GpStatus WINGDIPAPI GdipDrawBezier (GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4) { PointF points[4] = { {x1, y1}, {x2, y2}, {x3, y3}, {x4, y4} }; return GdipDrawBeziers (graphics, pen, points, 4); } GpStatus WINGDIPAPI GdipDrawBezierI (GpGraphics *graphics, GpPen *pen, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4) { return GdipDrawBezier (graphics, pen, x1, y1, x2, y2, x3, y3, x4, y4); } GpStatus WINGDIPAPI GdipDrawBeziers (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { if (!graphics || !points || count <= 0 || (count > 3 && (count % 3) != 1)) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen) return InvalidParameter; // Nop if the count is too small to fit any bezier paths. if (count < 3) return Ok; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawBeziers (graphics, pen, points, count); case GraphicsBackEndMetafile: return metafile_DrawBeziers (graphics, pen, points, count); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawBeziersI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count) { GpStatus status; GpPointF *pointsF; if (!points || count < 0) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipDrawBeziers (graphics, pen, pointsF, count); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipDrawEllipse (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawEllipse (graphics, pen, x, y, width, height); case GraphicsBackEndMetafile: return metafile_DrawEllipse (graphics, pen, x, y, width, height); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawEllipseI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height) { return GdipDrawEllipse (graphics, pen, x, y, width, height); } GpStatus WINGDIPAPI GdipDrawLine (GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2) { PointF points[2] = { {x1, y1}, {x2, y2} }; return GdipDrawLines (graphics, pen, points, 2); } GpStatus WINGDIPAPI GdipDrawLineI (GpGraphics *graphics, GpPen *pen, INT x1, INT y1, INT x2, INT y2) { return GdipDrawLine (graphics, pen, x1, y1, x2, y2); } GpStatus WINGDIPAPI GdipDrawLines (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || count < 2) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawLines (graphics, pen, points, count); case GraphicsBackEndMetafile: return metafile_DrawLines (graphics, pen, points, count); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawLinesI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipDrawLines (graphics, pen, pointsF, count); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipDrawPath (GpGraphics *graphics, GpPen *pen, GpPath *path) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || !path) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawPath (graphics, pen, path); case GraphicsBackEndMetafile: return metafile_DrawPath (graphics, pen, path); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawPie (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || width <= 0 || height <= 0) return InvalidParameter; /* We don't do anything, if sweep angle is zero. */ if (sweepAngle == 0) return Ok; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawPie (graphics, pen, x, y, width, height, startAngle, sweepAngle); case GraphicsBackEndMetafile: return metafile_DrawPie (graphics, pen, x, y, width, height, startAngle, sweepAngle); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawPieI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return GdipDrawPie (graphics, pen, x, y, width, height, startAngle, sweepAngle); } GpStatus WINGDIPAPI GdipDrawPolygon (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || count < 2) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawPolygon (graphics, pen, points, count); case GraphicsBackEndMetafile: return metafile_DrawPolygon (graphics, pen, points, count); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawPolygonI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipDrawPolygon (graphics, pen, pointsF, count); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipDrawRectangle (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height) { RectF rect = {x, y, width, height}; return GdipDrawRectangles (graphics, pen, &rect, 1); } GpStatus WINGDIPAPI GdipDrawRectangleI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height) { return GdipDrawRectangle (graphics, pen, x, y, width, height); } GpStatus WINGDIPAPI GdipDrawRectangles (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, INT count) { if (!graphics || !rects || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawRectangles (graphics, pen, rects, count); case GraphicsBackEndMetafile: return metafile_DrawRectangles (graphics, pen, rects, count); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawRectanglesI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRect *rects, INT count) { GpStatus status; GpRectF *rectsF; if (!rects || count < 0) return InvalidParameter; rectsF = convert_rects (rects, count); if (!rectsF) return OutOfMemory; status = GdipDrawRectangles (graphics, pen, rectsF, count); GdipFree (rectsF); return status; } GpStatus WINGDIPAPI GdipDrawClosedCurve (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { return GdipDrawClosedCurve2 (graphics, pen, points, count, 0.5f); } GpStatus WINGDIPAPI GdipDrawClosedCurveI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count) { return GdipDrawClosedCurve2I (graphics, pen, points, count, 0.5f); } GpStatus WINGDIPAPI GdipDrawClosedCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension) { if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || count < 3) return InvalidParameter; /* when tension is 0, draw straight lines */ if (tension == 0) return GdipDrawPolygon (graphics, pen, points, count); switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawClosedCurve2 (graphics, pen, points, count, tension); case GraphicsBackEndMetafile: return metafile_DrawClosedCurve2 (graphics, pen, points, count, tension); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawClosedCurve2I (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipDrawClosedCurve2 (graphics, pen, pointsF, count, tension); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipDrawCurve (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { return GdipDrawCurve2 (graphics, pen, points, count, 0.5f); } GpStatus WINGDIPAPI GdipDrawCurveI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count) { return GdipDrawCurve2I (graphics, pen, points, count, 0.5f); } GpStatus WINGDIPAPI GdipDrawCurve2 (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPointF *points, INT count, REAL tension) { if (count == 2) return GdipDrawLines (graphics, pen, points, count); return GdipDrawCurve3 (graphics, pen, points, count, 0, count - 1, tension); } GpStatus WINGDIPAPI GdipDrawCurve2I (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPoint *points, INT count, REAL tension) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipDrawCurve2 (graphics, pen, pointsF, count, tension); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipDrawCurve3 (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPointF *points, INT count, INT offset, INT numOfSegments, REAL tension) { if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!pen || count < 2 || offset < 0 || offset >= count) return InvalidParameter; if (numOfSegments < 1 || numOfSegments >= count - offset) return InvalidParameter; /* draw lines if tension = 0 */ if (tension == 0) return GdipDrawLines (graphics, pen, points, count); switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_DrawCurve3 (graphics, pen, points, count, offset, numOfSegments, tension); case GraphicsBackEndMetafile: return metafile_DrawCurve3 (graphics, pen, points, count, offset, numOfSegments, tension); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawCurve3I (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPoint *points, INT count, INT offset, INT numOfSegments, REAL tension) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipDrawCurve3 (graphics, pen, pointsF, count, offset, numOfSegments, tension); GdipFree (pointsF); return status; } /* * Fills */ GpStatus WINGDIPAPI GdipFillEllipse (GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!brush) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillEllipse (graphics, brush, x, y, width, height); case GraphicsBackEndMetafile: return metafile_FillEllipse (graphics, brush, x, y, width, height); default: return GenericError; } } GpStatus WINGDIPAPI GdipFillEllipseI (GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height) { return GdipFillEllipse (graphics, brush, x, y, width, height); } GpStatus WINGDIPAPI GdipFillRectangle (GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height) { RectF rect = {x, y, width, height}; return GdipFillRectangles (graphics, brush, &rect, 1); } GpStatus WINGDIPAPI GdipFillRectangleI (GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height) { return GdipFillRectangle (graphics, brush, x, y, width, height); } GpStatus WINGDIPAPI GdipFillRectangles (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, INT count) { if (!graphics || !rects || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!brush) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillRectangles (graphics, brush, rects, count); case GraphicsBackEndMetafile: return metafile_FillRectangles (graphics, brush, rects, count); default: return GenericError; } } GpStatus WINGDIPAPI GdipFillRectanglesI (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRect *rects, INT count) { GpStatus status; GpRectF *rectsF; if (count < 0) return OutOfMemory; if (!rects) return InvalidParameter; rectsF = convert_rects (rects, count); if (!rectsF) return OutOfMemory; status = GdipFillRectangles (graphics, brush, rectsF, count); GdipFree (rectsF); return status; } GpStatus WINGDIPAPI GdipFillPie (GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!brush || width <= 0 || height <= 0) return InvalidParameter; // Don't do anything if sweep angle is zero. if (sweepAngle == 0) return Ok; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillPie (graphics, brush, x, y, width, height, startAngle, sweepAngle); case GraphicsBackEndMetafile: return metafile_FillPie (graphics, brush, x, y, width, height, startAngle, sweepAngle); default: return GenericError; } } GpStatus WINGDIPAPI GdipFillPieI (GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return GdipFillPie (graphics, brush, x, y, width, height, startAngle, sweepAngle); } GpStatus WINGDIPAPI GdipFillPath (GpGraphics *graphics, GpBrush *brush, GpPath *path) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!brush || !path) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillPath (graphics, brush, path); case GraphicsBackEndMetafile: return metafile_FillPath (graphics, brush, path); default: return GenericError; } } GpStatus WINGDIPAPI GdipFillPolygon (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, GpFillMode fillMode) { if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!brush || fillMode > FillModeWinding) return InvalidParameter; // Don't do anything if sweep angle is zero. if (count < 2) return Ok; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillPolygon (graphics, brush, points, count, fillMode); case GraphicsBackEndMetafile: return metafile_FillPolygon (graphics, brush, points, count, fillMode); default: return GenericError; } } GpStatus WINGDIPAPI GdipFillPolygonI (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, GpFillMode fillMode) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipFillPolygon (graphics, brush, pointsF, count, fillMode); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipFillPolygon2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count) { return GdipFillPolygon (graphics, brush, points, count, FillModeAlternate); } GpStatus WINGDIPAPI GdipFillPolygon2I (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count) { return GdipFillPolygonI (graphics, brush, points, count, FillModeAlternate); } GpStatus WINGDIPAPI GdipFillClosedCurve (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count) { return GdipFillClosedCurve2 (graphics, brush, points, count, 0.5f, FillModeAlternate); } GpStatus WINGDIPAPI GdipFillClosedCurveI (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count) { return GdipFillClosedCurve2I (graphics, brush, points, count, 0.5f, FillModeAlternate); } GpStatus WINGDIPAPI GdipFillClosedCurve2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fillMode) { if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!brush || fillMode > FillModeWinding) return InvalidParameter; // Nop if the count is too small. if (count < 3) return Ok; /* when tension is 0, the edges are straight lines */ if (tension == 0) return GdipFillPolygon2 (graphics, brush, points, count); if (!graphics || !brush || !points) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillClosedCurve2 (graphics, brush, points, count, tension, fillMode); case GraphicsBackEndMetafile: return metafile_FillClosedCurve2 (graphics, brush, points, count, tension, fillMode); default: return GenericError; } } GpStatus WINGDIPAPI GdipFillClosedCurve2I (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, REAL tension, GpFillMode fillMode) { GpStatus status; GpPointF *pointsF; if (count < 0) return OutOfMemory; if (!points) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; status = GdipFillClosedCurve2 (graphics, brush, pointsF, count, tension, fillMode); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipFillRegion (GpGraphics *graphics, GpBrush *brush, GpRegion *region) { if (!graphics || !brush || !region) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_FillRegion (graphics, brush, region); case GraphicsBackEndMetafile: return metafile_FillRegion (graphics, brush, region); default: return GenericError; } } GpStatus WINGDIPAPI GdipSetRenderingOrigin (GpGraphics *graphics, INT x, INT y) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; graphics->render_origin_x = x; graphics->render_origin_y = y; switch (graphics->backend) { case GraphicsBackEndCairo: return Ok; case GraphicsBackEndMetafile: return metafile_SetRenderingOrigin (graphics, x, y); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetRenderingOrigin (GpGraphics *graphics, INT *x, INT *y) { if (!graphics || !x || !y) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *x = graphics->render_origin_x; *y = graphics->render_origin_y; return Ok; } GpStatus WINGDIPAPI GdipGetDpiX (GpGraphics *graphics, REAL *dpi) { if (!graphics || !dpi) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *dpi = graphics->dpi_x; return Ok; } GpStatus WINGDIPAPI GdipGetDpiY (GpGraphics *graphics, REAL *dpi) { if (!graphics || !dpi) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *dpi = graphics->dpi_y; return Ok; } GpStatus WINGDIPAPI GdipGraphicsClear (GpGraphics *graphics, ARGB color) { if (!graphics) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_GraphicsClear (graphics, color); case GraphicsBackEndMetafile: return metafile_GraphicsClear (graphics, color); default: return GenericError; } } GpStatus WINGDIPAPI GdipSetInterpolationMode (GpGraphics *graphics, InterpolationMode interpolationMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (interpolationMode <= InterpolationModeInvalid || interpolationMode > InterpolationModeHighQualityBicubic) return InvalidParameter; switch (interpolationMode) { case InterpolationModeDefault: case InterpolationModeLowQuality: graphics->interpolation = InterpolationModeBilinear; break; case InterpolationModeHighQuality: graphics->interpolation = InterpolationModeHighQualityBicubic; break; default: graphics->interpolation = interpolationMode; break; } switch (graphics->backend) { case GraphicsBackEndCairo: return Ok; case GraphicsBackEndMetafile: return metafile_SetInterpolationMode (graphics, interpolationMode); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetInterpolationMode (GpGraphics *graphics, InterpolationMode *interpolationMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!interpolationMode) return InvalidParameter; *interpolationMode = graphics->interpolation; return Ok; } GpStatus WINGDIPAPI GdipSetTextRenderingHint (GpGraphics *graphics, TextRenderingHint mode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (mode > TextRenderingHintClearTypeGridFit) return InvalidParameter; graphics->text_mode = mode; switch (graphics->backend) { case GraphicsBackEndCairo: return Ok; case GraphicsBackEndMetafile: return metafile_SetTextRenderingHint (graphics, mode); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetTextRenderingHint (GpGraphics *graphics, TextRenderingHint *mode) { if (!graphics || !mode) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *mode = graphics->text_mode; return Ok; } /* MonoTODO - pixel offset mode isn't supported */ GpStatus WINGDIPAPI GdipSetPixelOffsetMode (GpGraphics *graphics, PixelOffsetMode pixelOffsetMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (pixelOffsetMode <= PixelOffsetModeInvalid || pixelOffsetMode > PixelOffsetModeHalf) return InvalidParameter; graphics->pixel_mode = pixelOffsetMode; switch (graphics->backend) { case GraphicsBackEndCairo: /* FIXME: changing pixel mode affects other properties (e.g. the visible clip bounds) */ return Ok; case GraphicsBackEndMetafile: return metafile_SetPixelOffsetMode (graphics, pixelOffsetMode); default: return GenericError; } } /* MonoTODO - pixel offset mode isn't supported */ GpStatus WINGDIPAPI GdipGetPixelOffsetMode (GpGraphics *graphics, PixelOffsetMode *pixelOffsetMode) { if (!graphics || !pixelOffsetMode) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *pixelOffsetMode = graphics->pixel_mode; return Ok; } /* MonoTODO - text contrast isn't supported */ GpStatus WINGDIPAPI GdipSetTextContrast (GpGraphics *graphics, UINT contrast) { // The gamma correction value must be less than 12. // The default value is 4. if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (contrast > 12) return InvalidParameter; graphics->text_contrast = contrast; switch (graphics->backend) { case GraphicsBackEndCairo: return Ok; case GraphicsBackEndMetafile: return metafile_SetTextContrast (graphics, contrast); default: return GenericError; } } /* MonoTODO - text contrast isn't supported */ GpStatus WINGDIPAPI GdipGetTextContrast (GpGraphics *graphics, UINT *contrast) { if (!graphics || !contrast) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *contrast = graphics->text_contrast; return Ok; } GpStatus WINGDIPAPI GdipSetSmoothingMode (GpGraphics *graphics, SmoothingMode smoothingMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (smoothingMode <= SmoothingModeInvalid || smoothingMode > SmoothingModeAntiAlias + 1) return InvalidParameter; switch (smoothingMode) { case SmoothingModeDefault: case SmoothingModeHighSpeed: graphics->draw_mode = SmoothingModeNone; break; case SmoothingModeHighQuality: graphics->draw_mode = SmoothingModeAntiAlias; break; default: graphics->draw_mode = smoothingMode; break; } switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_SetSmoothingMode (graphics, smoothingMode); case GraphicsBackEndMetafile: return metafile_SetSmoothingMode (graphics, smoothingMode); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetSmoothingMode (GpGraphics *graphics, SmoothingMode *smoothingMode) { if (!graphics || !smoothingMode) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *smoothingMode = graphics->draw_mode; return Ok; } /* MonoTODO - dstrect, srcrect and unit support isn't implemented */ GpStatus WINGDIPAPI GdipBeginContainer (GpGraphics *graphics, GDIPCONST GpRectF* dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state) { if (!graphics || !dstrect || !srcrect || (unit < UnitPixel) || (unit > UnitMillimeter)) return InvalidParameter; return GdipBeginContainer2 (graphics, state); } GpStatus WINGDIPAPI GdipBeginContainer2 (GpGraphics *graphics, GraphicsContainer* state) { GpStatus status; if (!graphics || !state) return InvalidParameter; status = GdipSaveGraphics (graphics, state); if (status == Ok) { /* reset most properties to defaults after saving them */ gdip_graphics_reset (graphics); /* copy the current effective matrix as the preivous matrix */ gdip_cairo_matrix_copy (&graphics->previous_matrix, graphics->copy_of_ctm); } return status; } GpStatus WINGDIPAPI GdipBeginContainerI (GpGraphics *graphics, GDIPCONST GpRect* dstrect, GDIPCONST GpRect *srcrect, GpUnit unit, GraphicsContainer *state) { GpRectF dstrectF; GpRectF srcrectF; if (!dstrect || !srcrect) return InvalidParameter; gdip_RectF_from_Rect (dstrect, &dstrectF); gdip_RectF_from_Rect (srcrect, &srcrectF); return GdipBeginContainer (graphics, &dstrectF, &srcrectF, unit, state); } GpStatus WINGDIPAPI GdipEndContainer (GpGraphics *graphics, GraphicsContainer state) { if (!graphics) return InvalidParameter; return GdipRestoreGraphics (graphics, state); } GpStatus WINGDIPAPI GdipFlush (GpGraphics *graphics, GpFlushIntention intention) { cairo_surface_t* surface; if (!graphics) return InvalidParameter; if (graphics->state != GraphicsStateValid) return ObjectBusy; surface = cairo_get_target (graphics->ct); cairo_surface_flush (surface); #ifdef CAIRO_HAS_QUARTZ_SURFACE if (graphics->type == gtOSXDrawable) { CGRect rect; rect.origin.x = 0; rect.origin.y = 0; rect.size.width = graphics->orig_bounds.Width; rect.size.height = graphics->orig_bounds.Height; void *image = CGBitmapContextCreateImage (cairo_quartz_surface_get_cg_context (surface)); CGContextDrawImage (graphics->cg_context, rect, image); CGImageRelease (image); } #endif return Ok; } GpStatus WINGDIPAPI GdipSetClipGraphics (GpGraphics *graphics, GpGraphics *srcgraphics, CombineMode combineMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!srcgraphics) return InvalidParameter; if (srcgraphics->state == GraphicsStateBusy) return ObjectBusy; return GdipSetClipRegion (graphics, srcgraphics->clip, combineMode); } GpStatus WINGDIPAPI GdipSetClipRect (GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, CombineMode combineMode) { GpStatus status; GpRectF rect; GpRegion *region = NULL; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (combineMode > CombineModeComplement) return InvalidParameter; rect.X = x; rect.Y = y; rect.Width = width; rect.Height = height; gdip_normalize_rectangle (&rect, &rect); // Match GDI+ behaviour by setting empty rects to an empty region. if (gdip_is_rectF_empty (&rect, /* allowNegative */ FALSE)) { status = GdipCreateRegion (®ion); if (status != Ok) return status; GdipSetEmpty (region); } else { status = GdipCreateRegionRect (&rect, ®ion); if (status != Ok) return status; } return GdipSetClipRegion (graphics, region, combineMode); } GpStatus WINGDIPAPI GdipSetClipRectI (GpGraphics *graphics, INT x, INT y, INT width, INT height, CombineMode combineMode) { return GdipSetClipRect (graphics, x, y, width, height, combineMode); } GpStatus WINGDIPAPI GdipSetClipPath (GpGraphics *graphics, GpPath *path, CombineMode combineMode) { GpStatus status; GpPath *work; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!path || combineMode > CombineModeComplement) return InvalidParameter; /* if the matrix is empty, avoid path cloning and transform */ if (gdip_is_matrix_empty (graphics->clip_matrix)) { work = path; } else { cairo_matrix_t inverted; gdip_cairo_matrix_copy (&inverted, graphics->clip_matrix); cairo_matrix_invert (&inverted); status = GdipClonePath (path, &work); if (status != Ok) return status; GdipTransformPath (work, &inverted); } status = GdipCombineRegionPath (graphics->clip, work, combineMode); if (status != Ok) goto cleanup; switch (graphics->backend) { case GraphicsBackEndCairo: /* adjust cairo clipping according to graphics->clip */ status = cairo_SetGraphicsClip (graphics); break; case GraphicsBackEndMetafile: status = metafile_SetClipPath (graphics, path, combineMode); break; default: status = GenericError; break; } cleanup: if (work != path) GdipDeletePath (work); return status; } GpStatus WINGDIPAPI GdipSetClipRegion (GpGraphics *graphics, GpRegion *region, CombineMode combineMode) { GpStatus status; GpRegion *work; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!region || combineMode > CombineModeComplement) return InvalidParameter; /* if the matrix is empty, avoid region cloning and transform */ if (gdip_is_matrix_empty (graphics->clip_matrix)) { work = region; } else { cairo_matrix_t inverted; gdip_cairo_matrix_copy (&inverted, graphics->clip_matrix); cairo_matrix_invert (&inverted); GdipCloneRegion (region, &work); GdipTransformRegion (work, &inverted); } status = GdipCombineRegionRegion (graphics->clip, work, combineMode); if (status != Ok) goto cleanup; switch (graphics->backend) { case GraphicsBackEndCairo: /* adjust cairo clipping according to graphics->clip */ status = cairo_SetGraphicsClip (graphics); break; case GraphicsBackEndMetafile: status = metafile_SetClipRegion (graphics, region, combineMode); break; default: status = GenericError; break; } cleanup: if (work != region) GdipDeleteRegion (work); return status; } /* Note: not exposed in System.Drawing.dll */ GpStatus WINGDIPAPI GdipSetClipHrgn (GpGraphics *graphics, void *hRgn, CombineMode combineMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!hRgn) return InvalidParameter; return GdipSetClipRegion (graphics, (GpRegion*)hRgn, combineMode); } GpStatus WINGDIPAPI GdipResetClip (GpGraphics *graphics) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; GdipSetInfinite (graphics->clip); cairo_matrix_init_identity (graphics->clip_matrix); switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_ResetClip (graphics); case GraphicsBackEndMetafile: return metafile_ResetClip (graphics); default: return GenericError; } } GpStatus WINGDIPAPI GdipTranslateClip (GpGraphics *graphics, REAL dx, REAL dy) { GpStatus status; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; status = GdipTranslateRegion (graphics->clip, dx, dy); if (status != Ok) return status; switch (graphics->backend) { case GraphicsBackEndCairo: /* adjust cairo clipping according to graphics->clip */ return cairo_SetGraphicsClip (graphics); case GraphicsBackEndMetafile: return metafile_TranslateClip (graphics, dx, dy); default: return GenericError; } } GpStatus WINGDIPAPI GdipTranslateClipI (GpGraphics *graphics, INT dx, INT dy) { return GdipTranslateClip (graphics, dx, dy); } GpStatus WINGDIPAPI GdipGetClip (GpGraphics *graphics, GpRegion *region) { if (!graphics || !region) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; gdip_clear_region (region); gdip_copy_region (graphics->clip, region); if (gdip_is_matrix_empty (graphics->clip_matrix)) return Ok; return GdipTransformRegion (region, graphics->clip_matrix); } GpStatus WINGDIPAPI GdipGetClipBounds (GpGraphics *graphics, GpRectF *rect) { GpStatus status; BOOL empty; GpRegion *work; if (!graphics || !rect) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; // The clip bounds for empty bounds should be translated. GdipIsEmptyRegion (graphics->clip, graphics, &empty); if (empty) { status = GdipGetRegionBounds (graphics->clip, graphics, rect); if (status != Ok) return status; rect->X += graphics->clip_matrix->x0; rect->Y += graphics->clip_matrix->y0; return Ok; } /* if the matrix is empty, avoid region cloning and transform */ if (gdip_is_matrix_empty (graphics->clip_matrix)) { work = graphics->clip; } else { GdipCloneRegion (graphics->clip, &work); GdipTransformRegion (work, graphics->clip_matrix); } status = GdipGetRegionBounds (work, graphics, rect); if (work != graphics->clip) GdipDeleteRegion (work); return status; } GpStatus WINGDIPAPI GdipGetClipBoundsI (GpGraphics *graphics, GpRect *rect) { GpRectF rectF; GpStatus status; if (!rect) return InvalidParameter; status = GdipGetClipBounds (graphics, &rectF); if (status != Ok) return status; gdip_Rect_from_RectF (&rectF, rect); return Ok; } GpStatus WINGDIPAPI GdipIsClipEmpty (GpGraphics *graphics, BOOL *result) { if (!graphics || !result) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; return GdipIsEmptyRegion (graphics->clip, graphics, result); } GpStatus WINGDIPAPI GdipSetVisibleClip_linux (GpGraphics *graphics, GpRect *rect) { if (!graphics || !rect) return InvalidParameter; graphics->orig_bounds.X = rect->X; graphics->orig_bounds.Y = rect->Y; graphics->orig_bounds.Width = rect->Width; graphics->orig_bounds.Height = rect->Height; graphics->bounds.X = rect->X; graphics->bounds.Y = rect->Y; graphics->bounds.Width = rect->Width; graphics->bounds.Height = rect->Height; return Ok; } GpStatus WINGDIPAPI GdipGetVisibleClipBounds (GpGraphics *graphics, GpRectF *rect) { if (!graphics || !rect) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!gdip_is_InfiniteRegion (graphics->clip)) { GpRectF clipbound; GpStatus status = GdipGetClipBounds (graphics, &clipbound); if (status != Ok) return status; /* intersect clipping with bounds (for clips bigger than the graphics) */ rect->X = (clipbound.X > graphics->bounds.X) ? clipbound.X : graphics->bounds.X; rect->Y = (clipbound.Y > graphics->bounds.Y) ? clipbound.Y : graphics->bounds.Y; rect->Width = (((clipbound.X + clipbound.Width) < (graphics->bounds.X + graphics->bounds.Width)) ? (clipbound.X + clipbound.Width) : (graphics->bounds.X + graphics->bounds.Width)) - rect->X; rect->Height = (((clipbound.Y + clipbound.Height) < (graphics->bounds.Y + graphics->bounds.Height)) ? (clipbound.Y + clipbound.Height) : (graphics->bounds.Y + graphics->bounds.Height)) - rect->Y; } else { rect->X = graphics->bounds.X; rect->Y = graphics->bounds.Y; rect->Width = graphics->bounds.Width; rect->Height = graphics->bounds.Height; } return Ok; } GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI (GpGraphics *graphics, GpRect *rect) { GpStatus status; GpRectF rectF; if (!graphics || !rect) return InvalidParameter; status = GdipGetVisibleClipBounds (graphics, &rectF); if (status != Ok) return status; gdip_Rect_from_RectF (&rectF, rect); return Ok; } GpStatus WINGDIPAPI GdipIsVisibleClipEmpty (GpGraphics *graphics, BOOL *result) { GpRectF visibleClipBounds; if (!graphics || !result) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; GdipGetVisibleClipBounds (graphics, &visibleClipBounds); *result = visibleClipBounds.Width == 0 || visibleClipBounds.Height == 0; return Ok; } GpStatus WINGDIPAPI GdipIsVisiblePoint (GpGraphics *graphics, REAL x, REAL y, BOOL *result) { GpRectF rectF; if (!graphics || !result) return InvalidParameter; gdip_RectF_from_Rect (&graphics->bounds, &rectF); *result = gdip_is_Point_in_RectF_inclusive (x, y, &rectF); return Ok; } GpStatus WINGDIPAPI GdipIsVisiblePointI (GpGraphics *graphics, INT x, INT y, BOOL *result) { return GdipIsVisiblePoint (graphics, x, y, result); } GpStatus WINGDIPAPI GdipIsVisibleRect (GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, BOOL *result) { BOOL found = FALSE; float posy, posx; GpRectF recthit, boundsF; if (!graphics || !result) return InvalidParameter; if (width == 0 || height == 0) { *result = FALSE; return Ok; } gdip_RectF_from_Rect (&graphics->bounds, &boundsF); recthit.X = x; recthit.Y = y; recthit.Width = width; recthit.Height = height; /* Any point of intersection ?*/ for (posy = 0; posy < recthit.Height+1; posy++) { for (posx = 0; posx < recthit.Width +1; posx++) { if (gdip_is_Point_in_RectF_inclusive (recthit.X + posx , recthit.Y + posy, &boundsF) == TRUE) { found = TRUE; break; } } } *result = found; return Ok; } GpStatus WINGDIPAPI GdipIsVisibleRectI (GpGraphics *graphics, INT x, INT y, INT width, INT height, BOOL *result) { return GdipIsVisibleRect (graphics, x, y, width, height, result); } GpStatus WINGDIPAPI GdipSetCompositingMode (GpGraphics *graphics, CompositingMode compositingMode) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; graphics->composite_mode = compositingMode; switch (graphics->backend) { case GraphicsBackEndCairo: return cairo_SetCompositingMode (graphics, compositingMode); case GraphicsBackEndMetafile: return metafile_SetCompositingMode (graphics, compositingMode); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetCompositingMode (GpGraphics *graphics, CompositingMode *compositingMode) { if (!graphics || !compositingMode) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *compositingMode = graphics->composite_mode; return Ok; } GpStatus WINGDIPAPI GdipSetCompositingQuality (GpGraphics *graphics, CompositingQuality compositingQuality) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; graphics->composite_quality = compositingQuality; switch (graphics->backend) { case GraphicsBackEndCairo: /* In Cairo there is no way of setting this, always use high quality */ return Ok; case GraphicsBackEndMetafile: return metafile_SetCompositingQuality (graphics, compositingQuality); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetCompositingQuality (GpGraphics *graphics, CompositingQuality *compositingQuality) { if (!graphics || !compositingQuality) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *compositingQuality = graphics->composite_quality; return Ok; } GpStatus WINGDIPAPI GdipGetNearestColor (GpGraphics *graphics, ARGB *argb) { return Ok; } GpStatus WINGDIPAPI GdipResetPageTransform (GpGraphics *graphics) { return NotImplemented; } GpStatus WINGDIPAPI GdipSetPageScale (GpGraphics *graphics, REAL scale) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (scale <= 0.0 || scale > 1000000032) return InvalidParameter; graphics->scale = scale; switch (graphics->backend) { case GraphicsBackEndCairo: return Ok; case GraphicsBackEndMetafile: /* page unit and scale are in the same EMF+ record */ return metafile_SetPageTransform (graphics, graphics->page_unit, scale); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetPageScale (GpGraphics *graphics, REAL *scale) { if (!graphics | !scale) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *scale = graphics->scale; return Ok; } GpStatus WINGDIPAPI GdipSetPageUnit (GpGraphics *graphics, GpUnit unit) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (unit <= UnitWorld || unit > UnitCairoPoint) return InvalidParameter; graphics->page_unit = unit; switch (graphics->backend) { case GraphicsBackEndCairo: return Ok; case GraphicsBackEndMetafile: /* page unit and scale are in the same EMF+ record */ return metafile_SetPageTransform (graphics, unit, graphics->scale); default: return GenericError; } } GpStatus WINGDIPAPI GdipGetPageUnit (GpGraphics *graphics, GpUnit *unit) { if (!graphics || !unit) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; *unit = graphics->page_unit; return Ok; } GpStatus WINGDIPAPI GdipTransformPoints (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPointF *points, INT count) { static int called = 0; if (!called) { printf("NOT IMPLEMENTED YET:GdipTransformPoints (GpGraphics *graphics, GpCoordinateSpace destSpace %d, GpCoordinateSpace srcSpace %d, GpPointF *points, int count %d)\n", destSpace, srcSpace, count); } /* return NotImplemented; */ return Ok; } GpStatus WINGDIPAPI GdipTransformPointsI (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPoint *points, INT count) { static int called = 0; if (!called) { printf("NOT IMPLEMENTED YET:GdipTransformPointsI (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPoint *points, int count)\n"); } /* return NotImplemented; */ return Ok; } GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST PointF *destPoint, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoint, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST RectF *destRect, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileDestRectI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Rect *destRect, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes ) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoints (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST PointF *destPoints, INT count, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointsI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoints, INT count, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes ) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoint (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST PointF *destPoint, GDIPCONST RectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes * imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoint, GDIPCONST Rect *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRect (GpGraphics * graphics, GDIPCONST GpMetafile *metafile, GDIPCONST RectF *destRect, GDIPCONST RectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRectI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Rect *destRect, GDIPCONST Rect *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints (GpGraphics *graphics, GDIPCONST GpMetafile * metafile, GDIPCONST PointF *destPoints, INT count, GDIPCONST RectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointsI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoints, INT count, GDIPCONST Rect *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes) { return NotImplemented; } HPALETTE WINGDIPAPI GdipCreateHalftonePalette() { return NULL; } libgdiplus-6.0.4+dfsg/src/brush-private.h0000644000175000017500000000436213542674535021074 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __BRUSH_PRIVATE_H__ #define __BRUSH_PRIVATE_H__ #include "gdiplus-private.h" typedef struct { float *factors; float *positions; int count; } Blend; typedef struct _BrushClass { /* Brush virtual functions */ GpBrushType type; GpStatus (*setup) (GpGraphics *graphics, GpBrush *brush); GpStatus (*clone_brush) (GpBrush *brush, GpBrush **clonedBrush); GpStatus (*destroy) (GpBrush *brush); } BrushClass; typedef struct _Brush { BrushClass *vtable; BOOL changed; } Brush; void gdip_brush_init (GpBrush *brush, BrushClass* vtable) GDIP_INTERNAL; GpStatus gdip_brush_setup (GpGraphics *graphics, GpBrush *brush) GDIP_INTERNAL; #include "brush.h" #endif libgdiplus-6.0.4+dfsg/src/GdiPlusFlat.h0000644000175000017500000000642513542674535020461 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ /* * This is *the* public header to be used by C/C++ consumers of GDI+ * and has the same name as MS provided header for the "flat API" */ #ifndef _FLATAPI_H #define _FLATAPI_H #ifdef __cplusplus extern "C" { #endif /* * WINGDIPAPI is used to define the visibility of the GDI+ functions. If you're including GdiPlusFlat.h * file, you're using the public header, consuming GDI+, so the GDI+ functions are not exported in your library. */ #define WINGDIPAPI /* * If you ever need a workaround specific to libgdiplus then use the following define */ #define MONO_LIBGDIPLUS 1 /* * public view of internal stuff (curious about them, check in *-private.h files ;-) */ typedef void GpAdjustableArrowCap; typedef void GpBitmap; typedef void GpBrush; typedef void GpCustomLineCap; typedef void GpFont; typedef void GpFontCollection; typedef void GpFontFamily; typedef void GpGraphics; typedef void GpHatch; typedef void GpImage; typedef void GpImageAttributes; typedef void GpLineGradient; typedef void GpMatrix; typedef void GpMetafile; typedef void GpPath; typedef void GpPathIterator; typedef void GpPathGradient; typedef void GpPen; typedef void GpRegion; typedef void GpSolidFill; typedef void GpState; typedef void GpStringFormat; typedef void GpTexture; /* * Do not include those headers directly. * Their content is public but, unlike this file, the header filenames do NOT match MS filenames! */ #include "gdipluspixelformats.h" #include "gdiplusimaging.h" #include "gdipenums.h" #include "gdipstructs.h" #include "general.h" #include "adjustablearrowcap.h" #include "bitmap.h" #include "brush.h" #include "customlinecap.h" #include "font.h" #include "fontcollection.h" #include "fontfamily.h" #include "graphics.h" #include "graphics-path.h" #include "graphics-pathiterator.h" #include "hatchbrush.h" #include "image.h" #include "imageattributes.h" #include "lineargradientbrush.h" #include "matrix.h" #include "metafile.h" #include "pathgradientbrush.h" #include "pen.h" #include "region.h" #include "solidbrush.h" #include "stringformat.h" #include "text.h" #include "texturebrush.h" #ifdef __cplusplus } #endif #endif libgdiplus-6.0.4+dfsg/src/image.h0000644000175000017500000001437613542674535017371 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __IMAGE_H__ #define __IMAGE_H__ #include "codecs.h" /* * libgdiplus-specific types that needs to be exported to replace the COM-based IStream stuff GDI+ provides */ typedef int (*GetHeaderDelegate) (BYTE*, int); typedef int (*GetBytesDelegate) (BYTE*, int, BOOL); typedef long (*SeekDelegate) (int, int); typedef int (*PutBytesDelegate) (BYTE*, int); typedef void (*CloseDelegate) (); typedef long (*SizeDelegate) (); GpStatus WINGDIPAPI GdipLoadImageFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage **image); GpStatus WINGDIPAPI GdipSaveImageToDelegate_linux (GpImage *image, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GDIPCONST CLSID *encoderCLSID, GDIPCONST EncoderParameters *params); /* GDI+ exported Image functions */ GpStatus WINGDIPAPI GdipLoadImageFromStream (void /*IStream*/ *stream, GpImage **image); GpStatus WINGDIPAPI GdipLoadImageFromFile (GDIPCONST WCHAR *file, GpImage **image); GpStatus WINGDIPAPI GdipLoadImageFromStreamICM (void /*IStream*/ *stream, GpImage **image); GpStatus WINGDIPAPI GdipLoadImageFromFileICM (GDIPCONST WCHAR* filename, GpImage **image); GpStatus WINGDIPAPI GdipSaveImageToFile (GpImage *image, GDIPCONST WCHAR *file, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams); GpStatus WINGDIPAPI GdipSaveImageToStream (GpImage *image, void /*IStream*/ *stream, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams); GpStatus WINGDIPAPI GdipSaveAdd (GpImage *image, GDIPCONST EncoderParameters* encoderParams); GpStatus WINGDIPAPI GdipSaveAddImage (GpImage *image, GpImage *newImage, GDIPCONST EncoderParameters *params); GpStatus WINGDIPAPI GdipGetImageBounds (GpImage *image, GpRectF *srcRect, GpUnit *srcUnit); GpStatus WINGDIPAPI GdipGetImageDimension (GpImage *image, REAL *width, REAL *height); GpStatus WINGDIPAPI GdipGetImageType (GpImage *image, ImageType *type); GpStatus WINGDIPAPI GdipGetImageWidth (GpImage *image, UINT *width); GpStatus WINGDIPAPI GdipGetImageHeight (GpImage *image, UINT *height); GpStatus WINGDIPAPI GdipGetImageHorizontalResolution (GpImage *image, REAL *resolution); GpStatus WINGDIPAPI GdipGetImageVerticalResolution (GpImage *image, REAL *resolution); GpStatus WINGDIPAPI GdipGetImageFlags (GpImage *image, UINT *flags); GpStatus WINGDIPAPI GdipGetImageRawFormat (GpImage *image, GUID *format); GpStatus WINGDIPAPI GdipGetImagePixelFormat (GpImage *image, PixelFormat *format); GpStatus WINGDIPAPI GdipGetImageThumbnail (GpImage *image, UINT thumbWidth, UINT thumbHeight, GpImage **thumbImage, GetThumbnailImageAbort callback, VOID* callBackData); GpStatus WINGDIPAPI GdipGetEncoderParameterListSize (GpImage *image, GDIPCONST CLSID *clsidEncoder, UINT *size); GpStatus WINGDIPAPI GdipGetEncoderParameterList (GpImage *image, GDIPCONST CLSID *clsidEncoder, UINT size, EncoderParameters *buffer); GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount (GpImage *image, UINT *count); GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList (GpImage *image, GUID *dimensionGUID, UINT count); GpStatus WINGDIPAPI GdipImageGetFrameCount (GpImage *image, GDIPCONST GUID *dimensionGUID, UINT* count); GpStatus WINGDIPAPI GdipImageSelectActiveFrame (GpImage *image, GDIPCONST GUID *dimensionGUID, UINT frameIndex); GpStatus WINGDIPAPI GdipImageRotateFlip (GpImage *image, RotateFlipType rfType); GpStatus WINGDIPAPI GdipGetImageGraphicsContext (GpImage *image, GpGraphics **graphics); GpStatus WINGDIPAPI GdipGetImagePalette (GpImage *image, ColorPalette *palette, INT size); GpStatus WINGDIPAPI GdipSetImagePalette (GpImage *image, GDIPCONST ColorPalette *palette); GpStatus WINGDIPAPI GdipGetImagePaletteSize (GpImage *image, INT* size); GpStatus WINGDIPAPI GdipGetPropertyCount (GpImage *image, UINT *numOfProperty); GpStatus WINGDIPAPI GdipGetPropertyIdList (GpImage *image, UINT numOfProperty, PROPID *list); GpStatus WINGDIPAPI GdipGetPropertyItemSize (GpImage *image, PROPID propID, UINT *size); GpStatus WINGDIPAPI GdipGetPropertyItem (GpImage *image, PROPID propID, UINT size, PropertyItem *buffer); GpStatus WINGDIPAPI GdipGetPropertySize (GpImage *image, UINT *totalBufferSize, UINT *numProperties); GpStatus WINGDIPAPI GdipRemovePropertyItem (GpImage *image, PROPID propID); GpStatus WINGDIPAPI GdipSetPropertyItem (GpImage *image, GDIPCONST PropertyItem *item); GpStatus WINGDIPAPI GdipGetAllPropertyItems (GpImage *image, UINT totalBufferSize, UINT numProperties, PropertyItem *allItems); GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage); GpStatus WINGDIPAPI GdipDisposeImage (GpImage *image); GpStatus WINGDIPAPI GdipImageForceValidation (GpImage *image); #endif libgdiplus-6.0.4+dfsg/src/gdi32.h0000644000175000017500000000252612377405421017200 0ustar directhexdirecthex// Authors: // Francis Fisher (frankie@terrorise.me.uk) // // (C) Francis Fisher 2013 // // 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. #include "graphics-private.h" #ifndef __GDI32_H__ #define __GDI32_H__ BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop); #endif libgdiplus-6.0.4+dfsg/src/alpha-premul-table.inc0000644000175000017500000242032713545154626022301 0ustar directhexdirecthex/* precomputed table for alpha*value divised by 255 */ const BYTE pre_multiplied_table[256][256] = { /* 000 */ { 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, 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 }, /* 001 */ { 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, 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, 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, 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 }, /* 002 */ { 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, 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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, /* 003 */ { 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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, /* 004 */ { 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, /* 005 */ { 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, /* 006 */ { 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, /* 007 */ { 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, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, /* 008 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }, /* 009 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }, /* 010 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, /* 011 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 }, /* 012 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12 }, /* 013 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 }, /* 014 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 }, /* 015 */ { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15 }, /* 016 */ { 0, 0, 0, 0, 0, 0, 0, 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16 }, /* 017 */ { 0, 0, 0, 0, 0, 0, 0, 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17 }, /* 018 */ { 0, 0, 0, 0, 0, 0, 0, 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18 }, /* 019 */ { 0, 0, 0, 0, 0, 0, 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19 }, /* 020 */ { 0, 0, 0, 0, 0, 0, 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20 }, /* 021 */ { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21 }, /* 022 */ { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22 }, /* 023 */ { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23 }, /* 024 */ { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24 }, /* 025 */ { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25 }, /* 026 */ { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26 }, /* 027 */ { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27 }, /* 028 */ { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28 }, /* 029 */ { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29 }, /* 030 */ { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30 }, /* 031 */ { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31 }, /* 032 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32 }, /* 033 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33 }, /* 034 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34 }, /* 035 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35 }, /* 036 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36 }, /* 037 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37 }, /* 038 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38 }, /* 039 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39 }, /* 040 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40 }, /* 041 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41 }, /* 042 */ { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42 }, /* 043 */ { 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 42, 43, 43, 43 }, /* 044 */ { 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 44, 44, 44 }, /* 045 */ { 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 45, 45, 45 }, /* 046 */ { 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 46 }, /* 047 */ { 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 47, 47, 47 }, /* 048 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48 }, /* 049 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49 }, /* 050 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50 }, /* 051 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51 }, /* 052 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52 }, /* 053 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53 }, /* 054 */ { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54 }, /* 055 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55 }, /* 056 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56 }, /* 057 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57 }, /* 058 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58 }, /* 059 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59 }, /* 060 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60 }, /* 061 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61 }, /* 062 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62 }, /* 063 */ { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63 }, /* 064 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 64, 64 }, /* 065 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 64, 65, 65 }, /* 066 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 65, 66, 66 }, /* 067 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 66, 67, 67 }, /* 068 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 68, 68 }, /* 069 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 69, 69 }, /* 070 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 69, 70, 70 }, /* 071 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 70, 71, 71 }, /* 072 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70, 71, 71, 71, 71, 72, 72 }, /* 073 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 70, 71, 71, 71, 72, 72, 72, 72, 73, 73 }, /* 074 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, 73, 73, 73, 73, 74, 74 }, /* 075 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 74, 75, 75 }, /* 076 */ { 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 75, 76, 76 }, /* 077 */ { 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 75, 76, 76, 76, 77, 77 }, /* 078 */ { 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 76, 77, 77, 77, 78, 78 }, /* 079 */ { 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 77, 78, 78, 78, 79, 79 }, /* 080 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80 }, /* 081 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81 }, /* 082 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82 }, /* 083 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83 }, /* 084 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84 }, /* 085 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85 }, /* 086 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86 }, /* 087 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87 }, /* 088 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88 }, /* 089 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89 }, /* 090 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90 }, /* 091 */ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91 }, /* 092 */ { 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92 }, /* 093 */ { 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 92, 92, 92, 93, 93 }, /* 094 */ { 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94 }, /* 095 */ { 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 92, 93, 93, 94, 94, 94, 95, 95 }, /* 096 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94, 94, 95, 95, 96, 96 }, /* 097 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 92, 93, 93, 94, 94, 94, 95, 95, 95, 96, 96, 97, 97 }, /* 098 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 83, 83, 83, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 95, 96, 96, 96, 97, 97, 98, 98 }, /* 099 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 85, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 96, 97, 97, 97, 98, 98, 99, 99 }, /* 100 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 95, 96, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100 }, /* 101 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 99, 100, 100, 101, 101 }, /* 102 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102 }, /* 103 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103 }, /* 104 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104 }, /* 105 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79, 79, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, 103, 104, 104, 105, 105 }, /* 106 */ { 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 79, 79, 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 99, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 104, 105, 105, 106, 106 }, /* 107 */ { 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 60, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, 73, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 99, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 104, 105, 105, 106, 106, 107, 107 }, /* 108 */ { 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 39, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, 83, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108 }, /* 109 */ { 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 41, 41, 41, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 85, 85, 85, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109 }, /* 110 */ { 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 41, 41, 41, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 60, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 79, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 85, 85, 85, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 104, 105, 105, 106, 106, 107, 107, 107, 108, 108, 109, 109, 110, 110 }, /* 111 */ { 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 110, 111, 111 }, /* 112 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 43, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 79, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112 }, /* 113 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113 }, /* 114 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114 }, /* 115 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115 }, /* 116 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116 }, /* 117 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117 }, /* 118 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118 }, /* 119 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119 }, /* 120 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120 }, /* 121 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121 }, /* 122 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122 }, /* 123 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123 }, /* 124 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124 }, /* 125 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125 }, /* 126 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126 }, /* 127 */ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127 }, /* 128 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128 }, /* 129 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129 }, /* 130 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130 }, /* 131 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131 }, /* 132 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132 }, /* 133 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133 }, /* 134 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134 }, /* 135 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 134, 135 }, /* 136 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136 }, /* 137 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 131, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137 }, /* 138 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138 }, /* 139 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 139 }, /* 140 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, 140 }, /* 141 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141 }, /* 142 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142 }, /* 143 */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 45, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 54, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 66, 66, 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 75, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, 100, 100, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 112, 112, 113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 135, 135, 136, 136, 137, 137, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143 }, /* 144 */ { 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 45, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 60, 61, 62, 62, 63, 63, 64, 64, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 71, 71, 72, 72, 73, 73, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 130, 131, 132, 132, 133, 133, 134, 134, 135, 136, 136, 137, 137, 138, 138, 139, 139, 140, 141, 141, 142, 142, 143, 143, 144 }, /* 145 */ { 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 47, 47, 48, 48, 49, 49, 50, 51, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, 57, 57, 58, 59, 59, 60, 60, 61, 61, 62, 63, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 69, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 92, 92, 93, 93, 94, 94, 95, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 117, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, 127, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 134, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 144, 144, 145 }, /* 146 */ { 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 54, 55, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 66, 66, 67, 68, 68, 69, 69, 70, 70, 71, 72, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 92, 92, 93, 93, 94, 94, 95, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 108, 108, 109, 109, 110, 111, 111, 112, 112, 113, 113, 114, 115, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, 127, 127, 128, 128, 129, 129, 130, 131, 131, 132, 132, 133, 133, 134, 135, 135, 136, 136, 137, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143, 143, 144, 144, 145, 145, 146 }, /* 147 */ { 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, 36, 36, 37, 37, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51, 52, 52, 53, 54, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 63, 64, 65, 65, 66, 66, 67, 67, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 97, 97, 98, 99, 99, 100, 100, 101, 101, 102, 103, 103, 104, 104, 105, 105, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 120, 121, 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, 127, 128, 129, 129, 130, 130, 131, 131, 132, 133, 133, 134, 134, 135, 135, 136, 137, 137, 138, 138, 139, 140, 140, 141, 141, 142, 142, 143, 144, 144, 145, 145, 146, 146, 147 }, /* 148 */ { 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, 57, 57, 58, 59, 59, 60, 60, 61, 62, 62, 63, 63, 64, 64, 65, 66, 66, 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, 100, 100, 101, 102, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 117, 117, 118, 118, 119, 120, 120, 121, 121, 122, 122, 123, 124, 124, 125, 125, 126, 127, 127, 128, 128, 129, 129, 130, 131, 131, 132, 132, 133, 133, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 144, 145, 145, 146, 146, 147, 147, 148 }, /* 149 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 39, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 108, 108, 109, 109, 110, 110, 111, 112, 112, 113, 113, 114, 115, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 122, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 129, 129, 130, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 137, 138, 138, 139, 140, 140, 141, 141, 142, 143, 143, 144, 144, 145, 145, 146, 147, 147, 148, 148, 149 }, /* 150 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 51, 51, 52, 52, 53, 54, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 108, 108, 109, 109, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 124, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 131, 131, 132, 132, 133, 134, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 140, 141, 141, 142, 142, 143, 144, 144, 145, 145, 146, 146, 147, 148, 148, 149, 149, 150 }, /* 151 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 54, 55, 56, 56, 57, 57, 58, 59, 59, 60, 60, 61, 62, 62, 63, 63, 64, 65, 65, 66, 66, 67, 68, 68, 69, 69, 70, 70, 71, 72, 72, 73, 73, 74, 75, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 99, 100, 101, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 117, 117, 118, 118, 119, 120, 120, 121, 121, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 128, 129, 130, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 137, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 144, 144, 145, 146, 146, 147, 147, 148, 149, 149, 150, 150, 151 }, /* 152 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 51, 51, 52, 52, 53, 54, 54, 55, 55, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 63, 64, 64, 65, 66, 66, 67, 67, 68, 69, 69, 70, 70, 71, 72, 72, 73, 73, 74, 75, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 119, 119, 120, 120, 121, 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 131, 131, 132, 132, 133, 134, 134, 135, 135, 136, 137, 137, 138, 138, 139, 139, 140, 141, 141, 142, 142, 143, 144, 144, 145, 145, 146, 147, 147, 148, 148, 149, 150, 150, 151, 151, 152 }, /* 153 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 79, 79, 80, 80, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 112, 112, 113, 113, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 124, 124, 125, 125, 126, 127, 127, 128, 128, 129, 130, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 137, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 144, 145, 145, 146, 146, 147, 148, 148, 149, 149, 150, 151, 151, 152, 152, 153 }, /* 154 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 56, 56, 57, 57, 58, 59, 59, 60, 60, 61, 62, 62, 63, 63, 64, 65, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 80, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 117, 117, 118, 118, 119, 120, 120, 121, 121, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 129, 129, 130, 130, 131, 132, 132, 133, 133, 134, 135, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 141, 142, 143, 143, 144, 144, 145, 146, 146, 147, 147, 148, 149, 149, 150, 150, 151, 152, 152, 153, 153, 154 }, /* 155 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 63, 64, 64, 65, 66, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 82, 83, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 108, 108, 109, 109, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 120, 121, 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 137, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 144, 145, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 151, 152, 153, 153, 154, 154, 155 }, /* 156 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 34, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 70, 71, 72, 72, 73, 73, 74, 75, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 81, 82, 83, 83, 84, 84, 85, 86, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 103, 104, 105, 105, 106, 106, 107, 108, 108, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 122, 123, 124, 124, 125, 125, 126, 127, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 133, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 144, 145, 146, 146, 147, 147, 148, 149, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 155, 156 }, /* 157 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 55, 56, 57, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 63, 64, 65, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 71, 72, 73, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 84, 85, 86, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 100, 101, 102, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 132, 133, 134, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 144, 145, 145, 146, 147, 147, 148, 148, 149, 150, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 156, 157 }, /* 158 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 86, 86, 87, 87, 88, 89, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 100, 101, 102, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 108, 109, 110, 110, 111, 112, 112, 113, 113, 114, 115, 115, 116, 116, 117, 118, 118, 119, 120, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 144, 145, 146, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 157, 158 }, /* 159 */ { 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 52, 53, 54, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 108, 109, 110, 110, 111, 112, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 118, 119, 120, 120, 121, 122, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 143, 144, 145, 145, 146, 147, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 158, 159 }, /* 160 */ { 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 83, 84, 85, 85, 86, 87, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 110, 111, 112, 112, 113, 114, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 120, 121, 122, 122, 123, 124, 124, 125, 125, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 142, 143, 144, 144, 145, 146, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 157, 158, 159, 159, 160 }, /* 161 */ { 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 81, 82, 83, 83, 84, 85, 85, 86, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 110, 111, 112, 112, 113, 114, 114, 115, 116, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 158, 159, 160, 160, 161 }, /* 162 */ { 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 90, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 112, 113, 114, 114, 115, 116, 116, 117, 118, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 144, 145, 145, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 159, 160, 161, 161, 162 }, /* 163 */ { 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 114, 115, 116, 116, 117, 118, 118, 119, 120, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 160, 161, 162, 162, 163 }, /* 164 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 86, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 114, 115, 116, 116, 117, 118, 118, 119, 120, 120, 121, 122, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 147, 147, 148, 149, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 159, 160, 161, 161, 162, 163, 163, 164 }, /* 165 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 83, 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 116, 117, 118, 118, 119, 120, 120, 121, 122, 122, 123, 124, 124, 125, 126, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 149, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165 }, /* 166 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 49, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 118, 119, 120, 120, 121, 122, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 159, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166 }, /* 167 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 158, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165, 166, 166, 167 }, /* 168 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 99, 100, 101, 101, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167, 167, 168 }, /* 169 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 101, 101, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 142, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165, 166, 166, 167, 168, 168, 169 }, /* 170 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 101, 101, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167, 167, 168, 169, 169, 170 }, /* 171 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 101, 101, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165, 166, 166, 167, 168, 168, 169, 170, 170, 171 }, /* 172 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 127, 127, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 159, 159, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167, 167, 168, 169, 169, 170, 171, 171, 172 }, /* 173 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 166, 167, 168, 168, 169, 170, 170, 171, 172, 172, 173 }, /* 174 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 83, 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 106, 106, 107, 108, 108, 109, 110, 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165, 166, 166, 167, 168, 169, 169, 170, 171, 171, 172, 173, 173, 174 }, /* 175 */ { 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 53, 54, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 106, 106, 107, 108, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 159, 159, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 172, 173, 174, 174, 175 }, /* 176 */ { 0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 97, 98, 99, 99, 100, 101, 101, 102, 103, 104, 104, 105, 106, 106, 107, 108, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 139, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 153, 153, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 161, 162, 162, 163, 164, 164, 165, 166, 166, 167, 168, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 175, 176 }, /* 177 */ { 0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 49, 50, 51, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 83, 84, 85, 85, 86, 87, 87, 88, 89, 90, 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 99, 99, 100, 101, 101, 102, 103, 103, 104, 105, 106, 106, 107, 108, 108, 109, 110, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 135, 136, 137, 137, 138, 139, 140, 140, 141, 142, 142, 143, 144, 144, 145, 146, 146, 147, 148, 149, 149, 150, 151, 151, 152, 153, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 167, 168, 169, 169, 170, 171, 171, 172, 173, 174, 174, 175, 176, 176, 177 }, /* 178 */ { 0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 57, 57, 58, 59, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 79, 80, 80, 81, 82, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 89, 90, 91, 91, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 103, 104, 105, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 144, 145, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 177, 178 }, /* 179 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 72, 72, 73, 74, 74, 75, 76, 77, 77, 78, 79, 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 105, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 138, 138, 139, 140, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 147, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 166, 167, 168, 168, 169, 170, 171, 171, 172, 173, 173, 174, 175, 175, 176, 177, 178, 178, 179 }, /* 180 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 49, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 70, 71, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 83, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 109, 110, 111, 112, 112, 113, 114, 114, 115, 116, 116, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 138, 139, 140, 140, 141, 142, 143, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 153, 154, 155, 155, 156, 157, 157, 158, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165, 166, 167, 167, 168, 169, 169, 170, 171, 172, 172, 173, 174, 174, 175, 176, 176, 177, 178, 179, 179, 180 }, /* 181 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 77, 78, 79, 79, 80, 81, 82, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 94, 95, 96, 97, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 111, 112, 113, 114, 114, 115, 116, 116, 117, 118, 119, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 138, 139, 140, 141, 141, 142, 143, 143, 144, 145, 146, 146, 147, 148, 148, 149, 150, 150, 151, 152, 153, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 177, 178, 179, 180, 180, 181 }, /* 182 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 51, 52, 53, 54, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 71, 72, 73, 74, 74, 75, 76, 76, 77, 78, 79, 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 103, 104, 105, 106, 106, 107, 108, 108, 109, 110, 111, 111, 112, 113, 113, 114, 115, 116, 116, 117, 118, 118, 119, 120, 121, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 138, 139, 140, 141, 141, 142, 143, 143, 144, 145, 146, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 153, 154, 155, 156, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 163, 164, 165, 166, 166, 167, 168, 168, 169, 170, 171, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180, 181, 181, 182 }, /* 183 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 57, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 80, 81, 82, 83, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90, 91, 92, 93, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 100, 101, 102, 103, 103, 104, 105, 105, 106, 107, 108, 108, 109, 110, 111, 111, 112, 113, 113, 114, 115, 116, 116, 117, 118, 118, 119, 120, 121, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 146, 147, 148, 149, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 156, 157, 158, 159, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 166, 167, 168, 169, 169, 170, 171, 172, 172, 173, 174, 174, 175, 176, 177, 177, 178, 179, 179, 180, 181, 182, 182, 183 }, /* 184 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 71, 72, 73, 74, 74, 75, 76, 76, 77, 78, 79, 79, 80, 81, 82, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 102, 103, 104, 105, 105, 106, 107, 108, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 115, 116, 117, 118, 118, 119, 120, 121, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 146, 147, 148, 149, 149, 150, 151, 152, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 159, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 178, 178, 179, 180, 180, 181, 182, 183, 183, 184 }, /* 185 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 52, 52, 53, 54, 54, 55, 56, 57, 57, 58, 59, 59, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 83, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 91, 92, 93, 94, 94, 95, 96, 96, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 118, 118, 119, 120, 120, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 147, 147, 148, 149, 149, 150, 151, 152, 152, 153, 154, 155, 155, 156, 157, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, 184, 185 }, /* 186 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 71, 72, 73, 74, 74, 75, 76, 77, 77, 78, 79, 80, 80, 81, 82, 82, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 104, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 117, 118, 119, 120, 120, 121, 122, 123, 123, 124, 125, 125, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 144, 145, 146, 147, 147, 148, 149, 150, 150, 151, 152, 152, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 166, 167, 168, 168, 169, 170, 171, 171, 172, 173, 174, 174, 175, 176, 177, 177, 178, 179, 179, 180, 181, 182, 182, 183, 184, 185, 185, 186 }, /* 187 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 100, 101, 102, 103, 103, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 111, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 120, 120, 121, 122, 122, 123, 124, 125, 125, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 144, 145, 146, 147, 147, 148, 149, 150, 150, 151, 152, 153, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 166, 167, 168, 169, 169, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182, 183, 183, 184, 185, 186, 186, 187 }, /* 188 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 41, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 60, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 72, 72, 73, 74, 74, 75, 76, 77, 77, 78, 79, 80, 80, 81, 82, 83, 83, 84, 85, 86, 86, 87, 88, 88, 89, 90, 91, 91, 92, 93, 94, 94, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 102, 103, 104, 105, 105, 106, 107, 108, 108, 109, 110, 111, 111, 112, 113, 114, 114, 115, 116, 116, 117, 118, 119, 119, 120, 121, 122, 122, 123, 124, 125, 125, 126, 127, 128, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 147, 148, 149, 150, 150, 151, 152, 153, 153, 154, 155, 156, 156, 157, 158, 159, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 175, 176, 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, 184, 185, 186, 187, 187, 188 }, /* 189 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 62, 62, 63, 64, 64, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 79, 80, 81, 82, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 90, 90, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 105, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 116, 116, 117, 118, 119, 119, 120, 121, 122, 122, 123, 124, 125, 125, 126, 127, 127, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 147, 148, 149, 150, 150, 151, 152, 153, 153, 154, 155, 156, 156, 157, 158, 159, 159, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 179, 179, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 188, 188, 189 }, /* 190 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 54, 55, 56, 57, 57, 58, 59, 60, 60, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 77, 78, 79, 80, 80, 81, 82, 83, 83, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 115, 116, 117, 118, 118, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 127, 127, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 153, 154, 155, 156, 156, 157, 158, 159, 159, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 171, 171, 172, 173, 174, 174, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182, 183, 183, 184, 185, 186, 186, 187, 188, 189, 189, 190 }, /* 191 */ { 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 79, 80, 81, 82, 82, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 91, 91, 92, 93, 94, 94, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 103, 103, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 118, 118, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 127, 127, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 166, 167, 168, 169, 169, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, 184, 185, 186, 187, 187, 188, 189, 190, 190, 191 }, /* 192 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 62, 62, 63, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 90, 90, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 105, 105, 106, 107, 108, 108, 109, 110, 111, 111, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 120, 120, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 166, 167, 168, 169, 169, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, 184, 185, 186, 187, 187, 188, 189, 190, 190, 191, 192 }, /* 193 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 54, 55, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 110, 111, 111, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 120, 120, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 129, 129, 130, 131, 132, 132, 133, 134, 135, 135, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 179, 179, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 188, 188, 189, 190, 191, 191, 192, 193 }, /* 194 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 52, 52, 53, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 68, 68, 69, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 92, 93, 94, 94, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 103, 103, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 116, 116, 117, 118, 119, 119, 120, 121, 122, 122, 123, 124, 125, 126, 126, 127, 128, 129, 129, 130, 131, 132, 132, 133, 134, 135, 135, 136, 137, 138, 138, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182, 183, 183, 184, 185, 186, 186, 187, 188, 189, 189, 190, 191, 192, 192, 193, 194 }, /* 195 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 54, 54, 55, 56, 57, 57, 58, 59, 60, 60, 61, 62, 63, 63, 64, 65, 66, 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 80, 80, 81, 82, 83, 83, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 118, 119, 119, 120, 121, 122, 122, 123, 124, 125, 125, 126, 127, 128, 128, 129, 130, 131, 132, 132, 133, 134, 135, 135, 136, 137, 138, 138, 139, 140, 141, 141, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168, 169, 170, 171, 171, 172, 173, 174, 174, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182, 183, 184, 184, 185, 186, 187, 187, 188, 189, 190, 190, 191, 192, 193, 193, 194, 195 }, /* 196 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 64, 65, 65, 66, 67, 68, 68, 69, 70, 71, 71, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 81, 82, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 91, 91, 92, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 104, 105, 105, 106, 107, 108, 108, 109, 110, 111, 111, 112, 113, 114, 115, 115, 116, 117, 118, 118, 119, 120, 121, 121, 122, 123, 124, 125, 125, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 134, 135, 135, 136, 137, 138, 138, 139, 140, 141, 141, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, 164, 165, 166, 167, 168, 168, 169, 170, 171, 171, 172, 173, 174, 174, 175, 176, 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, 184, 185, 186, 187, 188, 188, 189, 190, 191, 191, 192, 193, 194, 194, 195, 196 }, /* 197 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 59, 59, 60, 61, 62, 63, 63, 64, 65, 66, 66, 67, 68, 69, 70, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 80, 80, 81, 82, 83, 83, 84, 85, 86, 87, 87, 88, 89, 90, 90, 91, 92, 93, 93, 94, 95, 96, 97, 97, 98, 99, 100, 100, 101, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, 127, 127, 128, 129, 130, 131, 131, 132, 133, 134, 134, 135, 136, 137, 138, 138, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 178, 178, 179, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 188, 189, 189, 190, 191, 192, 192, 193, 194, 195, 195, 196, 197 }, /* 198 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 54, 54, 55, 56, 57, 57, 58, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 67, 68, 68, 69, 70, 71, 71, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 85, 85, 86, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 96, 96, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 112, 113, 113, 114, 115, 116, 116, 117, 118, 119, 120, 120, 121, 122, 123, 123, 124, 125, 126, 127, 127, 128, 129, 130, 130, 131, 132, 133, 134, 134, 135, 136, 137, 137, 138, 139, 140, 141, 141, 142, 143, 144, 144, 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 168, 168, 169, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 178, 179, 179, 180, 181, 182, 182, 183, 184, 185, 186, 186, 187, 188, 189, 189, 190, 191, 192, 193, 193, 194, 195, 196, 196, 197, 198 }, /* 199 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 59, 59, 60, 61, 62, 62, 63, 64, 65, 66, 66, 67, 68, 69, 69, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 92, 93, 94, 94, 95, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 104, 105, 105, 106, 107, 108, 108, 109, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 129, 130, 130, 131, 132, 133, 133, 134, 135, 136, 137, 137, 138, 139, 140, 140, 141, 142, 143, 144, 144, 145, 146, 147, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 168, 169, 169, 170, 171, 172, 172, 173, 174, 175, 176, 176, 177, 178, 179, 179, 180, 181, 182, 183, 183, 184, 185, 186, 187, 187, 188, 189, 190, 190, 191, 192, 193, 194, 194, 195, 196, 197, 197, 198, 199 }, /* 200 */ { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 64, 65, 66, 67, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 85, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 115, 116, 117, 118, 118, 119, 120, 121, 122, 122, 123, 124, 125, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 144, 145, 146, 147, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 165, 166, 167, 168, 169, 169, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 184, 185, 186, 187, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 195, 196, 197, 198, 198, 199, 200 }, /* 201 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 73, 74, 75, 76, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 99, 100, 101, 102, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 125, 126, 127, 128, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 140, 141, 142, 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 177, 178, 179, 180, 181, 181, 182, 183, 184, 184, 185, 186, 187, 188, 188, 189, 190, 191, 192, 192, 193, 194, 195, 195, 196, 197, 198, 199, 199, 200, 201 }, /* 202 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 71, 72, 73, 74, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 90, 91, 92, 93, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 109, 110, 111, 112, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 128, 129, 130, 131, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 177, 177, 178, 179, 180, 181, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 189, 190, 191, 192, 192, 193, 194, 195, 196, 196, 197, 198, 199, 200, 200, 201, 202 }, /* 203 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 92, 93, 94, 95, 96, 96, 97, 98, 99, 100, 100, 101, 102, 103, 103, 104, 105, 106, 107, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, 203 }, /* 204 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 98, 99, 100, 101, 102, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 202, 203, 204 }, /* 205 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 92, 93, 94, 95, 96, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 182, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 203, 204, 205 }, /* 206 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 74, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 90, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 99, 100, 101, 102, 103, 103, 104, 105, 106, 107, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 137, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 145, 146, 147, 148, 149, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 200, 200, 201, 202, 203, 204, 204, 205, 206 }, /* 207 */ { 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 93, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 183, 184, 185, 186, 187, 188, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 196, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 205, 206, 207 }, /* 208 */ { 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 188, 189, 190, 191, 192, 193, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 206, 207, 208 }, /* 209 */ { 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 93, 94, 95, 96, 97, 98, 98, 99, 100, 101, 102, 102, 103, 104, 105, 106, 107, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 202, 203, 204, 205, 206, 207, 207, 208, 209 }, /* 210 */ { 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 142, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206, 207, 208, 208, 209, 210 }, /* 211 */ { 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 74, 75, 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 98, 99, 100, 101, 102, 103, 103, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 137, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, 208, 209, 209, 210, 211 }, /* 212 */ { 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 62, 62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 160, 160, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 200, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 210, 211, 212 }, /* 213 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 74, 75, 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 99, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 109, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 145, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 160, 160, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 200, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 210, 211, 212, 213 }, /* 214 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 102, 103, 104, 105, 106, 107, 107, 108, 109, 110, 111, 112, 112, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 128, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 149, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 196, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 211, 211, 212, 213, 214 }, /* 215 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 73, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 83, 83, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 99, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 137, 137, 138, 139, 140, 141, 142, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 168, 169, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 196, 197, 198, 199, 200, 201, 202, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 212, 213, 214, 215 }, /* 216 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 102, 103, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 130, 130, 131, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 163, 164, 165, 166, 167, 168, 169, 169, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 202, 202, 203, 204, 205, 206, 207, 208, 208, 209, 210, 211, 212, 213, 213, 214, 215, 216 }, /* 217 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 83, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 128, 128, 129, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 162, 163, 163, 164, 165, 166, 167, 168, 168, 169, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206, 207, 208, 208, 209, 210, 211, 212, 213, 214, 214, 215, 216, 217 }, /* 218 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 74, 75, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 85, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 103, 104, 105, 106, 107, 108, 109, 109, 110, 111, 112, 113, 114, 115, 115, 116, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 167, 168, 168, 169, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 214, 215, 215, 216, 217, 218 }, /* 219 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 136, 137, 137, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 149, 149, 150, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 167, 167, 168, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, 208, 209, 210, 210, 211, 212, 213, 214, 215, 216, 216, 217, 218, 219 }, /* 220 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 85, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 159, 160, 160, 161, 162, 163, 164, 165, 166, 167, 167, 168, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, 208, 209, 210, 211, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220 }, /* 221 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 81, 82, 83, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 171, 172, 172, 173, 174, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 211, 211, 212, 213, 214, 215, 216, 217, 218, 218, 219, 220, 221 }, /* 222 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 98, 98, 99, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 117, 118, 118, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 145, 145, 146, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 171, 172, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 211, 212, 212, 213, 214, 215, 216, 217, 218, 219, 219, 220, 221, 222 }, /* 223 */ { 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 59, 59, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 73, 74, 75, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 85, 86, 87, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 114, 115, 115, 116, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 211, 212, 213, 213, 214, 215, 216, 217, 218, 219, 220, 220, 221, 222, 223 }, /* 224 */ { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 83, 84, 85, 86, 87, 88, 89, 90, 90, 91, 92, 93, 94, 95, 96, 97, 98, 98, 99, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 110, 111, 112, 112, 113, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 139, 140, 141, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 160, 161, 162, 163, 163, 164, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 176, 177, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 211, 212, 213, 213, 214, 215, 216, 217, 218, 219, 220, 220, 221, 222, 223, 224 }, /* 225 */ { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 108, 109, 109, 110, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 167, 168, 169, 169, 170, 171, 172, 173, 174, 175, 176, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 211, 212, 213, 214, 214, 215, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 225 }, /* 226 */ { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75, 76, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 87, 88, 89, 90, 90, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 183, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 214, 215, 216, 217, 218, 219, 220, 221, 222, 222, 223, 224, 225, 226 }, /* 227 */ { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 85, 85, 86, 87, 88, 89, 90, 91, 92, 93, 93, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 108, 109, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 118, 119, 120, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 139, 140, 141, 142, 142, 143, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 180, 181, 182, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 215, 216, 217, 218, 219, 220, 221, 222, 223, 223, 224, 225, 226, 227 }, /* 228 */ { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 131, 132, 133, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 224, 225, 226, 227, 228 }, /* 229 */ { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 90, 91, 92, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 181, 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 225, 226, 227, 228, 229 }, /* 230 */ { 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 225, 226, 227, 228, 229, 230 }, /* 231 */ { 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 226, 227, 228, 229, 230, 231 }, /* 232 */ { 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 227, 228, 229, 230, 231, 232 }, /* 233 */ { 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 228, 229, 230, 231, 232, 233 }, /* 234 */ { 0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 228, 229, 230, 231, 232, 233, 234 }, /* 235 */ { 0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 229, 230, 231, 232, 233, 234, 235 }, /* 236 */ { 0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 230, 231, 232, 233, 234, 235, 236 }, /* 237 */ { 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 230, 231, 232, 233, 234, 235, 236, 237 }, /* 238 */ { 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 231, 232, 233, 234, 235, 236, 237, 238 }, /* 239 */ { 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 237, 238, 239 }, /* 240 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 237, 238, 239, 240 }, /* 241 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241 }, /* 242 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 }, /* 243 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243 }, /* 244 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244 }, /* 245 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245 }, /* 246 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246 }, /* 247 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247 }, /* 248 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248 }, /* 249 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249 }, /* 250 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250 }, /* 251 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251 }, /* 252 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252 }, /* 253 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253 }, /* 254 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254 }, /* 255 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 } }; /* precomputed table for value*255 divised by alpha */ const BYTE pre_multiplied_table_reverse[256][256] = { /* 000 */ { 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, 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 }, /* 001 */ { 1, 255, 127, 85, 63, 51, 42, 36, 31, 28, 25, 23, 21, 19, 18, 17, 15, 15, 14, 13, 12, 12, 11, 11, 10, 10, 9, 9, 9, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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, 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 }, /* 002 */ { 2, 255, 255, 170, 127, 102, 85, 72, 63, 56, 51, 46, 42, 39, 36, 34, 31, 30, 28, 26, 25, 24, 23, 22, 21, 20, 19, 18, 18, 17, 17, 16, 15, 15, 15, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, /* 003 */ { 3, 255, 255, 255, 191, 153, 127, 109, 95, 84, 76, 69, 63, 58, 54, 51, 47, 45, 42, 40, 38, 36, 34, 33, 31, 30, 29, 28, 27, 26, 25, 24, 23, 23, 22, 21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, /* 004 */ { 4, 255, 255, 255, 255, 204, 170, 145, 127, 113, 102, 92, 85, 78, 72, 68, 63, 60, 56, 53, 51, 48, 46, 44, 42, 40, 39, 37, 36, 35, 34, 32, 31, 30, 30, 29, 28, 27, 26, 26, 25, 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, 20, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16, 16, 15, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, /* 005 */ { 5, 255, 255, 255, 255, 255, 212, 182, 159, 141, 127, 115, 106, 98, 91, 85, 79, 75, 70, 67, 63, 60, 57, 55, 53, 50, 49, 47, 45, 43, 42, 41, 39, 38, 37, 36, 35, 34, 33, 32, 31, 31, 30, 29, 28, 28, 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, /* 006 */ { 6, 255, 255, 255, 255, 255, 255, 218, 191, 169, 153, 139, 127, 117, 109, 102, 95, 90, 84, 80, 76, 72, 69, 66, 63, 61, 58, 56, 54, 52, 51, 49, 47, 46, 45, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 33, 32, 31, 31, 30, 30, 29, 28, 28, 27, 27, 26, 26, 25, 25, 25, 24, 24, 23, 23, 23, 22, 22, 22, 21, 21, 21, 20, 20, 20, 20, 19, 19, 19, 19, 18, 18, 18, 18, 18, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, /* 007 */ { 7, 255, 255, 255, 255, 255, 255, 254, 223, 198, 178, 162, 148, 137, 127, 119, 111, 105, 99, 93, 89, 84, 81, 77, 74, 71, 68, 66, 63, 61, 59, 57, 55, 54, 52, 50, 49, 48, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 37, 36, 35, 35, 34, 33, 33, 32, 31, 31, 30, 30, 29, 29, 28, 28, 27, 27, 27, 26, 26, 25, 25, 25, 24, 24, 24, 23, 23, 23, 22, 22, 22, 22, 21, 21, 21, 21, 20, 20, 20, 20, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, /* 008 */ { 8, 255, 255, 255, 255, 255, 255, 255, 255, 226, 204, 185, 170, 156, 145, 136, 127, 120, 113, 107, 102, 97, 92, 88, 85, 81, 78, 75, 72, 70, 68, 65, 63, 61, 60, 58, 56, 55, 53, 52, 51, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 40, 39, 38, 37, 37, 36, 35, 35, 34, 34, 33, 32, 32, 31, 31, 30, 30, 30, 29, 29, 28, 28, 27, 27, 27, 26, 26, 26, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 22, 22, 22, 22, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }, /* 009 */ { 9, 255, 255, 255, 255, 255, 255, 255, 255, 254, 229, 208, 191, 176, 163, 153, 143, 135, 127, 120, 114, 109, 104, 99, 95, 91, 88, 84, 81, 79, 76, 74, 71, 69, 67, 65, 63, 62, 60, 58, 57, 55, 54, 53, 52, 50, 49, 48, 47, 46, 45, 45, 44, 43, 42, 41, 40, 40, 39, 38, 38, 37, 37, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 31, 30, 30, 29, 29, 29, 28, 28, 27, 27, 27, 27, 26, 26, 26, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 23, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }, /* 010 */ { 10, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 231, 212, 196, 182, 170, 159, 150, 141, 134, 127, 121, 115, 110, 106, 101, 98, 94, 91, 87, 85, 82, 79, 77, 75, 72, 70, 68, 67, 65, 63, 62, 60, 59, 57, 56, 55, 54, 53, 52, 50, 50, 49, 48, 47, 46, 45, 44, 43, 43, 42, 41, 41, 40, 39, 39, 38, 38, 37, 36, 36, 35, 35, 34, 34, 33, 33, 33, 32, 32, 31, 31, 31, 30, 30, 30, 29, 29, 28, 28, 28, 28, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 23, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, /* 011 */ { 11, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 233, 215, 200, 187, 175, 165, 155, 147, 140, 133, 127, 121, 116, 112, 107, 103, 100, 96, 93, 90, 87, 84, 82, 80, 77, 75, 73, 71, 70, 68, 66, 65, 63, 62, 60, 59, 58, 57, 56, 55, 53, 52, 51, 50, 50, 49, 48, 47, 46, 45, 45, 44, 43, 43, 42, 41, 41, 40, 40, 39, 38, 38, 37, 37, 36, 36, 35, 35, 35, 34, 34, 33, 33, 33, 32, 32, 31, 31, 31, 30, 30, 30, 29, 29, 29, 28, 28, 28, 28, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 }, /* 012 */ { 12, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 235, 218, 204, 191, 180, 169, 161, 153, 145, 139, 133, 127, 122, 117, 113, 109, 105, 102, 98, 95, 92, 90, 87, 84, 82, 80, 78, 76, 74, 72, 71, 69, 67, 66, 65, 63, 62, 61, 60, 58, 57, 56, 55, 54, 53, 52, 51, 51, 50, 49, 48, 47, 47, 46, 45, 45, 44, 43, 43, 42, 41, 41, 40, 40, 39, 39, 38, 38, 37, 37, 36, 36, 36, 35, 35, 34, 34, 33, 33, 33, 32, 32, 32, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 28, 28, 28, 28, 27, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12 }, /* 013 */ { 13, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 236, 221, 207, 195, 184, 174, 165, 157, 150, 144, 138, 132, 127, 122, 118, 114, 110, 106, 103, 100, 97, 94, 92, 89, 87, 84, 82, 80, 78, 77, 75, 73, 72, 70, 69, 67, 66, 65, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 50, 49, 48, 48, 47, 46, 46, 45, 44, 44, 43, 43, 42, 41, 41, 40, 40, 39, 39, 39, 38, 38, 37, 37, 36, 36, 36, 35, 35, 34, 34, 34, 33, 33, 33, 32, 32, 32, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 27, 27, 27, 27, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 }, /* 014 */ { 14, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 238, 223, 210, 198, 187, 178, 169, 162, 155, 148, 142, 137, 132, 127, 123, 119, 115, 111, 108, 105, 101, 99, 96, 93, 91, 89, 87, 84, 83, 81, 79, 77, 75, 74, 72, 71, 70, 68, 67, 66, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 54, 53, 52, 51, 50, 50, 49, 48, 48, 47, 46, 46, 45, 45, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 38, 38, 37, 37, 37, 36, 36, 36, 35, 35, 35, 34, 34, 33, 33, 33, 33, 32, 32, 32, 31, 31, 31, 31, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 }, /* 015 */ { 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 239, 225, 212, 201, 191, 182, 173, 166, 159, 152, 147, 141, 136, 131, 127, 123, 119, 115, 112, 109, 106, 103, 100, 98, 95, 93, 91, 88, 86, 84, 83, 81, 79, 78, 76, 75, 73, 72, 70, 69, 68, 67, 65, 64, 63, 62, 61, 60, 59, 58, 57, 57, 56, 55, 54, 53, 53, 52, 51, 50, 50, 49, 49, 48, 47, 47, 46, 46, 45, 45, 44, 43, 43, 42, 42, 42, 41, 41, 40, 40, 39, 39, 39, 38, 38, 37, 37, 37, 36, 36, 36, 35, 35, 35, 34, 34, 34, 33, 33, 33, 32, 32, 32, 32, 31, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 }, /* 016 */ { 16, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 240, 226, 214, 204, 194, 185, 177, 170, 163, 156, 151, 145, 140, 136, 131, 127, 123, 120, 116, 113, 110, 107, 104, 102, 99, 97, 94, 92, 90, 88, 86, 85, 83, 81, 80, 78, 76, 75, 74, 72, 71, 70, 69, 68, 66, 65, 64, 63, 62, 61, 60, 60, 59, 58, 57, 56, 55, 55, 54, 53, 52, 52, 51, 51, 50, 49, 49, 48, 48, 47, 46, 46, 45, 45, 44, 44, 43, 43, 42, 42, 42, 41, 41, 40, 40, 40, 39, 39, 38, 38, 38, 37, 37, 37, 36, 36, 36, 35, 35, 35, 34, 34, 34, 34, 33, 33, 33, 32, 32, 32, 32, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }, /* 017 */ { 17, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 240, 228, 216, 206, 197, 188, 180, 173, 166, 160, 154, 149, 144, 139, 135, 131, 127, 123, 120, 117, 114, 111, 108, 105, 103, 100, 98, 96, 94, 92, 90, 88, 86, 85, 83, 81, 80, 78, 77, 76, 74, 73, 72, 71, 69, 68, 67, 66, 65, 64, 63, 62, 61, 61, 60, 59, 58, 57, 57, 56, 55, 54, 54, 53, 52, 52, 51, 51, 50, 49, 49, 48, 48, 47, 47, 46, 46, 45, 45, 44, 44, 43, 43, 42, 42, 42, 41, 41, 40, 40, 40, 39, 39, 39, 38, 38, 38, 37, 37, 37, 36, 36, 36, 35, 35, 35, 34, 34, 34, 34, 33, 33, 33, 33, 32, 32, 32, 32, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 }, /* 018 */ { 18, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 241, 229, 218, 208, 199, 191, 183, 176, 169, 163, 158, 153, 148, 143, 139, 135, 131, 127, 124, 120, 117, 114, 111, 109, 106, 104, 101, 99, 97, 95, 93, 91, 90, 88, 86, 84, 83, 81, 80, 79, 77, 76, 75, 74, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 62, 61, 60, 59, 58, 58, 57, 56, 55, 55, 54, 54, 53, 52, 52, 51, 50, 50, 49, 49, 48, 48, 47, 47, 46, 46, 45, 45, 45, 44, 44, 43, 43, 42, 42, 42, 41, 41, 40, 40, 40, 39, 39, 39, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 35, 35, 35, 35, 34, 34, 34, 33, 33, 33, 33, 33, 32, 32, 32, 32, 31, 31, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 }, /* 019 */ { 19, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 242, 230, 220, 210, 201, 193, 186, 179, 173, 167, 161, 156, 151, 146, 142, 138, 134, 130, 127, 124, 121, 118, 115, 112, 110, 107, 105, 103, 100, 98, 96, 95, 93, 91, 89, 88, 86, 84, 83, 82, 80, 79, 78, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 62, 61, 60, 59, 59, 58, 57, 57, 56, 55, 55, 54, 53, 53, 52, 52, 51, 50, 50, 49, 49, 48, 48, 47, 47, 47, 46, 46, 45, 45, 44, 44, 44, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 40, 39, 39, 39, 38, 38, 38, 37, 37, 37, 36, 36, 36, 36, 35, 35, 35, 35, 34, 34, 34, 34, 33, 33, 33, 33, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 }, /* 020 */ { 20, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 242, 231, 221, 212, 203, 196, 188, 182, 175, 170, 164, 159, 154, 150, 145, 141, 137, 134, 130, 127, 124, 121, 118, 115, 113, 110, 108, 106, 104, 101, 100, 98, 96, 94, 92, 91, 89, 87, 86, 85, 83, 82, 80, 79, 78, 77, 76, 75, 73, 72, 71, 70, 69, 68, 67, 67, 66, 65, 64, 63, 62, 62, 61, 60, 60, 59, 58, 57, 57, 56, 56, 55, 54, 54, 53, 53, 52, 52, 51, 50, 50, 50, 49, 49, 48, 48, 47, 47, 46, 46, 45, 45, 45, 44, 44, 43, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 40, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 36, 36, 36, 36, 35, 35, 35, 35, 34, 34, 34, 34, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 }, /* 021 */ { 21, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 243, 232, 223, 214, 205, 198, 191, 184, 178, 172, 167, 162, 157, 152, 148, 144, 140, 137, 133, 130, 127, 124, 121, 118, 116, 113, 111, 109, 107, 105, 102, 101, 99, 97, 95, 93, 92, 90, 89, 87, 86, 84, 83, 82, 81, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 59, 58, 58, 57, 56, 56, 55, 55, 54, 54, 53, 53, 52, 51, 51, 50, 50, 50, 49, 49, 48, 48, 47, 47, 46, 46, 46, 45, 45, 44, 44, 44, 43, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 40, 39, 39, 39, 39, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 36, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21 }, /* 022 */ { 22, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 243, 233, 224, 215, 207, 200, 193, 187, 180, 175, 169, 165, 160, 155, 151, 147, 143, 140, 136, 133, 130, 127, 124, 121, 119, 116, 114, 112, 110, 107, 105, 103, 101, 100, 98, 96, 95, 93, 91, 90, 89, 87, 86, 84, 83, 82, 81, 80, 79, 77, 76, 75, 74, 73, 72, 71, 71, 70, 69, 68, 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 59, 59, 58, 57, 57, 56, 56, 55, 55, 54, 53, 53, 52, 52, 51, 51, 50, 50, 50, 49, 49, 48, 48, 47, 47, 47, 46, 46, 45, 45, 45, 44, 44, 44, 43, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 40, 40, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 36, 35, 35, 35, 35, 35, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 }, /* 023 */ { 23, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 244, 234, 225, 217, 209, 202, 195, 189, 183, 177, 172, 167, 162, 158, 154, 150, 146, 143, 139, 136, 133, 130, 127, 124, 122, 119, 117, 115, 112, 110, 108, 106, 104, 102, 101, 99, 97, 96, 94, 93, 91, 90, 88, 87, 86, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 69, 68, 67, 66, 65, 65, 64, 63, 63, 62, 61, 61, 60, 59, 59, 58, 58, 57, 56, 56, 55, 55, 54, 54, 53, 53, 52, 52, 51, 51, 50, 50, 50, 49, 49, 48, 48, 48, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 44, 43, 43, 43, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 39, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 36, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23 }, /* 024 */ { 24, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 244, 235, 226, 218, 211, 204, 197, 191, 185, 180, 174, 169, 165, 161, 156, 153, 149, 145, 142, 139, 135, 133, 130, 127, 124, 122, 120, 117, 115, 113, 111, 109, 107, 105, 103, 102, 100, 98, 97, 95, 94, 92, 91, 90, 88, 87, 86, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 72, 71, 70, 69, 68, 67, 67, 66, 65, 65, 64, 63, 63, 62, 61, 61, 60, 60, 59, 58, 58, 57, 57, 56, 56, 55, 55, 54, 54, 53, 53, 52, 52, 51, 51, 51, 50, 50, 49, 49, 48, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 44, 43, 43, 43, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 39, 39, 39, 39, 38, 38, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 36, 36, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, /* 025 */ { 25, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 245, 236, 227, 219, 212, 205, 199, 193, 187, 182, 177, 172, 167, 163, 159, 155, 151, 148, 144, 141, 138, 135, 132, 130, 127, 125, 122, 120, 118, 115, 113, 111, 109, 108, 106, 104, 102, 101, 99, 98, 96, 95, 93, 92, 91, 89, 88, 87, 86, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 75, 74, 73, 72, 71, 70, 70, 69, 68, 67, 67, 66, 65, 65, 64, 63, 63, 62, 61, 61, 60, 60, 59, 59, 58, 57, 57, 56, 56, 55, 55, 54, 54, 54, 53, 53, 52, 52, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 39, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25 }, /* 026 */ { 26, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 245, 236, 228, 221, 213, 207, 200, 195, 189, 184, 179, 174, 169, 165, 161, 157, 154, 150, 147, 144, 141, 138, 135, 132, 130, 127, 125, 122, 120, 118, 116, 114, 112, 110, 108, 106, 105, 103, 101, 100, 98, 97, 96, 94, 93, 92, 90, 89, 88, 87, 86, 84, 83, 82, 81, 80, 79, 78, 78, 77, 76, 75, 74, 73, 72, 72, 71, 70, 69, 69, 68, 67, 66, 66, 65, 65, 64, 63, 63, 62, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 56, 56, 55, 55, 54, 54, 53, 53, 53, 52, 52, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26 }, /* 027 */ { 27, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 245, 237, 229, 222, 215, 208, 202, 196, 191, 186, 181, 176, 172, 167, 163, 160, 156, 152, 149, 146, 143, 140, 137, 135, 132, 129, 127, 125, 122, 120, 118, 116, 114, 112, 111, 109, 107, 105, 104, 102, 101, 99, 98, 96, 95, 94, 93, 91, 90, 89, 88, 87, 86, 84, 83, 82, 81, 81, 80, 79, 78, 77, 76, 75, 74, 74, 73, 72, 71, 70, 70, 69, 68, 68, 67, 66, 66, 65, 64, 64, 63, 63, 62, 62, 61, 60, 60, 59, 59, 58, 58, 57, 57, 56, 56, 55, 55, 55, 54, 54, 53, 53, 52, 52, 52, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27 }, /* 028 */ { 28, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 246, 238, 230, 223, 216, 210, 203, 198, 192, 187, 183, 178, 174, 169, 166, 162, 158, 155, 151, 148, 145, 142, 140, 137, 134, 132, 129, 127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 108, 106, 105, 103, 101, 100, 99, 97, 96, 95, 93, 92, 91, 90, 89, 88, 87, 86, 84, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 75, 74, 73, 72, 72, 71, 70, 70, 69, 68, 67, 67, 66, 66, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 59, 59, 59, 58, 58, 57, 57, 56, 56, 55, 55, 54, 54, 54, 53, 53, 52, 52, 52, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 48, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, /* 029 */ { 29, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 246, 238, 231, 224, 217, 211, 205, 199, 194, 189, 184, 180, 176, 171, 168, 164, 160, 157, 154, 150, 147, 145, 142, 139, 136, 134, 132, 129, 127, 125, 123, 121, 119, 117, 115, 113, 112, 110, 108, 107, 105, 104, 102, 101, 99, 98, 97, 96, 94, 93, 92, 91, 90, 89, 88, 87, 85, 84, 84, 83, 82, 81, 80, 79, 78, 77, 77, 76, 75, 74, 73, 73, 72, 71, 71, 70, 69, 69, 68, 67, 67, 66, 66, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 56, 56, 56, 55, 55, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, 29 }, /* 030 */ { 30, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 246, 239, 231, 225, 218, 212, 206, 201, 196, 191, 186, 182, 177, 173, 169, 166, 162, 159, 156, 152, 150, 147, 144, 141, 139, 136, 134, 131, 129, 127, 125, 123, 121, 119, 117, 115, 114, 112, 110, 109, 107, 106, 104, 103, 101, 100, 99, 98, 96, 95, 94, 93, 92, 91, 90, 88, 87, 86, 85, 84, 84, 83, 82, 81, 80, 79, 78, 78, 77, 76, 75, 75, 74, 73, 72, 72, 71, 70, 70, 69, 68, 68, 67, 67, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 57, 56, 56, 55, 55, 55, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30 }, /* 031 */ { 31, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 247, 239, 232, 225, 219, 213, 208, 202, 197, 192, 188, 183, 179, 175, 171, 168, 164, 161, 158, 155, 152, 149, 146, 143, 141, 138, 136, 133, 131, 129, 127, 125, 123, 121, 119, 117, 116, 114, 112, 111, 109, 108, 106, 105, 104, 102, 101, 100, 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, 87, 86, 85, 84, 84, 83, 82, 81, 80, 79, 79, 78, 77, 76, 76, 75, 74, 73, 73, 72, 71, 71, 70, 69, 69, 68, 68, 67, 66, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 58, 57, 57, 56, 56, 56, 55, 55, 54, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 50, 50, 50, 50, 49, 49, 49, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 31, 31 }, /* 032 */ { 32, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 247, 240, 233, 226, 220, 214, 209, 204, 199, 194, 189, 185, 181, 177, 173, 170, 166, 163, 160, 156, 153, 151, 148, 145, 143, 140, 138, 136, 133, 131, 129, 127, 125, 123, 121, 120, 118, 116, 114, 113, 111, 110, 108, 107, 105, 104, 103, 102, 100, 99, 98, 97, 96, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 85, 84, 83, 82, 81, 80, 80, 79, 78, 77, 76, 76, 75, 74, 74, 73, 72, 72, 71, 70, 70, 69, 69, 68, 68, 67, 66, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, 60, 59, 59, 58, 58, 57, 57, 57, 56, 56, 55, 55, 55, 54, 54, 54, 53, 53, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32 }, /* 033 */ { 33, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 247, 240, 233, 227, 221, 215, 210, 205, 200, 195, 191, 186, 182, 179, 175, 171, 168, 165, 161, 158, 155, 152, 150, 147, 145, 142, 140, 137, 135, 133, 131, 129, 127, 125, 123, 121, 120, 118, 116, 115, 113, 112, 110, 109, 107, 106, 105, 103, 102, 101, 100, 99, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 84, 83, 82, 81, 80, 80, 79, 78, 77, 77, 76, 75, 75, 74, 73, 73, 72, 71, 71, 70, 70, 69, 68, 68, 67, 67, 66, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, 60, 59, 59, 58, 58, 58, 57, 57, 56, 56, 56, 55, 55, 54, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 33 }, /* 034 */ { 34, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 247, 240, 234, 228, 222, 216, 211, 206, 201, 197, 192, 188, 184, 180, 176, 173, 170, 166, 163, 160, 157, 154, 152, 149, 146, 144, 142, 139, 137, 135, 133, 131, 129, 127, 125, 123, 122, 120, 118, 117, 115, 114, 112, 111, 109, 108, 107, 105, 104, 103, 102, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 85, 84, 83, 82, 81, 81, 80, 79, 78, 78, 77, 76, 76, 75, 74, 74, 73, 72, 72, 71, 71, 70, 69, 69, 68, 68, 67, 67, 66, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 61, 60, 60, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 55, 55, 55, 54, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34 }, /* 035 */ { 35, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 247, 241, 234, 228, 223, 217, 212, 207, 202, 198, 194, 189, 185, 182, 178, 175, 171, 168, 165, 162, 159, 156, 153, 151, 148, 146, 143, 141, 139, 137, 135, 133, 131, 129, 127, 125, 123, 122, 120, 118, 117, 115, 114, 112, 111, 110, 108, 107, 106, 105, 103, 102, 101, 100, 99, 98, 97, 95, 94, 93, 92, 92, 91, 90, 89, 88, 87, 86, 85, 84, 84, 83, 82, 81, 81, 80, 79, 78, 78, 77, 76, 76, 75, 74, 74, 73, 73, 72, 71, 71, 70, 70, 69, 69, 68, 68, 67, 67, 66, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 61, 60, 60, 59, 59, 59, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 54, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 35, 35 }, /* 036 */ { 36, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 248, 241, 235, 229, 223, 218, 213, 208, 203, 199, 195, 191, 187, 183, 180, 176, 173, 169, 166, 163, 161, 158, 155, 153, 150, 148, 145, 143, 141, 139, 137, 135, 133, 131, 129, 127, 125, 124, 122, 120, 119, 117, 116, 114, 113, 111, 110, 109, 108, 106, 105, 104, 103, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 90, 89, 88, 87, 86, 85, 84, 84, 83, 82, 81, 81, 80, 79, 79, 78, 77, 77, 76, 75, 75, 74, 74, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 67, 67, 67, 66, 66, 65, 65, 64, 64, 63, 63, 62, 62, 62, 61, 61, 60, 60, 59, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 45, 45, 44, 44, 44, 44, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 36 }, /* 037 */ { 37, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 248, 241, 235, 230, 224, 219, 214, 209, 205, 200, 196, 192, 188, 185, 181, 178, 174, 171, 168, 165, 162, 159, 157, 154, 152, 149, 147, 145, 142, 140, 138, 136, 134, 132, 131, 129, 127, 125, 124, 122, 120, 119, 117, 116, 115, 113, 112, 111, 109, 108, 107, 106, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 89, 88, 87, 86, 85, 84, 84, 83, 82, 82, 81, 80, 79, 79, 78, 77, 77, 76, 76, 75, 74, 74, 73, 73, 72, 72, 71, 70, 70, 69, 69, 68, 68, 67, 67, 66, 66, 65, 65, 65, 64, 64, 63, 63, 62, 62, 62, 61, 61, 60, 60, 60, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 37 }, /* 038 */ { 38, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 248, 242, 236, 230, 225, 220, 215, 210, 206, 201, 197, 193, 190, 186, 182, 179, 176, 173, 169, 167, 164, 161, 158, 156, 153, 151, 149, 146, 144, 142, 140, 138, 136, 134, 132, 130, 129, 127, 125, 124, 122, 121, 119, 118, 116, 115, 114, 112, 111, 110, 108, 107, 106, 105, 104, 103, 101, 100, 99, 98, 97, 96, 95, 95, 94, 93, 92, 91, 90, 89, 88, 88, 87, 86, 85, 84, 84, 83, 82, 82, 81, 80, 80, 79, 78, 78, 77, 76, 76, 75, 75, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 68, 67, 67, 66, 66, 65, 65, 65, 64, 64, 63, 63, 62, 62, 62, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 54, 54, 54, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38 }, /* 039 */ { 39, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 248, 242, 236, 231, 226, 220, 216, 211, 207, 202, 198, 195, 191, 187, 184, 180, 177, 174, 171, 168, 165, 163, 160, 157, 155, 152, 150, 148, 146, 144, 142, 140, 138, 136, 134, 132, 130, 129, 127, 125, 124, 122, 121, 119, 118, 117, 115, 114, 113, 111, 110, 109, 108, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 92, 91, 90, 89, 88, 88, 87, 86, 85, 84, 84, 83, 82, 82, 81, 80, 80, 79, 78, 78, 77, 77, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 68, 67, 67, 66, 66, 65, 65, 64, 64, 64, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 59, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 39, 39 }, /* 040 */ { 40, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 248, 242, 237, 231, 226, 221, 217, 212, 208, 203, 200, 196, 192, 188, 185, 182, 178, 175, 172, 170, 167, 164, 161, 159, 156, 154, 152, 150, 147, 145, 143, 141, 139, 137, 135, 134, 132, 130, 129, 127, 125, 124, 122, 121, 120, 118, 117, 115, 114, 113, 112, 110, 109, 108, 107, 106, 105, 104, 103, 101, 100, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 91, 90, 89, 88, 87, 87, 86, 85, 85, 84, 83, 82, 82, 81, 80, 80, 79, 79, 78, 77, 77, 76, 76, 75, 75, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 68, 67, 67, 67, 66, 66, 65, 65, 64, 64, 64, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40 }, /* 041 */ { 41, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 248, 243, 237, 232, 227, 222, 217, 213, 209, 205, 201, 197, 193, 190, 186, 183, 180, 177, 174, 171, 168, 165, 163, 160, 158, 156, 153, 151, 149, 147, 145, 143, 141, 139, 137, 135, 134, 132, 130, 129, 127, 125, 124, 123, 121, 120, 118, 117, 116, 114, 113, 112, 111, 110, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 95, 94, 93, 92, 91, 90, 90, 89, 88, 87, 87, 86, 85, 84, 84, 83, 82, 82, 81, 81, 80, 79, 79, 78, 78, 77, 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 68, 67, 67, 67, 66, 66, 65, 65, 64, 64, 64, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 41, 41, 41, 41, 41, 41, 41 }, /* 042 */ { 42, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 243, 237, 232, 227, 223, 218, 214, 210, 205, 202, 198, 194, 191, 187, 184, 181, 178, 175, 172, 169, 167, 164, 162, 159, 157, 155, 152, 150, 148, 146, 144, 142, 140, 139, 137, 135, 133, 132, 130, 129, 127, 126, 124, 123, 121, 120, 118, 117, 116, 115, 113, 112, 111, 110, 109, 108, 107, 106, 105, 103, 102, 101, 101, 100, 99, 98, 97, 96, 95, 94, 93, 93, 92, 91, 90, 89, 89, 88, 87, 87, 86, 85, 84, 84, 83, 83, 82, 81, 81, 80, 79, 79, 78, 78, 77, 77, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 69, 68, 68, 67, 67, 66, 66, 66, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 42 }, /* 043 */ { 43, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 243, 238, 233, 228, 223, 219, 215, 210, 206, 203, 199, 195, 192, 189, 185, 182, 179, 176, 174, 171, 168, 166, 163, 161, 158, 156, 154, 152, 150, 148, 146, 144, 142, 140, 138, 137, 135, 133, 132, 130, 129, 127, 126, 124, 123, 121, 120, 119, 117, 116, 115, 114, 113, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 97, 96, 95, 94, 93, 92, 92, 91, 90, 89, 89, 88, 87, 87, 86, 85, 84, 84, 83, 83, 82, 81, 81, 80, 80, 79, 78, 78, 77, 77, 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 68, 68, 67, 67, 66, 66, 66, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 43 }, /* 044 */ { 44, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 243, 238, 233, 228, 224, 220, 215, 211, 207, 203, 200, 196, 193, 190, 187, 183, 180, 178, 175, 172, 169, 167, 165, 162, 160, 158, 155, 153, 151, 149, 147, 145, 143, 142, 140, 138, 136, 135, 133, 132, 130, 128, 127, 126, 124, 123, 121, 120, 119, 118, 116, 115, 114, 113, 112, 111, 110, 108, 107, 106, 105, 104, 103, 102, 101, 101, 100, 99, 98, 97, 96, 95, 95, 94, 93, 92, 91, 91, 90, 89, 89, 88, 87, 86, 86, 85, 84, 84, 83, 83, 82, 81, 81, 80, 80, 79, 79, 78, 77, 77, 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 71, 70, 70, 69, 69, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 44 }, /* 045 */ { 45, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 244, 239, 234, 229, 225, 220, 216, 212, 208, 204, 201, 197, 194, 191, 188, 185, 182, 179, 176, 173, 171, 168, 166, 163, 161, 159, 157, 155, 152, 150, 149, 147, 145, 143, 141, 139, 138, 136, 135, 133, 131, 130, 128, 127, 126, 124, 123, 122, 120, 119, 118, 117, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 98, 97, 96, 95, 94, 94, 93, 92, 91, 91, 90, 89, 88, 88, 87, 86, 86, 85, 84, 84, 83, 83, 82, 81, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 75, 75, 74, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 69, 68, 68, 67, 67, 67, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 45, 45, 45, 45, 45, 45 }, /* 046 */ { 46, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 244, 239, 234, 230, 225, 221, 217, 213, 209, 205, 202, 198, 195, 192, 189, 186, 183, 180, 177, 175, 172, 169, 167, 165, 162, 160, 158, 156, 154, 152, 150, 148, 146, 144, 143, 141, 139, 138, 136, 134, 133, 131, 130, 128, 127, 126, 124, 123, 122, 120, 119, 118, 117, 116, 115, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 101, 100, 99, 98, 97, 96, 96, 95, 94, 93, 93, 92, 91, 90, 90, 89, 88, 88, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 71, 70, 70, 69, 69, 69, 68, 68, 67, 67, 67, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 46 }, /* 047 */ { 47, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 244, 239, 235, 230, 226, 221, 217, 214, 210, 206, 203, 199, 196, 193, 190, 187, 184, 181, 178, 176, 173, 171, 168, 166, 164, 161, 159, 157, 155, 153, 151, 149, 147, 146, 144, 142, 141, 139, 137, 136, 134, 133, 131, 130, 128, 127, 126, 124, 123, 122, 121, 119, 118, 117, 116, 115, 114, 113, 112, 110, 109, 108, 107, 107, 106, 105, 104, 103, 102, 101, 100, 99, 99, 98, 97, 96, 95, 95, 94, 93, 92, 92, 91, 90, 90, 89, 88, 88, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 76, 75, 75, 74, 74, 73, 73, 73, 72, 72, 71, 71, 70, 70, 70, 69, 69, 68, 68, 68, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 47, 47 }, /* 048 */ { 48, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 249, 244, 240, 235, 230, 226, 222, 218, 214, 211, 207, 204, 200, 197, 194, 191, 188, 185, 182, 180, 177, 174, 172, 169, 167, 165, 163, 161, 158, 156, 154, 153, 151, 149, 147, 145, 144, 142, 140, 139, 137, 135, 134, 133, 131, 130, 128, 127, 126, 124, 123, 122, 121, 120, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 102, 101, 100, 99, 98, 97, 97, 96, 95, 94, 94, 93, 92, 92, 91, 90, 90, 89, 88, 88, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 79, 79, 78, 78, 77, 77, 76, 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 72, 71, 71, 70, 70, 69, 69, 69, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 52, 51, 51, 51, 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 48 }, /* 049 */ { 49, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 249, 245, 240, 235, 231, 227, 223, 219, 215, 211, 208, 204, 201, 198, 195, 192, 189, 186, 183, 181, 178, 175, 173, 171, 168, 166, 164, 162, 160, 158, 156, 154, 152, 150, 148, 147, 145, 143, 141, 140, 138, 137, 135, 134, 132, 131, 130, 128, 127, 126, 124, 123, 122, 121, 120, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 104, 103, 102, 101, 100, 99, 99, 98, 97, 96, 96, 95, 94, 93, 93, 92, 91, 91, 90, 89, 89, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 76, 75, 75, 74, 74, 73, 73, 73, 72, 72, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49, 49, 49 }, /* 050 */ { 50, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 245, 240, 236, 231, 227, 223, 219, 216, 212, 209, 205, 202, 199, 196, 193, 190, 187, 184, 182, 179, 177, 174, 172, 169, 167, 165, 163, 161, 159, 157, 155, 153, 151, 150, 148, 146, 144, 143, 141, 140, 138, 137, 135, 134, 132, 131, 130, 128, 127, 126, 125, 123, 122, 121, 120, 119, 118, 116, 115, 114, 113, 112, 111, 110, 109, 108, 108, 107, 106, 105, 104, 103, 102, 101, 101, 100, 99, 98, 98, 97, 96, 95, 95, 94, 93, 93, 92, 91, 91, 90, 89, 89, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 76, 75, 75, 75, 74, 74, 73, 73, 72, 72, 72, 71, 71, 70, 70, 70, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 52, 51, 51, 51, 51, 50, 50, 50, 50, 50, 50 }, /* 051 */ { 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 250, 245, 240, 236, 232, 228, 224, 220, 216, 213, 209, 206, 203, 200, 197, 194, 191, 188, 185, 183, 180, 178, 175, 173, 171, 168, 166, 164, 162, 160, 158, 156, 154, 153, 151, 149, 147, 146, 144, 142, 141, 139, 138, 136, 135, 134, 132, 131, 130, 128, 127, 126, 125, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 104, 103, 102, 101, 100, 100, 99, 98, 97, 97, 96, 95, 94, 94, 93, 92, 92, 91, 90, 90, 89, 89, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 76, 76, 75, 75, 74, 74, 73, 73, 73, 72, 72, 71, 71, 71, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 53, 52, 52, 52, 52, 52, 51, 51, 51, 51, 51 }, /* 052 */ { 52, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 245, 241, 236, 232, 228, 224, 221, 217, 213, 210, 207, 203, 200, 197, 195, 192, 189, 186, 184, 181, 179, 176, 174, 172, 169, 167, 165, 163, 161, 159, 157, 156, 154, 152, 150, 148, 147, 145, 144, 142, 141, 139, 138, 136, 135, 133, 132, 131, 130, 128, 127, 126, 125, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 106, 105, 104, 103, 102, 101, 101, 100, 99, 98, 98, 97, 96, 96, 95, 94, 94, 93, 92, 92, 91, 90, 90, 89, 88, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 78, 77, 77, 76, 76, 75, 75, 74, 74, 74, 73, 73, 72, 72, 72, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 53, 52, 52, 52, 52, 52 }, /* 053 */ { 53, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 245, 241, 237, 233, 229, 225, 221, 217, 214, 211, 207, 204, 201, 198, 195, 193, 190, 187, 185, 182, 180, 177, 175, 173, 171, 168, 166, 164, 162, 160, 159, 157, 155, 153, 151, 150, 148, 146, 145, 143, 142, 140, 139, 137, 136, 135, 133, 132, 131, 129, 128, 127, 126, 125, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 108, 107, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99, 98, 97, 97, 96, 95, 95, 94, 93, 93, 92, 91, 91, 90, 90, 89, 88, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 79, 78, 78, 77, 77, 76, 76, 75, 75, 75, 74, 74, 73, 73, 73, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 54, 53, 53, 53, 53, 53 }, /* 054 */ { 54, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 245, 241, 237, 233, 229, 225, 222, 218, 215, 211, 208, 205, 202, 199, 196, 193, 191, 188, 186, 183, 181, 178, 176, 174, 172, 169, 167, 165, 163, 162, 160, 158, 156, 154, 152, 151, 149, 148, 146, 144, 143, 141, 140, 139, 137, 136, 135, 133, 132, 131, 129, 128, 127, 126, 125, 124, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 111, 110, 109, 108, 107, 106, 105, 105, 104, 103, 102, 101, 101, 100, 99, 99, 98, 97, 96, 96, 95, 94, 94, 93, 93, 92, 91, 91, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 81, 81, 81, 80, 80, 79, 79, 78, 78, 77, 77, 76, 76, 76, 75, 75, 74, 74, 74, 73, 73, 72, 72, 72, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 55, 54, 54, 54, 54, 54 }, /* 055 */ { 55, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 246, 241, 237, 233, 229, 226, 222, 219, 215, 212, 209, 206, 203, 200, 197, 194, 192, 189, 186, 184, 182, 179, 177, 175, 173, 171, 168, 166, 165, 163, 161, 159, 157, 155, 154, 152, 150, 149, 147, 146, 144, 143, 141, 140, 138, 137, 136, 134, 133, 132, 131, 129, 128, 127, 126, 125, 124, 123, 121, 120, 119, 118, 117, 116, 115, 114, 114, 113, 112, 111, 110, 109, 108, 107, 107, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99, 98, 98, 97, 96, 96, 95, 94, 94, 93, 92, 92, 91, 91, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 77, 77, 77, 76, 76, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 57, 56, 56, 56, 56, 55, 55, 55, 55, 55 }, /* 056 */ { 56, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 246, 242, 238, 234, 230, 226, 223, 219, 216, 213, 210, 206, 203, 201, 198, 195, 192, 190, 187, 185, 183, 180, 178, 176, 174, 172, 169, 168, 166, 164, 162, 160, 158, 156, 155, 153, 151, 150, 148, 147, 145, 144, 142, 141, 140, 138, 137, 135, 134, 133, 132, 131, 129, 128, 127, 126, 125, 124, 123, 122, 121, 119, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 109, 108, 107, 106, 105, 105, 104, 103, 102, 101, 101, 100, 99, 99, 98, 97, 97, 96, 95, 95, 94, 93, 93, 92, 92, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 78, 77, 77, 76, 76, 75, 75, 75, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 59, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 56 }, /* 057 */ { 57, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 246, 242, 238, 234, 230, 227, 223, 220, 216, 213, 210, 207, 204, 201, 199, 196, 193, 191, 188, 186, 183, 181, 179, 177, 175, 173, 171, 169, 167, 165, 163, 161, 159, 157, 156, 154, 152, 151, 149, 148, 146, 145, 143, 142, 141, 139, 138, 137, 135, 134, 133, 132, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 110, 109, 108, 107, 106, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99, 98, 98, 97, 96, 96, 95, 94, 94, 93, 93, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 78, 78, 78, 77, 77, 76, 76, 76, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 57, 57, 57, 57, 57 }, /* 058 */ { 58, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 246, 242, 238, 234, 231, 227, 224, 220, 217, 214, 211, 208, 205, 202, 199, 197, 194, 192, 189, 187, 184, 182, 180, 178, 176, 174, 171, 169, 168, 166, 164, 162, 160, 159, 157, 155, 154, 152, 150, 149, 147, 146, 145, 143, 142, 140, 139, 138, 136, 135, 134, 133, 132, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 112, 111, 110, 109, 108, 107, 107, 106, 105, 104, 104, 103, 102, 101, 101, 100, 99, 99, 98, 97, 97, 96, 96, 95, 94, 94, 93, 93, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 79, 79, 78, 78, 77, 77, 77, 76, 76, 75, 75, 75, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 59, 58, 58, 58, 58, 58 }, /* 059 */ { 59, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 246, 242, 238, 235, 231, 227, 224, 221, 218, 214, 211, 208, 206, 203, 200, 197, 195, 192, 190, 188, 185, 183, 181, 179, 177, 174, 172, 170, 169, 167, 165, 163, 161, 160, 158, 156, 155, 153, 151, 150, 148, 147, 146, 144, 143, 141, 140, 139, 138, 136, 135, 134, 133, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 113, 112, 111, 110, 109, 109, 108, 107, 106, 105, 105, 104, 103, 103, 102, 101, 100, 100, 99, 98, 98, 97, 97, 96, 95, 95, 94, 94, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 80, 79, 79, 78, 78, 77, 77, 77, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 60, 59, 59, 59, 59, 59 }, /* 060 */ { 60, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 250, 246, 242, 239, 235, 231, 228, 225, 221, 218, 215, 212, 209, 206, 203, 201, 198, 196, 193, 191, 188, 186, 184, 182, 180, 177, 175, 173, 171, 169, 168, 166, 164, 162, 161, 159, 157, 156, 154, 152, 151, 150, 148, 147, 145, 144, 142, 141, 140, 139, 137, 136, 135, 134, 133, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 115, 114, 113, 112, 111, 110, 110, 109, 108, 107, 106, 106, 105, 104, 104, 103, 102, 101, 101, 100, 99, 99, 98, 98, 97, 96, 96, 95, 95, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 80, 79, 79, 78, 78, 78, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 60, 60 }, /* 061 */ { 61, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 246, 243, 239, 235, 232, 228, 225, 222, 219, 216, 213, 210, 207, 204, 202, 199, 196, 194, 192, 189, 187, 185, 183, 180, 178, 176, 174, 172, 170, 169, 167, 165, 163, 162, 160, 158, 157, 155, 154, 152, 151, 149, 148, 146, 145, 144, 142, 141, 140, 138, 137, 136, 135, 134, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 116, 115, 114, 113, 112, 111, 111, 110, 109, 108, 108, 107, 106, 105, 105, 104, 103, 103, 102, 101, 101, 100, 99, 99, 98, 97, 97, 96, 96, 95, 94, 94, 93, 93, 92, 92, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 81, 80, 80, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 61, 61, 61, 61, 61 }, /* 062 */ { 62, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 250, 247, 243, 239, 235, 232, 229, 225, 222, 219, 216, 213, 210, 208, 205, 202, 200, 197, 195, 192, 190, 188, 186, 183, 181, 179, 177, 175, 173, 171, 169, 168, 166, 164, 162, 161, 159, 158, 156, 155, 153, 152, 150, 149, 147, 146, 145, 143, 142, 141, 139, 138, 137, 136, 135, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 117, 116, 115, 114, 113, 112, 112, 111, 110, 109, 109, 108, 107, 106, 106, 105, 104, 104, 103, 102, 101, 101, 100, 100, 99, 98, 98, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 81, 80, 80, 79, 79, 79, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 69, 68, 68, 68, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 62, 62 }, /* 063 */ { 63, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 247, 243, 239, 236, 232, 229, 226, 223, 220, 217, 214, 211, 208, 205, 203, 200, 198, 195, 193, 191, 189, 186, 184, 182, 180, 178, 176, 174, 172, 170, 169, 167, 165, 163, 162, 160, 159, 157, 155, 154, 152, 151, 150, 148, 147, 146, 144, 143, 142, 140, 139, 138, 137, 136, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 118, 117, 116, 115, 114, 113, 113, 112, 111, 110, 110, 109, 108, 107, 107, 106, 105, 104, 104, 103, 102, 102, 101, 101, 100, 99, 99, 98, 97, 97, 96, 96, 95, 95, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 81, 81, 81, 80, 80, 79, 79, 79, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 68, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64, 63, 63, 63, 63 }, /* 064 */ { 64, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 251, 247, 243, 240, 236, 233, 229, 226, 223, 220, 217, 214, 211, 209, 206, 204, 201, 199, 196, 194, 192, 189, 187, 185, 183, 181, 179, 177, 175, 173, 171, 170, 168, 166, 164, 163, 161, 160, 158, 156, 155, 153, 152, 151, 149, 148, 147, 145, 144, 143, 141, 140, 139, 138, 137, 136, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 120, 119, 118, 117, 116, 115, 114, 114, 113, 112, 111, 111, 110, 109, 108, 108, 107, 106, 105, 105, 104, 103, 103, 102, 102, 101, 100, 100, 99, 98, 98, 97, 97, 96, 96, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 85, 85, 84, 84, 83, 83, 82, 82, 82, 81, 81, 80, 80, 80, 79, 79, 78, 78, 78, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 70, 69, 69, 69, 68, 68, 68, 68, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64 }, /* 065 */ { 65, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 247, 243, 240, 236, 233, 230, 227, 223, 220, 218, 215, 212, 209, 207, 204, 202, 199, 197, 195, 192, 190, 188, 186, 184, 182, 180, 178, 176, 174, 172, 170, 169, 167, 165, 164, 162, 160, 159, 157, 156, 154, 153, 152, 150, 149, 147, 146, 145, 144, 142, 141, 140, 139, 138, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 120, 119, 118, 117, 116, 115, 115, 114, 113, 112, 111, 111, 110, 109, 109, 108, 107, 106, 106, 105, 104, 104, 103, 102, 102, 101, 101, 100, 99, 99, 98, 98, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 82, 81, 81, 80, 80, 80, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 69, 69, 69, 69, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 65 }, /* 066 */ { 66, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 247, 243, 240, 237, 233, 230, 227, 224, 221, 218, 215, 213, 210, 207, 205, 202, 200, 198, 195, 193, 191, 189, 186, 184, 182, 180, 179, 177, 175, 173, 171, 169, 168, 166, 165, 163, 161, 160, 158, 157, 155, 154, 152, 151, 150, 148, 147, 146, 145, 143, 142, 141, 140, 139, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 121, 120, 119, 118, 117, 116, 116, 115, 114, 113, 112, 112, 111, 110, 109, 109, 108, 107, 107, 106, 105, 105, 104, 103, 103, 102, 101, 101, 100, 100, 99, 99, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 92, 92, 91, 91, 90, 90, 89, 89, 89, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 82, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 71, 70, 70, 70, 69, 69, 69, 68, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 66 }, /* 067 */ { 67, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 247, 244, 240, 237, 234, 230, 227, 224, 221, 219, 216, 213, 210, 208, 205, 203, 201, 198, 196, 194, 191, 189, 187, 185, 183, 181, 179, 177, 176, 174, 172, 170, 169, 167, 165, 164, 162, 161, 159, 158, 156, 155, 153, 152, 151, 149, 148, 147, 146, 144, 143, 142, 141, 140, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 122, 121, 120, 119, 118, 117, 117, 116, 115, 114, 113, 113, 112, 111, 110, 110, 109, 108, 108, 107, 106, 106, 105, 104, 104, 103, 102, 102, 101, 101, 100, 99, 99, 98, 98, 97, 97, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 82, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 70, 69, 69, 69, 68, 68, 68, 68, 67, 67, 67, 67 }, /* 068 */ { 68, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 251, 247, 244, 240, 237, 234, 231, 228, 225, 222, 219, 216, 214, 211, 208, 206, 204, 201, 199, 197, 194, 192, 190, 188, 186, 184, 182, 180, 178, 176, 175, 173, 171, 170, 168, 166, 165, 163, 162, 160, 159, 157, 156, 154, 153, 152, 150, 149, 148, 146, 145, 144, 143, 142, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 122, 121, 120, 119, 118, 117, 117, 116, 115, 114, 114, 113, 112, 111, 111, 110, 109, 109, 108, 107, 107, 106, 105, 105, 104, 103, 103, 102, 102, 101, 100, 100, 99, 99, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 88, 87, 87, 86, 86, 85, 85, 85, 84, 84, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 71, 70, 70, 70, 69, 69, 69, 69, 68, 68, 68, 68 }, /* 069 */ { 69, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 247, 244, 241, 237, 234, 231, 228, 225, 222, 219, 217, 214, 211, 209, 207, 204, 202, 199, 197, 195, 193, 191, 189, 187, 185, 183, 181, 179, 177, 175, 174, 172, 170, 169, 167, 165, 164, 162, 161, 159, 158, 157, 155, 154, 152, 151, 150, 149, 147, 146, 145, 144, 143, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 123, 122, 121, 120, 119, 118, 118, 117, 116, 115, 114, 114, 113, 112, 112, 111, 110, 109, 109, 108, 107, 107, 106, 105, 105, 104, 104, 103, 102, 102, 101, 101, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 70, 69, 69, 69, 69 }, /* 070 */ { 70, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 247, 244, 241, 237, 234, 231, 228, 225, 223, 220, 217, 215, 212, 210, 207, 205, 202, 200, 198, 196, 194, 191, 189, 187, 185, 184, 182, 180, 178, 176, 175, 173, 171, 169, 168, 166, 165, 163, 162, 160, 159, 157, 156, 155, 153, 152, 151, 149, 148, 147, 146, 145, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 123, 122, 121, 120, 119, 118, 118, 117, 116, 115, 115, 114, 113, 112, 112, 111, 110, 110, 109, 108, 108, 107, 106, 106, 105, 105, 104, 103, 103, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 95, 95, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 74, 73, 73, 73, 72, 72, 72, 71, 71, 71, 71, 70, 70, 70, 70 }, /* 071 */ { 71, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 244, 241, 238, 235, 232, 229, 226, 223, 220, 218, 215, 213, 210, 208, 205, 203, 201, 198, 196, 194, 192, 190, 188, 186, 184, 182, 181, 179, 177, 175, 174, 172, 170, 169, 167, 166, 164, 163, 161, 160, 158, 157, 156, 154, 153, 152, 150, 149, 148, 147, 146, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 124, 123, 122, 121, 120, 119, 119, 118, 117, 116, 116, 115, 114, 113, 113, 112, 111, 111, 110, 109, 109, 108, 107, 107, 106, 105, 105, 104, 104, 103, 102, 102, 101, 101, 100, 100, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 90, 89, 89, 88, 88, 87, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 71 }, /* 072 */ { 72, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 244, 241, 238, 235, 232, 229, 226, 223, 221, 218, 216, 213, 211, 208, 206, 203, 201, 199, 197, 195, 193, 191, 189, 187, 185, 183, 181, 180, 178, 176, 174, 173, 171, 169, 168, 166, 165, 163, 162, 161, 159, 158, 156, 155, 154, 153, 151, 150, 149, 148, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 135, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 124, 123, 122, 121, 120, 119, 119, 118, 117, 116, 116, 115, 114, 114, 113, 112, 111, 111, 110, 109, 109, 108, 108, 107, 106, 106, 105, 104, 104, 103, 103, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 90, 89, 89, 88, 88, 87, 87, 87, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 74, 73, 73, 73, 72, 72, 72, 72 }, /* 073 */ { 73, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 244, 241, 238, 235, 232, 229, 227, 224, 221, 219, 216, 213, 211, 209, 206, 204, 202, 200, 198, 195, 193, 191, 189, 188, 186, 184, 182, 180, 178, 177, 175, 173, 172, 170, 169, 167, 166, 164, 163, 161, 160, 159, 157, 156, 155, 153, 152, 151, 150, 148, 147, 146, 145, 144, 143, 142, 141, 139, 138, 137, 136, 135, 134, 133, 132, 132, 131, 130, 129, 128, 127, 126, 125, 124, 124, 123, 122, 121, 120, 120, 119, 118, 117, 117, 116, 115, 114, 114, 113, 112, 112, 111, 110, 110, 109, 108, 108, 107, 106, 106, 105, 105, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 97, 97, 96, 96, 95, 95, 94, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 89, 89, 89, 88, 88, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 75, 74, 74, 74, 73, 73, 73, 73 }, /* 074 */ { 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 241, 238, 235, 232, 230, 227, 224, 222, 219, 216, 214, 212, 209, 207, 205, 202, 200, 198, 196, 194, 192, 190, 188, 186, 185, 183, 181, 179, 178, 176, 174, 173, 171, 169, 168, 166, 165, 164, 162, 161, 159, 158, 157, 155, 154, 153, 152, 150, 149, 148, 147, 146, 145, 144, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 131, 130, 129, 128, 127, 126, 125, 124, 124, 123, 122, 121, 120, 120, 119, 118, 117, 117, 116, 115, 115, 114, 113, 112, 112, 111, 111, 110, 109, 109, 108, 107, 107, 106, 106, 105, 104, 104, 103, 103, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 89, 89, 89, 88, 88, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 74 }, /* 075 */ { 75, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 242, 239, 236, 233, 230, 227, 225, 222, 219, 217, 214, 212, 210, 207, 205, 203, 201, 199, 197, 195, 193, 191, 189, 187, 185, 183, 182, 180, 178, 177, 175, 173, 172, 170, 169, 167, 166, 164, 163, 162, 160, 159, 158, 156, 155, 154, 152, 151, 150, 149, 148, 147, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 130, 129, 128, 127, 126, 125, 124, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 115, 115, 114, 113, 113, 112, 111, 111, 110, 109, 109, 108, 108, 107, 106, 106, 105, 105, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 91, 90, 90, 89, 89, 88, 88, 88, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 75 }, /* 076 */ { 76, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 242, 239, 236, 233, 230, 228, 225, 222, 220, 217, 215, 212, 210, 208, 206, 203, 201, 199, 197, 195, 193, 191, 190, 188, 186, 184, 182, 181, 179, 177, 176, 174, 173, 171, 169, 168, 167, 165, 164, 162, 161, 160, 158, 157, 156, 155, 153, 152, 151, 150, 149, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 130, 129, 128, 127, 126, 125, 125, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 116, 115, 114, 114, 113, 112, 112, 111, 110, 110, 109, 108, 108, 107, 107, 106, 105, 105, 104, 104, 103, 103, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 90, 90, 90, 89, 89, 88, 88, 88, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 76 }, /* 077 */ { 77, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 242, 239, 236, 233, 231, 228, 225, 223, 220, 218, 215, 213, 211, 208, 206, 204, 202, 200, 198, 196, 194, 192, 190, 188, 186, 185, 183, 181, 180, 178, 176, 175, 173, 172, 170, 169, 167, 166, 164, 163, 162, 160, 159, 158, 157, 155, 154, 153, 152, 151, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 130, 129, 128, 127, 126, 125, 125, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 116, 115, 114, 114, 113, 112, 112, 111, 110, 110, 109, 109, 108, 107, 107, 106, 106, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 93, 92, 92, 91, 91, 90, 90, 90, 89, 89, 88, 88, 88, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 77, 77, 77, 77 }, /* 078 */ { 78, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 242, 239, 236, 234, 231, 228, 226, 223, 220, 218, 216, 213, 211, 209, 207, 205, 202, 200, 198, 196, 195, 193, 191, 189, 187, 185, 184, 182, 180, 179, 177, 176, 174, 172, 171, 169, 168, 167, 165, 164, 163, 161, 160, 159, 157, 156, 155, 154, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 122, 122, 121, 120, 119, 119, 118, 117, 117, 116, 115, 114, 114, 113, 113, 112, 111, 111, 110, 109, 109, 108, 108, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78, 78, 78, 78 }, /* 079 */ { 79, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 242, 239, 237, 234, 231, 228, 226, 223, 221, 218, 216, 214, 212, 209, 207, 205, 203, 201, 199, 197, 195, 193, 191, 190, 188, 186, 184, 183, 181, 179, 178, 176, 175, 173, 172, 170, 169, 167, 166, 165, 163, 162, 161, 159, 158, 157, 156, 154, 153, 152, 151, 150, 149, 148, 147, 145, 144, 143, 142, 141, 140, 139, 138, 137, 137, 136, 135, 134, 133, 132, 131, 130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 122, 122, 121, 120, 119, 119, 118, 117, 117, 116, 115, 115, 114, 113, 113, 112, 111, 111, 110, 110, 109, 108, 108, 107, 107, 106, 106, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91, 91, 90, 90, 89, 89, 89, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 79 }, /* 080 */ { 80, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 251, 248, 245, 242, 240, 237, 234, 231, 229, 226, 224, 221, 219, 217, 214, 212, 210, 208, 206, 203, 201, 200, 198, 196, 194, 192, 190, 188, 187, 185, 183, 182, 180, 178, 177, 175, 174, 172, 171, 170, 168, 167, 165, 164, 163, 161, 160, 159, 158, 156, 155, 154, 153, 152, 151, 150, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 135, 134, 133, 132, 131, 130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 122, 122, 121, 120, 120, 119, 118, 117, 117, 116, 115, 115, 114, 113, 113, 112, 112, 111, 110, 110, 109, 109, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 101, 101, 100, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 94, 93, 93, 92, 92, 91, 91, 91, 90, 90, 89, 89, 89, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 85, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 80 }, /* 081 */ { 81, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 245, 243, 240, 237, 234, 232, 229, 226, 224, 222, 219, 217, 215, 212, 210, 208, 206, 204, 202, 200, 198, 196, 194, 193, 191, 189, 187, 186, 184, 182, 181, 179, 178, 176, 175, 173, 172, 170, 169, 167, 166, 165, 163, 162, 161, 160, 158, 157, 156, 155, 154, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 134, 133, 132, 131, 130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 122, 122, 121, 120, 120, 119, 118, 118, 117, 116, 116, 115, 114, 114, 113, 112, 112, 111, 111, 110, 109, 109, 108, 108, 107, 107, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 96, 95, 95, 94, 94, 93, 93, 93, 92, 92, 91, 91, 90, 90, 90, 89, 89, 89, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 81, 81, 81, 81 }, /* 082 */ { 82, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 248, 246, 243, 240, 237, 234, 232, 229, 227, 224, 222, 220, 217, 215, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 191, 190, 188, 186, 185, 183, 181, 180, 178, 177, 175, 174, 172, 171, 169, 168, 167, 165, 164, 163, 162, 160, 159, 158, 157, 156, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 134, 133, 132, 131, 130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 123, 122, 121, 120, 120, 119, 118, 118, 117, 116, 116, 115, 114, 114, 113, 113, 112, 111, 111, 110, 110, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 101, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 90, 89, 89, 88, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 82, 82, 82, 82 }, /* 083 */ { 83, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 251, 249, 246, 243, 240, 237, 235, 232, 230, 227, 225, 222, 220, 218, 215, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 194, 192, 190, 188, 187, 185, 184, 182, 180, 179, 177, 176, 174, 173, 172, 170, 169, 167, 166, 165, 164, 162, 161, 160, 159, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 146, 145, 144, 143, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 133, 132, 131, 130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 123, 122, 121, 120, 120, 119, 118, 118, 117, 116, 116, 115, 115, 114, 113, 113, 112, 111, 111, 110, 110, 109, 109, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 97, 96, 96, 95, 95, 94, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 90, 89, 89, 88, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 83, 83, 83, 83 }, /* 084 */ { 84, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 243, 240, 237, 235, 232, 230, 227, 225, 223, 220, 218, 216, 214, 212, 210, 207, 205, 203, 202, 200, 198, 196, 194, 192, 191, 189, 187, 186, 184, 183, 181, 179, 178, 177, 175, 174, 172, 171, 169, 168, 167, 166, 164, 163, 162, 161, 159, 158, 157, 156, 155, 154, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 139, 138, 137, 136, 135, 134, 133, 133, 132, 131, 130, 129, 129, 128, 127, 126, 126, 125, 124, 123, 123, 122, 121, 121, 120, 119, 118, 118, 117, 117, 116, 115, 115, 114, 113, 113, 112, 112, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 96, 95, 95, 94, 94, 93, 93, 93, 92, 92, 91, 91, 91, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 84, 84, 84, 84 }, /* 085 */ { 85, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 249, 246, 243, 240, 238, 235, 233, 230, 228, 225, 223, 221, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 197, 195, 193, 191, 190, 188, 186, 185, 183, 182, 180, 179, 177, 176, 174, 173, 172, 170, 169, 168, 166, 165, 164, 162, 161, 160, 159, 158, 157, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 138, 137, 136, 135, 134, 133, 132, 132, 131, 130, 129, 129, 128, 127, 126, 126, 125, 124, 123, 123, 122, 121, 121, 120, 119, 119, 118, 117, 117, 116, 115, 115, 114, 114, 113, 112, 112, 111, 111, 110, 110, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 98, 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 93, 92, 92, 91, 91, 91, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 87, 86, 86, 86, 85, 85, 85 }, /* 086 */ { 86, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 243, 240, 238, 235, 233, 230, 228, 226, 223, 221, 219, 217, 215, 212, 210, 208, 206, 204, 203, 201, 199, 197, 195, 194, 192, 190, 189, 187, 185, 184, 182, 181, 179, 178, 176, 175, 174, 172, 171, 169, 168, 167, 166, 164, 163, 162, 161, 160, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 137, 136, 135, 134, 133, 132, 132, 131, 130, 129, 129, 128, 127, 126, 126, 125, 124, 123, 123, 122, 121, 121, 120, 119, 119, 118, 117, 117, 116, 116, 115, 114, 114, 113, 113, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 97, 96, 96, 95, 95, 94, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 87, 86, 86, 86 }, /* 087 */ { 87, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 243, 241, 238, 236, 233, 231, 228, 226, 224, 221, 219, 217, 215, 213, 211, 209, 207, 205, 203, 201, 199, 198, 196, 194, 192, 191, 189, 188, 186, 184, 183, 181, 180, 178, 177, 176, 174, 173, 171, 170, 169, 168, 166, 165, 164, 163, 161, 160, 159, 158, 157, 156, 155, 154, 152, 151, 150, 149, 148, 147, 146, 145, 144, 144, 143, 142, 141, 140, 139, 138, 137, 136, 136, 135, 134, 133, 132, 132, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 123, 123, 122, 121, 121, 120, 119, 119, 118, 118, 117, 116, 116, 115, 114, 114, 113, 113, 112, 112, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 99, 98, 98, 97, 97, 96, 96, 96, 95, 95, 94, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 87 }, /* 088 */ { 88, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 243, 241, 238, 236, 233, 231, 228, 226, 224, 222, 220, 217, 215, 213, 211, 209, 207, 205, 203, 202, 200, 198, 196, 195, 193, 191, 190, 188, 187, 185, 183, 182, 180, 179, 178, 176, 175, 173, 172, 171, 169, 168, 167, 166, 165, 163, 162, 161, 160, 159, 158, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 142, 141, 140, 139, 138, 137, 136, 135, 135, 134, 133, 132, 132, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 123, 123, 122, 121, 121, 120, 119, 119, 118, 118, 117, 116, 116, 115, 115, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 93, 92, 92, 91, 91, 91, 90, 90, 90, 89, 89, 89, 88, 88, 88 }, /* 089 */ { 89, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 244, 241, 238, 236, 233, 231, 229, 226, 224, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 199, 197, 195, 193, 192, 190, 189, 187, 186, 184, 183, 181, 180, 178, 177, 175, 174, 173, 171, 170, 169, 168, 166, 165, 164, 163, 162, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 140, 139, 138, 137, 136, 135, 135, 134, 133, 132, 131, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 120, 120, 119, 118, 118, 117, 116, 116, 115, 115, 114, 114, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 99, 98, 98, 97, 97, 96, 96, 96, 95, 95, 94, 94, 94, 93, 93, 93, 92, 92, 91, 91, 91, 90, 90, 90, 89, 89, 89 }, /* 090 */ { 90, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 244, 241, 239, 236, 234, 231, 229, 227, 225, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 203, 201, 199, 197, 196, 194, 192, 191, 189, 188, 186, 185, 183, 182, 180, 179, 177, 176, 175, 173, 172, 171, 169, 168, 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 152, 151, 150, 149, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 139, 138, 137, 136, 135, 135, 134, 133, 132, 131, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 120, 120, 119, 118, 118, 117, 117, 116, 115, 115, 114, 114, 113, 113, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 98, 98, 98, 97, 97, 96, 96, 96, 95, 95, 94, 94, 94, 93, 93, 92, 92, 92, 91, 91, 91, 90, 90, 90 }, /* 091 */ { 91, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 244, 241, 239, 236, 234, 232, 229, 227, 225, 223, 220, 218, 216, 214, 212, 210, 209, 207, 205, 203, 201, 200, 198, 196, 194, 193, 191, 190, 188, 187, 185, 184, 182, 181, 179, 178, 177, 175, 174, 173, 171, 170, 169, 168, 166, 165, 164, 163, 162, 161, 160, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 145, 144, 143, 142, 141, 140, 139, 138, 138, 137, 136, 135, 134, 134, 133, 132, 131, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 120, 120, 119, 118, 118, 117, 117, 116, 116, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 100, 99, 99, 98, 98, 97, 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 93, 92, 92, 92, 91, 91, 91 }, /* 092 */ { 92, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 246, 244, 241, 239, 236, 234, 232, 230, 227, 225, 223, 221, 219, 217, 215, 213, 211, 209, 207, 205, 203, 202, 200, 198, 197, 195, 193, 192, 190, 189, 187, 186, 184, 183, 181, 180, 179, 177, 176, 175, 173, 172, 171, 169, 168, 167, 166, 165, 164, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 143, 142, 141, 140, 139, 138, 138, 137, 136, 135, 134, 134, 133, 132, 131, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 120, 120, 119, 119, 118, 117, 117, 116, 116, 115, 115, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 98, 98, 98, 97, 97, 96, 96, 96, 95, 95, 94, 94, 94, 93, 93, 93, 92, 92, 92 }, /* 093 */ { 93, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 244, 241, 239, 237, 234, 232, 230, 228, 225, 223, 221, 219, 217, 215, 213, 211, 209, 208, 206, 204, 202, 200, 199, 197, 195, 194, 192, 191, 189, 188, 186, 185, 183, 182, 181, 179, 178, 176, 175, 174, 173, 171, 170, 169, 168, 167, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 154, 153, 152, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 142, 141, 140, 139, 138, 137, 137, 136, 135, 134, 133, 133, 132, 131, 131, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 120, 120, 119, 119, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 100, 99, 99, 98, 98, 97, 97, 97, 96, 96, 96, 95, 95, 94, 94, 94, 93, 93, 93 }, /* 094 */ { 94, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 244, 242, 239, 237, 235, 232, 230, 228, 226, 224, 221, 219, 217, 215, 214, 212, 210, 208, 206, 204, 203, 201, 199, 198, 196, 194, 193, 191, 190, 188, 187, 185, 184, 182, 181, 180, 178, 177, 176, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 147, 146, 145, 144, 143, 142, 141, 141, 140, 139, 138, 137, 136, 136, 135, 134, 133, 133, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 121, 120, 119, 119, 118, 118, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 110, 110, 109, 109, 108, 108, 107, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 99, 98, 98, 97, 97, 97, 96, 96, 95, 95, 95, 94, 94, 94 }, /* 095 */ { 95, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 244, 242, 239, 237, 235, 232, 230, 228, 226, 224, 222, 220, 218, 216, 214, 212, 210, 208, 207, 205, 203, 201, 200, 198, 196, 195, 193, 192, 190, 189, 187, 186, 184, 183, 182, 180, 179, 178, 176, 175, 174, 173, 171, 170, 169, 168, 167, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 145, 144, 143, 142, 141, 140, 140, 139, 138, 137, 136, 136, 135, 134, 133, 133, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 121, 120, 119, 119, 118, 118, 117, 117, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 103, 102, 102, 101, 101, 100, 100, 100, 99, 99, 98, 98, 98, 97, 97, 96, 96, 96, 95, 95, 95 }, /* 096 */ { 96, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 249, 247, 244, 242, 240, 237, 235, 233, 230, 228, 226, 224, 222, 220, 218, 216, 214, 212, 211, 209, 207, 205, 204, 202, 200, 199, 197, 195, 194, 192, 191, 189, 188, 186, 185, 184, 182, 181, 180, 178, 177, 176, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 161, 159, 158, 157, 156, 155, 154, 153, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 144, 143, 142, 141, 140, 139, 139, 138, 137, 136, 135, 135, 134, 133, 133, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 123, 122, 121, 121, 120, 120, 119, 118, 118, 117, 117, 116, 116, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 105, 104, 104, 103, 103, 102, 102, 102, 101, 101, 100, 100, 99, 99, 99, 98, 98, 97, 97, 97, 96, 96, 96 }, /* 097 */ { 97, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 244, 242, 240, 237, 235, 233, 231, 229, 226, 224, 222, 220, 218, 216, 215, 213, 211, 209, 207, 206, 204, 202, 201, 199, 197, 196, 194, 193, 191, 190, 188, 187, 185, 184, 183, 181, 180, 179, 177, 176, 175, 174, 172, 171, 170, 169, 168, 167, 166, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 149, 148, 147, 146, 145, 144, 143, 142, 142, 141, 140, 139, 138, 138, 137, 136, 135, 135, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 123, 122, 121, 121, 120, 120, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 103, 102, 102, 101, 101, 100, 100, 100, 99, 99, 98, 98, 98, 97, 97, 97 }, /* 098 */ { 98, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 245, 242, 240, 237, 235, 233, 231, 229, 227, 225, 223, 221, 219, 217, 215, 213, 211, 209, 208, 206, 204, 203, 201, 199, 198, 196, 195, 193, 192, 190, 189, 187, 186, 185, 183, 182, 181, 179, 178, 177, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 147, 146, 145, 144, 143, 142, 141, 141, 140, 139, 138, 138, 137, 136, 135, 135, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 123, 122, 121, 121, 120, 120, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 99, 99, 99, 98, 98, 98 }, /* 099 */ { 99, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 245, 242, 240, 238, 235, 233, 231, 229, 227, 225, 223, 221, 219, 217, 215, 213, 212, 210, 208, 206, 205, 203, 201, 200, 198, 197, 195, 194, 192, 191, 189, 188, 186, 185, 184, 182, 181, 180, 179, 177, 176, 175, 174, 172, 171, 170, 169, 168, 167, 166, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 152, 151, 150, 149, 148, 147, 146, 145, 145, 144, 143, 142, 141, 141, 140, 139, 138, 137, 137, 136, 135, 134, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 124, 124, 123, 123, 122, 121, 121, 120, 120, 119, 119, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 106, 105, 105, 104, 104, 103, 103, 103, 102, 102, 101, 101, 100, 100, 100, 99, 99, 99 }, /* 100 */ { 100, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 247, 245, 242, 240, 238, 236, 233, 231, 229, 227, 225, 223, 221, 219, 217, 216, 214, 212, 210, 209, 207, 205, 203, 202, 200, 199, 197, 196, 194, 193, 191, 190, 188, 187, 186, 184, 183, 182, 180, 179, 178, 177, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 150, 149, 148, 147, 146, 145, 144, 144, 143, 142, 141, 140, 140, 139, 138, 137, 137, 136, 135, 134, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 120, 120, 119, 119, 118, 118, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 104, 103, 103, 102, 102, 101, 101, 101, 100, 100, 100 }, /* 101 */ { 101, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 247, 245, 242, 240, 238, 236, 234, 232, 229, 227, 225, 223, 222, 220, 218, 216, 214, 212, 211, 209, 207, 206, 204, 202, 201, 199, 198, 196, 195, 193, 192, 190, 189, 187, 186, 185, 183, 182, 181, 180, 178, 177, 176, 175, 174, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 161, 160, 159, 158, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 148, 147, 146, 145, 144, 143, 143, 142, 141, 140, 139, 139, 138, 137, 136, 136, 135, 134, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 114, 114, 113, 113, 112, 112, 111, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 105, 104, 104, 103, 103, 103, 102, 102, 101, 101, 101 }, /* 102 */ { 102, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 250, 247, 245, 243, 240, 238, 236, 234, 232, 230, 228, 226, 224, 222, 220, 218, 216, 214, 213, 211, 209, 208, 206, 204, 203, 201, 200, 198, 197, 195, 194, 192, 191, 189, 188, 187, 185, 184, 183, 181, 180, 179, 178, 176, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 153, 152, 151, 150, 149, 148, 147, 146, 146, 145, 144, 143, 142, 142, 141, 140, 139, 139, 138, 137, 136, 136, 135, 134, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 107, 106, 106, 105, 105, 104, 104, 104, 103, 103, 102, 102, 102 }, /* 103 */ { 103, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 247, 245, 243, 240, 238, 236, 234, 232, 230, 228, 226, 224, 222, 220, 218, 217, 215, 213, 211, 210, 208, 206, 205, 203, 202, 200, 198, 197, 196, 194, 193, 191, 190, 188, 187, 186, 184, 183, 182, 181, 179, 178, 177, 176, 175, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 150, 149, 148, 147, 146, 145, 145, 144, 143, 142, 141, 141, 140, 139, 138, 138, 137, 136, 136, 135, 134, 134, 133, 132, 131, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 121, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 108, 107, 107, 106, 106, 105, 105, 105, 104, 104, 103, 103, 103 }, /* 104 */ { 104, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 247, 245, 243, 241, 238, 236, 234, 232, 230, 228, 226, 224, 222, 221, 219, 217, 215, 213, 212, 210, 208, 207, 205, 203, 202, 200, 199, 197, 196, 195, 193, 192, 190, 189, 188, 186, 185, 184, 182, 181, 180, 179, 177, 176, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 156, 155, 154, 153, 152, 151, 150, 149, 148, 148, 147, 146, 145, 144, 144, 143, 142, 141, 141, 140, 139, 138, 138, 137, 136, 135, 135, 134, 133, 133, 132, 131, 131, 130, 130, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 121, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 110, 109, 109, 108, 108, 107, 107, 106, 106, 106, 105, 105, 104, 104, 104 }, /* 105 */ { 105, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 247, 245, 243, 241, 239, 236, 234, 232, 230, 228, 226, 224, 223, 221, 219, 217, 215, 214, 212, 210, 209, 207, 205, 204, 202, 201, 199, 198, 196, 195, 194, 192, 191, 189, 188, 187, 185, 184, 183, 182, 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 152, 151, 150, 149, 148, 147, 147, 146, 145, 144, 143, 143, 142, 141, 140, 140, 139, 138, 138, 137, 136, 135, 135, 134, 133, 133, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 107, 107, 106, 106, 105, 105, 105 }, /* 106 */ { 106, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 247, 245, 243, 241, 239, 237, 235, 233, 231, 229, 227, 225, 223, 221, 219, 217, 216, 214, 212, 211, 209, 207, 206, 204, 203, 201, 200, 198, 197, 195, 194, 193, 191, 190, 189, 187, 186, 185, 183, 182, 181, 180, 179, 177, 176, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 159, 158, 157, 156, 155, 154, 153, 152, 151, 151, 150, 149, 148, 147, 146, 146, 145, 144, 143, 143, 142, 141, 140, 140, 139, 138, 137, 137, 136, 135, 135, 134, 133, 133, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 109, 109, 108, 108, 108, 107, 107, 106, 106, 106 }, /* 107 */ { 107, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 245, 243, 241, 239, 237, 235, 233, 231, 229, 227, 225, 223, 221, 220, 218, 216, 214, 213, 211, 209, 208, 206, 205, 203, 202, 200, 199, 197, 196, 194, 193, 192, 190, 189, 188, 186, 185, 184, 183, 181, 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 155, 154, 153, 152, 151, 150, 149, 149, 148, 147, 146, 145, 145, 144, 143, 142, 142, 141, 140, 139, 139, 138, 137, 137, 136, 135, 135, 134, 133, 133, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 110, 109, 109, 108, 108, 107, 107, 107 }, /* 108 */ { 108, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 245, 243, 241, 239, 237, 235, 233, 231, 229, 227, 225, 223, 222, 220, 218, 216, 215, 213, 211, 210, 208, 207, 205, 203, 202, 201, 199, 198, 196, 195, 193, 192, 191, 189, 188, 187, 186, 184, 183, 182, 181, 179, 178, 177, 176, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 152, 151, 150, 149, 148, 148, 147, 146, 145, 144, 144, 143, 142, 141, 141, 140, 139, 139, 138, 137, 137, 136, 135, 135, 134, 133, 133, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 111, 110, 110, 109, 109, 108, 108, 108 }, /* 109 */ { 109, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 245, 243, 241, 239, 237, 235, 233, 231, 229, 227, 225, 224, 222, 220, 218, 217, 215, 213, 212, 210, 208, 207, 205, 204, 202, 201, 199, 198, 197, 195, 194, 193, 191, 190, 189, 187, 186, 185, 184, 182, 181, 180, 179, 178, 177, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 157, 156, 155, 154, 153, 152, 151, 151, 150, 149, 148, 147, 147, 146, 145, 144, 144, 143, 142, 141, 141, 140, 139, 138, 138, 137, 136, 136, 135, 134, 134, 133, 132, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 112, 111, 111, 110, 110, 109, 109, 109 }, /* 110 */ { 110, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 243, 241, 239, 237, 235, 233, 231, 229, 228, 226, 224, 222, 220, 219, 217, 215, 214, 212, 210, 209, 207, 206, 204, 203, 201, 200, 198, 197, 196, 194, 193, 192, 190, 189, 188, 186, 185, 184, 183, 182, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 169, 168, 167, 166, 165, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 154, 153, 152, 151, 150, 149, 149, 148, 147, 146, 146, 145, 144, 143, 143, 142, 141, 140, 140, 139, 138, 138, 137, 136, 136, 135, 134, 134, 133, 132, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 114, 113, 113, 112, 112, 111, 111, 110, 110, 110 }, /* 111 */ { 111, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 241, 239, 237, 235, 233, 232, 230, 228, 226, 224, 222, 221, 219, 217, 216, 214, 212, 211, 209, 208, 206, 205, 203, 202, 200, 199, 197, 196, 195, 193, 192, 191, 189, 188, 187, 186, 184, 183, 182, 181, 180, 179, 178, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 159, 158, 157, 156, 155, 154, 153, 152, 152, 151, 150, 149, 148, 148, 147, 146, 145, 145, 144, 143, 142, 142, 141, 140, 140, 139, 138, 138, 137, 136, 136, 135, 134, 134, 133, 132, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 111, 111, 111 }, /* 112 */ { 112, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 239, 238, 236, 234, 232, 230, 228, 226, 224, 223, 221, 219, 218, 216, 214, 213, 211, 210, 208, 206, 205, 203, 202, 201, 199, 198, 196, 195, 194, 192, 191, 190, 189, 187, 186, 185, 184, 183, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 169, 168, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 156, 155, 154, 153, 152, 151, 151, 150, 149, 148, 147, 147, 146, 145, 144, 144, 143, 142, 142, 141, 140, 140, 139, 138, 137, 137, 136, 135, 135, 134, 134, 133, 132, 132, 131, 131, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 119, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 112, 112, 112 }, /* 113 */ { 113, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 236, 234, 232, 230, 228, 226, 225, 223, 221, 219, 218, 216, 215, 213, 211, 210, 208, 207, 205, 204, 202, 201, 200, 198, 197, 196, 194, 193, 192, 190, 189, 188, 187, 185, 184, 183, 182, 181, 180, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 160, 159, 158, 157, 156, 155, 154, 154, 153, 152, 151, 150, 150, 149, 148, 147, 147, 146, 145, 144, 144, 143, 142, 141, 141, 140, 139, 139, 138, 137, 137, 136, 135, 135, 134, 134, 133, 132, 132, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 113, 113, 113 }, /* 114 */ { 114, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 236, 234, 232, 230, 228, 227, 225, 223, 221, 220, 218, 216, 215, 213, 212, 210, 209, 207, 206, 204, 203, 201, 200, 199, 197, 196, 195, 193, 192, 191, 189, 188, 187, 186, 185, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 169, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 157, 156, 155, 154, 153, 152, 152, 151, 150, 149, 149, 148, 147, 146, 146, 145, 144, 143, 143, 142, 141, 141, 140, 139, 139, 138, 137, 137, 136, 135, 135, 134, 133, 133, 132, 132, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 114, 114, 114 }, /* 115 */ { 115, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 236, 234, 232, 230, 229, 227, 225, 223, 222, 220, 218, 217, 215, 214, 212, 210, 209, 207, 206, 205, 203, 202, 200, 199, 198, 196, 195, 194, 192, 191, 190, 189, 187, 186, 185, 184, 183, 182, 181, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 157, 156, 155, 155, 154, 153, 152, 151, 151, 150, 149, 148, 148, 147, 146, 145, 145, 144, 143, 143, 142, 141, 140, 140, 139, 138, 138, 137, 137, 136, 135, 135, 134, 133, 133, 132, 132, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 115, 115, 115 }, /* 116 */ { 116, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 236, 234, 232, 231, 229, 227, 225, 224, 222, 220, 219, 217, 215, 214, 212, 211, 209, 208, 206, 205, 203, 202, 201, 199, 198, 197, 195, 194, 193, 192, 190, 189, 188, 187, 186, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 159, 158, 157, 156, 155, 154, 154, 153, 152, 151, 150, 150, 149, 148, 147, 147, 146, 145, 145, 144, 143, 142, 142, 141, 140, 140, 139, 138, 138, 137, 136, 136, 135, 135, 134, 133, 133, 132, 132, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 116, 116, 116 }, /* 117 */ { 117, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 236, 234, 233, 231, 229, 227, 226, 224, 222, 220, 219, 217, 216, 214, 213, 211, 210, 208, 207, 205, 204, 202, 201, 200, 198, 197, 196, 194, 193, 192, 191, 190, 188, 187, 186, 185, 184, 183, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 163, 162, 161, 160, 159, 158, 157, 157, 156, 155, 154, 153, 152, 152, 151, 150, 149, 149, 148, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 140, 140, 139, 138, 138, 137, 136, 136, 135, 134, 134, 133, 133, 132, 132, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 117, 117, 117 }, /* 118 */ { 118, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 236, 235, 233, 231, 229, 227, 226, 224, 222, 221, 219, 218, 216, 214, 213, 211, 210, 208, 207, 206, 204, 203, 201, 200, 199, 197, 196, 195, 194, 192, 191, 190, 189, 188, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 160, 159, 158, 157, 156, 155, 155, 154, 153, 152, 151, 151, 150, 149, 148, 148, 147, 146, 146, 145, 144, 143, 143, 142, 141, 141, 140, 139, 139, 138, 138, 137, 136, 136, 135, 134, 134, 133, 133, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 118, 118, 118 }, /* 119 */ { 119, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 240, 238, 237, 235, 233, 231, 229, 228, 226, 224, 223, 221, 219, 218, 216, 215, 213, 212, 210, 209, 207, 206, 205, 203, 202, 200, 199, 198, 197, 195, 194, 193, 192, 190, 189, 188, 187, 186, 185, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 164, 163, 162, 161, 160, 159, 158, 158, 157, 156, 155, 154, 154, 153, 152, 151, 150, 150, 149, 148, 148, 147, 146, 145, 145, 144, 143, 143, 142, 141, 141, 140, 139, 139, 138, 137, 137, 136, 136, 135, 134, 134, 133, 133, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 119, 119, 119 }, /* 120 */ { 120, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 250, 248, 246, 244, 242, 240, 239, 237, 235, 233, 231, 230, 228, 226, 225, 223, 221, 220, 218, 217, 215, 213, 212, 211, 209, 208, 206, 205, 203, 202, 201, 199, 198, 197, 196, 194, 193, 192, 191, 190, 188, 187, 186, 185, 184, 183, 182, 181, 180, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 163, 162, 161, 161, 160, 159, 158, 157, 156, 156, 155, 154, 153, 152, 152, 151, 150, 150, 149, 148, 147, 147, 146, 145, 145, 144, 143, 142, 142, 141, 141, 140, 139, 139, 138, 137, 137, 136, 135, 135, 134, 134, 133, 133, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 120, 120, 120 }, /* 121 */ { 121, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 242, 241, 239, 237, 235, 233, 231, 230, 228, 226, 225, 223, 221, 220, 218, 217, 215, 214, 212, 211, 209, 208, 207, 205, 204, 202, 201, 200, 199, 197, 196, 195, 194, 192, 191, 190, 189, 188, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 164, 163, 162, 161, 160, 159, 159, 158, 157, 156, 155, 155, 154, 153, 152, 151, 151, 150, 149, 149, 148, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 140, 140, 139, 138, 138, 137, 137, 136, 135, 135, 134, 134, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 121, 121, 121 }, /* 122 */ { 122, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 244, 243, 241, 239, 237, 235, 233, 232, 230, 228, 227, 225, 223, 222, 220, 219, 217, 216, 214, 213, 211, 210, 208, 207, 206, 204, 203, 202, 200, 199, 198, 196, 195, 194, 193, 192, 190, 189, 188, 187, 186, 185, 184, 183, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 157, 157, 156, 155, 154, 154, 153, 152, 151, 151, 150, 149, 148, 148, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 140, 140, 139, 138, 138, 137, 137, 136, 135, 135, 134, 134, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 122, 122, 122 }, /* 123 */ { 123, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 246, 245, 243, 241, 239, 237, 235, 234, 232, 230, 228, 227, 225, 224, 222, 220, 219, 217, 216, 214, 213, 211, 210, 209, 207, 206, 204, 203, 202, 201, 199, 198, 197, 196, 194, 193, 192, 191, 190, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 165, 164, 163, 162, 161, 160, 160, 159, 158, 157, 156, 156, 155, 154, 153, 152, 152, 151, 150, 150, 149, 148, 147, 147, 146, 145, 145, 144, 143, 143, 142, 141, 141, 140, 140, 139, 138, 138, 137, 136, 136, 135, 135, 134, 134, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 123, 123, 123 }, /* 124 */ { 124, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 248, 247, 245, 243, 241, 239, 237, 235, 234, 232, 230, 229, 227, 225, 224, 222, 221, 219, 218, 216, 215, 213, 212, 210, 209, 208, 206, 205, 203, 202, 201, 200, 198, 197, 196, 195, 193, 192, 191, 190, 189, 188, 187, 186, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 158, 157, 156, 155, 155, 154, 153, 152, 152, 151, 150, 149, 149, 148, 147, 147, 146, 145, 145, 144, 143, 143, 142, 141, 141, 140, 139, 139, 138, 138, 137, 136, 136, 135, 135, 134, 133, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 124, 124, 124 }, /* 125 */ { 125, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 250, 249, 247, 245, 243, 241, 239, 237, 236, 234, 232, 230, 229, 227, 226, 224, 222, 221, 219, 218, 216, 215, 213, 212, 211, 209, 208, 206, 205, 204, 203, 201, 200, 199, 197, 196, 195, 194, 193, 192, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 166, 165, 164, 163, 162, 161, 160, 160, 159, 158, 157, 157, 156, 155, 154, 153, 153, 152, 151, 151, 150, 149, 148, 148, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 141, 140, 139, 139, 138, 137, 137, 136, 136, 135, 135, 134, 133, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 125, 125, 125 }, /* 126 */ { 126, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 251, 249, 247, 245, 243, 241, 239, 237, 236, 234, 232, 231, 229, 227, 226, 224, 223, 221, 220, 218, 217, 215, 214, 212, 211, 209, 208, 207, 205, 204, 203, 202, 200, 199, 198, 197, 195, 194, 193, 192, 191, 190, 189, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 163, 163, 162, 161, 160, 159, 159, 158, 157, 156, 155, 155, 154, 153, 152, 152, 151, 150, 150, 149, 148, 148, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 140, 140, 139, 139, 138, 137, 137, 136, 136, 135, 134, 134, 133, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 126, 126, 126 }, /* 127 */ { 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 243, 241, 239, 238, 236, 234, 232, 231, 229, 228, 226, 224, 223, 221, 220, 218, 217, 215, 214, 213, 211, 210, 208, 207, 206, 204, 203, 202, 201, 199, 198, 197, 196, 195, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 182, 181, 180, 179, 178, 177, 176, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 166, 165, 164, 163, 162, 161, 161, 160, 159, 158, 157, 157, 156, 155, 154, 154, 153, 152, 152, 151, 150, 149, 149, 148, 147, 147, 146, 145, 145, 144, 143, 143, 142, 142, 141, 140, 140, 139, 138, 138, 137, 137, 136, 136, 135, 134, 134, 133, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128, 127, 127 }, /* 128 */ { 128, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 251, 249, 247, 245, 243, 241, 240, 238, 236, 234, 233, 231, 229, 228, 226, 225, 223, 222, 220, 219, 217, 216, 214, 213, 211, 210, 209, 207, 206, 205, 204, 202, 201, 200, 199, 197, 196, 195, 194, 193, 192, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 170, 169, 168, 167, 166, 165, 164, 164, 163, 162, 161, 160, 160, 159, 158, 157, 156, 156, 155, 154, 153, 153, 152, 151, 151, 150, 149, 149, 148, 147, 147, 146, 145, 145, 144, 143, 143, 142, 141, 141, 140, 140, 139, 138, 138, 137, 137, 136, 136, 135, 134, 134, 133, 133, 132, 132, 131, 131, 130, 130, 129, 129, 128, 128 }, /* 129 */ { 129, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 243, 241, 240, 238, 236, 234, 233, 231, 230, 228, 226, 225, 223, 222, 220, 219, 217, 216, 214, 213, 212, 210, 209, 208, 206, 205, 204, 203, 201, 200, 199, 198, 196, 195, 194, 193, 192, 191, 190, 189, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 174, 173, 172, 171, 170, 169, 168, 167, 166, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 158, 157, 156, 155, 155, 154, 153, 152, 152, 151, 150, 150, 149, 148, 148, 147, 146, 146, 145, 144, 144, 143, 143, 142, 141, 141, 140, 139, 139, 138, 138, 137, 137, 136, 135, 135, 134, 134, 133, 133, 132, 132, 131, 131, 130, 130, 129, 129 }, /* 130 */ { 130, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 243, 241, 240, 238, 236, 235, 233, 231, 230, 228, 227, 225, 223, 222, 220, 219, 218, 216, 215, 213, 212, 211, 209, 208, 207, 205, 204, 203, 202, 200, 199, 198, 197, 196, 195, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 164, 164, 163, 162, 161, 160, 160, 159, 158, 157, 157, 156, 155, 154, 154, 153, 152, 152, 151, 150, 149, 149, 148, 147, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 141, 140, 139, 139, 138, 138, 137, 136, 136, 135, 135, 134, 134, 133, 133, 132, 132, 131, 131, 130, 130 }, /* 131 */ { 131, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 243, 242, 240, 238, 236, 235, 233, 231, 230, 228, 227, 225, 224, 222, 221, 219, 218, 216, 215, 214, 212, 211, 210, 208, 207, 206, 204, 203, 202, 201, 200, 198, 197, 196, 195, 194, 193, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 173, 172, 171, 170, 169, 168, 167, 167, 166, 165, 164, 163, 162, 162, 161, 160, 159, 159, 158, 157, 156, 156, 155, 154, 153, 153, 152, 151, 151, 150, 149, 149, 148, 147, 147, 146, 145, 145, 144, 143, 143, 142, 142, 141, 140, 140, 139, 139, 138, 138, 137, 136, 136, 135, 135, 134, 134, 133, 133, 132, 132, 131, 131 }, /* 132 */ { 132, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 243, 242, 240, 238, 237, 235, 233, 232, 230, 228, 227, 225, 224, 222, 221, 219, 218, 217, 215, 214, 213, 211, 210, 209, 207, 206, 205, 203, 202, 201, 200, 199, 198, 196, 195, 194, 193, 192, 191, 190, 189, 188, 186, 185, 184, 183, 182, 181, 180, 179, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 165, 164, 163, 162, 161, 161, 160, 159, 158, 158, 157, 156, 155, 155, 154, 153, 152, 152, 151, 150, 150, 149, 148, 148, 147, 146, 146, 145, 145, 144, 143, 143, 142, 142, 141, 140, 140, 139, 139, 138, 137, 137, 136, 136, 135, 135, 134, 134, 133, 133, 132, 132 }, /* 133 */ { 133, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 243, 242, 240, 238, 237, 235, 233, 232, 230, 229, 227, 226, 224, 223, 221, 220, 218, 217, 216, 214, 213, 211, 210, 209, 208, 206, 205, 204, 203, 201, 200, 199, 198, 197, 196, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 173, 172, 171, 170, 169, 168, 167, 167, 166, 165, 164, 163, 163, 162, 161, 160, 159, 159, 158, 157, 157, 156, 155, 154, 154, 153, 152, 152, 151, 150, 150, 149, 148, 148, 147, 146, 146, 145, 144, 144, 143, 143, 142, 141, 141, 140, 140, 139, 138, 138, 137, 137, 136, 136, 135, 135, 134, 134, 133, 133 }, /* 134 */ { 134, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 244, 242, 240, 238, 237, 235, 234, 232, 230, 229, 227, 226, 224, 223, 221, 220, 219, 217, 216, 214, 213, 212, 210, 209, 208, 207, 205, 204, 203, 202, 201, 199, 198, 197, 196, 195, 194, 193, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 177, 176, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 165, 164, 163, 162, 161, 161, 160, 159, 158, 158, 157, 156, 156, 155, 154, 153, 153, 152, 151, 151, 150, 149, 149, 148, 147, 147, 146, 146, 145, 144, 144, 143, 142, 142, 141, 141, 140, 140, 139, 138, 138, 137, 137, 136, 136, 135, 135, 134, 134 }, /* 135 */ { 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 245, 244, 242, 240, 239, 237, 235, 234, 232, 231, 229, 227, 226, 224, 223, 222, 220, 219, 217, 216, 215, 213, 212, 211, 209, 208, 207, 206, 204, 203, 202, 201, 200, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 172, 171, 170, 169, 168, 167, 167, 166, 165, 164, 163, 163, 162, 161, 160, 160, 159, 158, 157, 157, 156, 155, 155, 154, 153, 152, 152, 151, 150, 150, 149, 149, 148, 147, 147, 146, 145, 145, 144, 144, 143, 142, 142, 141, 141, 140, 139, 139, 138, 138, 137, 137, 136, 136, 135, 135 }, /* 136 */ { 136, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 251, 249, 247, 245, 244, 242, 240, 239, 237, 235, 234, 232, 231, 229, 228, 226, 225, 223, 222, 220, 219, 218, 216, 215, 214, 212, 211, 210, 208, 207, 206, 205, 204, 202, 201, 200, 199, 198, 197, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 176, 175, 174, 173, 172, 171, 170, 170, 169, 168, 167, 166, 165, 165, 164, 163, 162, 162, 161, 160, 159, 159, 158, 157, 156, 156, 155, 154, 154, 153, 152, 152, 151, 150, 150, 149, 148, 148, 147, 146, 146, 145, 145, 144, 143, 143, 142, 142, 141, 140, 140, 139, 139, 138, 138, 137, 137, 136, 136 }, /* 137 */ { 137, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 246, 244, 242, 240, 239, 237, 236, 234, 232, 231, 229, 228, 226, 225, 223, 222, 221, 219, 218, 216, 215, 214, 213, 211, 210, 209, 207, 206, 205, 204, 203, 201, 200, 199, 198, 197, 196, 195, 194, 193, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 172, 171, 170, 169, 168, 167, 167, 166, 165, 164, 164, 163, 162, 161, 160, 160, 159, 158, 158, 157, 156, 155, 155, 154, 153, 153, 152, 151, 151, 150, 149, 149, 148, 148, 147, 146, 146, 145, 144, 144, 143, 143, 142, 142, 141, 140, 140, 139, 139, 138, 138, 137, 137 }, /* 138 */ { 138, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 246, 244, 242, 241, 239, 237, 236, 234, 233, 231, 229, 228, 227, 225, 224, 222, 221, 219, 218, 217, 215, 214, 213, 211, 210, 209, 208, 207, 205, 204, 203, 202, 201, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 165, 165, 164, 163, 162, 162, 161, 160, 159, 159, 158, 157, 157, 156, 155, 155, 154, 153, 152, 152, 151, 151, 150, 149, 149, 148, 147, 147, 146, 146, 145, 144, 144, 143, 143, 142, 141, 141, 140, 140, 139, 139, 138, 138 }, /* 139 */ { 139, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 246, 244, 242, 241, 239, 237, 236, 234, 233, 231, 230, 228, 227, 225, 224, 222, 221, 220, 218, 217, 216, 214, 213, 212, 210, 209, 208, 207, 206, 204, 203, 202, 201, 200, 199, 198, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 179, 178, 177, 176, 175, 174, 173, 172, 172, 171, 170, 169, 168, 167, 167, 166, 165, 164, 164, 163, 162, 161, 161, 160, 159, 158, 158, 157, 156, 156, 155, 154, 154, 153, 152, 152, 151, 150, 150, 149, 148, 148, 147, 147, 146, 145, 145, 144, 144, 143, 142, 142, 141, 141, 140, 140, 139, 139 }, /* 140 */ { 140, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 246, 244, 242, 241, 239, 237, 236, 234, 233, 231, 230, 228, 227, 225, 224, 223, 221, 220, 219, 217, 216, 215, 213, 212, 211, 210, 208, 207, 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 192, 191, 190, 189, 188, 187, 186, 185, 184, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 175, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 166, 165, 164, 163, 163, 162, 161, 160, 160, 159, 158, 157, 157, 156, 155, 155, 154, 153, 153, 152, 151, 151, 150, 149, 149, 148, 148, 147, 146, 146, 145, 145, 144, 143, 143, 142, 142, 141, 141, 140, 140 }, /* 141 */ { 141, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 247, 246, 244, 242, 241, 239, 238, 236, 234, 233, 231, 230, 229, 227, 226, 224, 223, 221, 220, 219, 217, 216, 215, 214, 212, 211, 210, 209, 207, 206, 205, 204, 203, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 177, 176, 175, 174, 173, 172, 172, 171, 170, 169, 168, 168, 167, 166, 165, 164, 164, 163, 162, 161, 161, 160, 159, 159, 158, 157, 157, 156, 155, 154, 154, 153, 152, 152, 151, 151, 150, 149, 149, 148, 147, 147, 146, 146, 145, 144, 144, 143, 143, 142, 142, 141, 141 }, /* 142 */ { 142, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 244, 243, 241, 239, 238, 236, 235, 233, 232, 230, 229, 227, 226, 224, 223, 222, 220, 219, 218, 216, 215, 214, 213, 211, 210, 209, 208, 206, 205, 204, 203, 202, 201, 200, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 176, 175, 174, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 166, 165, 164, 163, 163, 162, 161, 160, 160, 159, 158, 158, 157, 156, 156, 155, 154, 154, 153, 152, 152, 151, 150, 150, 149, 149, 148, 147, 147, 146, 146, 145, 144, 144, 143, 143, 142, 142 }, /* 143 */ { 143, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 244, 243, 241, 239, 238, 236, 235, 233, 232, 230, 229, 227, 226, 225, 223, 222, 220, 219, 218, 217, 215, 214, 213, 212, 210, 209, 208, 207, 206, 204, 203, 202, 201, 200, 199, 198, 197, 196, 194, 193, 192, 191, 190, 189, 188, 187, 186, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 177, 176, 175, 174, 173, 172, 172, 171, 170, 169, 168, 168, 167, 166, 165, 164, 164, 163, 162, 162, 161, 160, 159, 159, 158, 157, 157, 156, 155, 155, 154, 153, 153, 152, 151, 151, 150, 150, 149, 148, 148, 147, 147, 146, 145, 145, 144, 144, 143, 143 }, /* 144 */ { 144, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 244, 243, 241, 239, 238, 236, 235, 233, 232, 230, 229, 228, 226, 225, 223, 222, 221, 219, 218, 217, 216, 214, 213, 212, 211, 209, 208, 207, 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 180, 179, 178, 177, 176, 175, 174, 174, 173, 172, 171, 170, 169, 169, 168, 167, 166, 166, 165, 164, 163, 163, 162, 161, 161, 160, 159, 158, 158, 157, 156, 156, 155, 154, 154, 153, 153, 152, 151, 151, 150, 149, 149, 148, 148, 147, 146, 146, 145, 145, 144, 144 }, /* 145 */ { 145, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 244, 243, 241, 240, 238, 237, 235, 234, 232, 231, 229, 228, 226, 225, 224, 222, 221, 220, 218, 217, 216, 214, 213, 212, 211, 210, 208, 207, 206, 205, 204, 203, 202, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 183, 182, 181, 180, 179, 178, 177, 176, 176, 175, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 165, 165, 164, 163, 162, 162, 161, 160, 160, 159, 158, 158, 157, 156, 156, 155, 154, 154, 153, 152, 152, 151, 150, 150, 149, 149, 148, 147, 147, 146, 146, 145, 145 }, /* 146 */ { 146, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 244, 243, 241, 240, 238, 237, 235, 234, 232, 231, 229, 228, 227, 225, 224, 222, 221, 220, 219, 217, 216, 215, 213, 212, 211, 210, 209, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 196, 195, 194, 193, 192, 191, 190, 189, 188, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 178, 177, 176, 175, 174, 173, 173, 172, 171, 170, 169, 169, 168, 167, 166, 166, 165, 164, 164, 163, 162, 161, 161, 160, 159, 159, 158, 157, 157, 156, 155, 155, 154, 153, 153, 152, 151, 151, 150, 150, 149, 148, 148, 147, 147, 146, 146 }, /* 147 */ { 147, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 244, 243, 241, 240, 238, 237, 235, 234, 232, 231, 229, 228, 227, 225, 224, 223, 221, 220, 219, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 176, 175, 175, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 165, 165, 164, 163, 162, 162, 161, 160, 160, 159, 158, 158, 157, 156, 156, 155, 154, 154, 153, 152, 152, 151, 151, 150, 149, 149, 148, 148, 147, 147 }, /* 148 */ { 148, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 245, 243, 241, 240, 238, 237, 235, 234, 232, 231, 230, 228, 227, 225, 224, 223, 222, 220, 219, 218, 216, 215, 214, 213, 212, 210, 209, 208, 207, 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 185, 184, 183, 182, 181, 180, 179, 178, 178, 177, 176, 175, 174, 173, 173, 172, 171, 170, 169, 169, 168, 167, 166, 166, 165, 164, 164, 163, 162, 161, 161, 160, 159, 159, 158, 157, 157, 156, 155, 155, 154, 154, 153, 152, 152, 151, 150, 150, 149, 149, 148, 148 }, /* 149 */ { 149, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 245, 243, 242, 240, 238, 237, 235, 234, 233, 231, 230, 228, 227, 226, 224, 223, 222, 220, 219, 218, 217, 215, 214, 213, 212, 211, 209, 208, 207, 206, 205, 204, 203, 202, 201, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 180, 179, 178, 177, 176, 175, 175, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 165, 165, 164, 163, 163, 162, 161, 160, 160, 159, 158, 158, 157, 157, 156, 155, 155, 154, 153, 153, 152, 151, 151, 150, 150, 149, 149 }, /* 150 */ { 150, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 249, 248, 246, 245, 243, 242, 240, 239, 237, 236, 234, 233, 231, 230, 229, 227, 226, 225, 223, 222, 221, 219, 218, 217, 216, 214, 213, 212, 211, 210, 209, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 183, 182, 181, 180, 179, 178, 177, 177, 176, 175, 174, 173, 173, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 164, 164, 163, 162, 162, 161, 160, 160, 159, 158, 158, 157, 156, 156, 155, 154, 154, 153, 152, 152, 151, 151, 150, 150 }, /* 151 */ { 151, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 246, 245, 243, 242, 240, 239, 237, 236, 234, 233, 231, 230, 229, 227, 226, 225, 223, 222, 221, 220, 218, 217, 216, 215, 213, 212, 211, 210, 209, 208, 207, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 186, 185, 184, 183, 182, 181, 180, 179, 179, 178, 177, 176, 175, 175, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 165, 165, 164, 163, 163, 162, 161, 161, 160, 159, 159, 158, 157, 157, 156, 155, 155, 154, 154, 153, 152, 152, 151, 151 }, /* 152 */ { 152, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 246, 245, 243, 242, 240, 239, 237, 236, 234, 233, 232, 230, 229, 228, 226, 225, 224, 222, 221, 220, 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 176, 176, 175, 174, 173, 173, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 164, 164, 163, 162, 162, 161, 160, 160, 159, 158, 158, 157, 156, 156, 155, 155, 154, 153, 153, 152, 152 }, /* 153 */ { 153, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 246, 245, 243, 242, 240, 239, 237, 236, 235, 233, 232, 230, 229, 228, 226, 225, 224, 222, 221, 220, 219, 217, 216, 215, 214, 213, 212, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 184, 183, 182, 181, 180, 179, 178, 178, 177, 176, 175, 174, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 164, 163, 163, 162, 161, 161, 160, 159, 159, 158, 157, 157, 156, 156, 155, 154, 154, 153, 153 }, /* 154 */ { 154, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 246, 245, 243, 242, 240, 239, 237, 236, 235, 233, 232, 231, 229, 228, 226, 225, 224, 223, 221, 220, 219, 218, 216, 215, 214, 213, 212, 211, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 186, 185, 184, 183, 182, 181, 180, 180, 179, 178, 177, 176, 176, 175, 174, 173, 172, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 164, 164, 163, 162, 162, 161, 160, 160, 159, 158, 158, 157, 157, 156, 155, 155, 154, 154 }, /* 155 */ { 155, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 243, 242, 241, 239, 238, 236, 235, 233, 232, 231, 229, 228, 227, 225, 224, 223, 222, 220, 219, 218, 217, 215, 214, 213, 212, 211, 210, 209, 208, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 185, 184, 183, 182, 182, 181, 180, 179, 178, 178, 177, 176, 175, 174, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 164, 164, 163, 162, 161, 161, 160, 160, 159, 158, 158, 157, 156, 156, 155, 155 }, /* 156 */ { 156, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 242, 241, 239, 238, 236, 235, 234, 232, 231, 229, 228, 227, 226, 224, 223, 222, 220, 219, 218, 217, 216, 215, 213, 212, 211, 210, 209, 208, 207, 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, 195, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 185, 184, 183, 182, 181, 180, 179, 179, 178, 177, 176, 176, 175, 174, 173, 172, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 165, 164, 163, 163, 162, 161, 161, 160, 159, 159, 158, 157, 157, 156, 156 }, /* 157 */ { 157, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 242, 241, 239, 238, 236, 235, 234, 232, 231, 230, 228, 227, 226, 224, 223, 222, 221, 219, 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 187, 186, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 164, 164, 163, 162, 162, 161, 160, 160, 159, 158, 158, 157, 157 }, /* 158 */ { 158, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 242, 241, 239, 238, 237, 235, 234, 232, 231, 230, 228, 227, 226, 225, 223, 222, 221, 220, 218, 217, 216, 215, 214, 213, 212, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 185, 184, 183, 183, 182, 181, 180, 179, 179, 178, 177, 176, 175, 175, 174, 173, 172, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 165, 164, 163, 163, 162, 161, 161, 160, 159, 159, 158, 158 }, /* 159 */ { 159, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 242, 241, 239, 238, 237, 235, 234, 233, 231, 230, 229, 227, 226, 225, 224, 222, 221, 220, 219, 217, 216, 215, 214, 213, 212, 211, 210, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 188, 187, 186, 185, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 164, 164, 163, 162, 162, 161, 160, 160, 159, 159 }, /* 160 */ { 160, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 251, 250, 248, 247, 245, 244, 242, 241, 240, 238, 237, 235, 234, 233, 231, 230, 229, 227, 226, 225, 224, 222, 221, 220, 219, 218, 217, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 203, 202, 201, 200, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 188, 187, 186, 185, 184, 183, 182, 182, 181, 180, 179, 178, 178, 177, 176, 175, 175, 174, 173, 172, 172, 171, 170, 170, 169, 168, 167, 167, 166, 165, 165, 164, 163, 163, 162, 161, 161, 160, 160 }, /* 161 */ { 161, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 242, 241, 240, 238, 237, 235, 234, 233, 231, 230, 229, 228, 226, 225, 224, 223, 221, 220, 219, 218, 217, 216, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 185, 184, 184, 183, 182, 181, 180, 180, 179, 178, 177, 176, 176, 175, 174, 173, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 164, 164, 163, 162, 162, 161, 161 }, /* 162 */ { 162, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 243, 241, 240, 238, 237, 236, 234, 233, 232, 230, 229, 228, 226, 225, 224, 223, 222, 220, 219, 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 188, 187, 186, 186, 185, 184, 183, 182, 181, 181, 180, 179, 178, 178, 177, 176, 175, 175, 174, 173, 172, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 165, 164, 163, 163, 162, 162 }, /* 163 */ { 163, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 245, 244, 243, 241, 240, 238, 237, 236, 234, 233, 232, 230, 229, 228, 227, 225, 224, 223, 222, 221, 219, 218, 217, 216, 215, 214, 213, 212, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 196, 195, 194, 193, 192, 191, 190, 189, 188, 188, 187, 186, 185, 184, 183, 183, 182, 181, 180, 179, 179, 178, 177, 176, 176, 175, 174, 173, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 164, 164, 163, 163 }, /* 164 */ { 164, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 246, 244, 243, 241, 240, 238, 237, 236, 234, 233, 232, 231, 229, 228, 227, 226, 224, 223, 222, 221, 220, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 203, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 185, 185, 184, 183, 182, 181, 181, 180, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 172, 171, 170, 169, 169, 168, 167, 167, 166, 165, 165, 164, 164 }, /* 165 */ { 165, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 248, 247, 246, 244, 243, 241, 240, 239, 237, 236, 235, 233, 232, 231, 229, 228, 227, 226, 224, 223, 222, 221, 220, 219, 218, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 188, 187, 186, 186, 185, 184, 183, 182, 182, 181, 180, 179, 179, 178, 177, 176, 176, 175, 174, 173, 173, 172, 171, 171, 170, 169, 168, 168, 167, 166, 166, 165, 165 }, /* 166 */ { 166, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 249, 247, 246, 244, 243, 241, 240, 239, 237, 236, 235, 233, 232, 231, 230, 228, 227, 226, 225, 223, 222, 221, 220, 219, 218, 217, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 195, 194, 193, 192, 191, 190, 189, 188, 188, 187, 186, 185, 184, 184, 183, 182, 181, 180, 180, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 172, 171, 170, 169, 169, 168, 167, 167, 166, 166 }, /* 167 */ { 167, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 251, 250, 249, 247, 246, 244, 243, 241, 240, 239, 237, 236, 235, 233, 232, 231, 230, 228, 227, 226, 225, 224, 222, 221, 220, 219, 218, 217, 216, 215, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 198, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 185, 185, 184, 183, 182, 181, 181, 180, 179, 178, 178, 177, 176, 175, 175, 174, 173, 173, 172, 171, 171, 170, 169, 168, 168, 167, 167 }, /* 168 */ { 168, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 244, 243, 242, 240, 239, 237, 236, 235, 234, 232, 231, 230, 229, 227, 226, 225, 224, 223, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 192, 191, 190, 189, 188, 187, 187, 186, 185, 184, 183, 183, 182, 181, 180, 179, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 172, 171, 170, 169, 169, 168, 168 }, /* 169 */ { 169, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 244, 243, 242, 240, 239, 238, 236, 235, 234, 232, 231, 230, 229, 228, 226, 225, 224, 223, 222, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 194, 193, 192, 191, 190, 189, 189, 188, 187, 186, 185, 184, 184, 183, 182, 181, 181, 180, 179, 178, 178, 177, 176, 175, 175, 174, 173, 173, 172, 171, 171, 170, 169, 169 }, /* 170 */ { 170, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 252, 250, 249, 247, 246, 244, 243, 242, 240, 239, 238, 236, 235, 234, 233, 231, 230, 229, 228, 226, 225, 224, 223, 222, 221, 220, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 197, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 186, 185, 184, 183, 182, 182, 181, 180, 179, 179, 178, 177, 176, 176, 175, 174, 174, 173, 172, 172, 171, 170, 170 }, /* 171 */ { 171, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 244, 243, 242, 240, 239, 238, 236, 235, 234, 233, 231, 230, 229, 228, 227, 225, 224, 223, 222, 221, 220, 219, 218, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 198, 197, 196, 195, 194, 193, 192, 192, 191, 190, 189, 188, 187, 187, 186, 185, 184, 183, 183, 182, 181, 180, 180, 179, 178, 177, 177, 176, 175, 175, 174, 173, 173, 172, 171, 171 }, /* 172 */ { 172, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 245, 243, 242, 240, 239, 238, 237, 235, 234, 233, 232, 230, 229, 228, 227, 226, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 194, 193, 192, 191, 190, 189, 189, 188, 187, 186, 185, 185, 184, 183, 182, 181, 181, 180, 179, 179, 178, 177, 176, 176, 175, 174, 174, 173, 172, 172 }, /* 173 */ { 173, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 245, 243, 242, 241, 239, 238, 237, 235, 234, 233, 232, 230, 229, 228, 227, 226, 225, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 186, 186, 185, 184, 183, 183, 182, 181, 180, 180, 179, 178, 177, 177, 176, 175, 175, 174, 173, 173 }, /* 174 */ { 174, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 245, 243, 242, 241, 239, 238, 237, 236, 234, 233, 232, 231, 229, 228, 227, 226, 225, 224, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 198, 197, 196, 195, 194, 193, 192, 192, 191, 190, 189, 188, 188, 187, 186, 185, 184, 184, 183, 182, 181, 181, 180, 179, 178, 178, 177, 176, 176, 175, 174, 174 }, /* 175 */ { 175, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 245, 243, 242, 241, 239, 238, 237, 236, 234, 233, 232, 231, 230, 228, 227, 226, 225, 224, 223, 222, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 201, 200, 199, 198, 197, 196, 195, 194, 194, 193, 192, 191, 190, 189, 189, 188, 187, 186, 185, 185, 184, 183, 182, 182, 181, 180, 179, 179, 178, 177, 177, 176, 175, 175 }, /* 176 */ { 176, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 245, 243, 242, 241, 239, 238, 237, 236, 234, 233, 232, 231, 230, 228, 227, 226, 225, 224, 223, 222, 221, 220, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 198, 197, 196, 195, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 187, 186, 185, 184, 183, 183, 182, 181, 180, 180, 179, 178, 178, 177, 176, 176 }, /* 177 */ { 177, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 247, 246, 245, 243, 242, 241, 240, 238, 237, 236, 235, 233, 232, 231, 230, 229, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 197, 196, 195, 194, 193, 192, 192, 191, 190, 189, 188, 188, 187, 186, 185, 184, 184, 183, 182, 181, 181, 180, 179, 179, 178, 177, 177 }, /* 178 */ { 178, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 242, 241, 240, 238, 237, 236, 235, 233, 232, 231, 230, 229, 228, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 199, 198, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 189, 188, 187, 186, 186, 185, 184, 183, 183, 182, 181, 180, 180, 179, 178, 178 }, /* 179 */ { 179, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 242, 241, 240, 238, 237, 236, 235, 234, 232, 231, 230, 229, 228, 227, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 201, 200, 199, 198, 197, 196, 195, 195, 194, 193, 192, 191, 190, 190, 189, 188, 187, 187, 186, 185, 184, 184, 183, 182, 181, 181, 180, 179, 179 }, /* 180 */ { 180, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 242, 241, 240, 239, 237, 236, 235, 234, 232, 231, 230, 229, 228, 227, 226, 225, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 198, 197, 196, 196, 195, 194, 193, 192, 192, 191, 190, 189, 188, 188, 187, 186, 185, 185, 184, 183, 182, 182, 181, 180, 180 }, /* 181 */ { 181, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 242, 241, 240, 239, 237, 236, 235, 234, 233, 231, 230, 229, 228, 227, 226, 225, 224, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 206, 205, 204, 203, 202, 201, 200, 199, 198, 198, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 189, 188, 187, 186, 186, 185, 184, 183, 183, 182, 181, 181 }, /* 182 */ { 182, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 242, 241, 240, 239, 237, 236, 235, 234, 233, 232, 230, 229, 228, 227, 226, 225, 224, 223, 222, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 198, 197, 196, 195, 194, 194, 193, 192, 191, 190, 190, 189, 188, 187, 187, 186, 185, 184, 184, 183, 182, 182 }, /* 183 */ { 183, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 243, 241, 240, 239, 238, 236, 235, 234, 233, 232, 231, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 202, 201, 200, 199, 198, 197, 196, 196, 195, 194, 193, 192, 192, 191, 190, 189, 188, 188, 187, 186, 185, 185, 184, 183, 183 }, /* 184 */ { 184, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 243, 241, 240, 239, 238, 236, 235, 234, 233, 232, 231, 230, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 198, 197, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 189, 188, 187, 186, 186, 185, 184, 184 }, /* 185 */ { 185, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 246, 245, 244, 243, 241, 240, 239, 238, 237, 235, 234, 233, 232, 231, 230, 229, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 206, 205, 204, 203, 202, 201, 200, 199, 199, 198, 197, 196, 195, 194, 194, 193, 192, 191, 190, 190, 189, 188, 187, 187, 186, 185, 185 }, /* 186 */ { 186, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 247, 245, 244, 243, 241, 240, 239, 238, 237, 235, 234, 233, 232, 231, 230, 229, 228, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 198, 197, 196, 195, 195, 194, 193, 192, 192, 191, 190, 189, 188, 188, 187, 186, 186 }, /* 187 */ { 187, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 247, 245, 244, 243, 242, 240, 239, 238, 237, 236, 234, 233, 232, 231, 230, 229, 228, 227, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 210, 209, 208, 207, 206, 205, 204, 203, 202, 202, 201, 200, 199, 198, 197, 197, 196, 195, 194, 193, 193, 192, 191, 190, 189, 189, 188, 187, 187 }, /* 188 */ { 188, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 250, 249, 248, 247, 245, 244, 243, 242, 240, 239, 238, 237, 236, 235, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 222, 221, 220, 219, 218, 217, 216, 215, 214, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 198, 198, 197, 196, 195, 194, 194, 193, 192, 191, 190, 190, 189, 188, 188 }, /* 189 */ { 189, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 245, 244, 243, 242, 240, 239, 238, 237, 236, 235, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 205, 204, 203, 202, 201, 200, 199, 199, 198, 197, 196, 195, 195, 194, 193, 192, 192, 191, 190, 189, 189 }, /* 190 */ { 190, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 245, 244, 243, 242, 241, 239, 238, 237, 236, 235, 234, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 207, 206, 205, 204, 203, 202, 201, 201, 200, 199, 198, 197, 196, 196, 195, 194, 193, 193, 192, 191, 190, 190 }, /* 191 */ { 191, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 245, 244, 243, 242, 241, 239, 238, 237, 236, 235, 234, 233, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 209, 208, 207, 206, 205, 204, 203, 202, 202, 201, 200, 199, 198, 197, 197, 196, 195, 194, 194, 193, 192, 191, 191 }, /* 192 */ { 192, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 252, 251, 249, 248, 247, 246, 244, 243, 242, 241, 240, 238, 237, 236, 235, 234, 233, 232, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 211, 210, 209, 208, 207, 206, 205, 204, 204, 203, 202, 201, 200, 199, 199, 198, 197, 196, 195, 195, 194, 193, 192, 192 }, /* 193 */ { 193, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 244, 243, 242, 241, 240, 238, 237, 236, 235, 234, 233, 232, 231, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 213, 212, 211, 210, 209, 208, 207, 206, 205, 205, 204, 203, 202, 201, 200, 200, 199, 198, 197, 196, 196, 195, 194, 193, 193 }, /* 194 */ { 194, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 244, 243, 242, 241, 240, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 206, 205, 204, 203, 202, 201, 201, 200, 199, 198, 197, 197, 196, 195, 194, 194 }, /* 195 */ { 195, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 244, 243, 242, 241, 240, 239, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 224, 223, 222, 221, 220, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 208, 207, 206, 205, 204, 203, 202, 202, 201, 200, 199, 198, 198, 197, 196, 195, 195 }, /* 196 */ { 196, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 245, 243, 242, 241, 240, 239, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 199, 199, 198, 197, 196, 196 }, /* 197 */ { 197, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 245, 243, 242, 241, 240, 239, 238, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 211, 210, 209, 208, 207, 206, 205, 205, 204, 203, 202, 201, 200, 200, 199, 198, 197, 197 }, /* 198 */ { 198, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 245, 243, 242, 241, 240, 239, 238, 237, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 213, 212, 211, 210, 209, 208, 207, 206, 206, 205, 204, 203, 202, 201, 201, 200, 199, 198, 198 }, /* 199 */ { 199, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 249, 248, 247, 246, 245, 243, 242, 241, 240, 239, 238, 237, 236, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 215, 214, 213, 212, 211, 210, 209, 208, 207, 207, 206, 205, 204, 203, 202, 202, 201, 200, 199, 199 }, /* 200 */ { 200, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 242, 241, 240, 239, 238, 237, 236, 235, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 217, 216, 215, 214, 213, 212, 211, 210, 209, 209, 208, 207, 206, 205, 204, 203, 203, 202, 201, 200, 200 }, /* 201 */ { 201, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 242, 241, 240, 239, 238, 237, 236, 235, 234, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 210, 209, 208, 207, 206, 205, 205, 204, 203, 202, 201, 201 }, /* 202 */ { 202, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 230, 229, 228, 227, 226, 225, 224, 223, 222, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 211, 210, 209, 208, 207, 206, 206, 205, 204, 203, 202, 202 }, /* 203 */ { 203, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 243, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 213, 212, 211, 210, 209, 208, 207, 207, 206, 205, 204, 203, 203 }, /* 204 */ { 204, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 252, 251, 250, 248, 247, 246, 245, 244, 243, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 214, 213, 212, 211, 210, 209, 208, 208, 207, 206, 205, 204, 204 }, /* 205 */ { 205, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 243, 242, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 216, 215, 214, 213, 212, 211, 210, 209, 209, 208, 207, 206, 205, 205 }, /* 206 */ { 206, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 243, 242, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 217, 216, 215, 214, 213, 212, 211, 210, 210, 209, 208, 207, 206, 206 }, /* 207 */ { 207, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 248, 247, 246, 245, 244, 243, 242, 241, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 219, 218, 217, 216, 215, 214, 213, 212, 211, 211, 210, 209, 208, 207, 207 }, /* 208 */ { 208, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 247, 246, 245, 244, 243, 242, 241, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 221, 220, 219, 218, 217, 216, 215, 214, 213, 213, 212, 211, 210, 209, 208, 208 }, /* 209 */ { 209, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 247, 246, 245, 244, 243, 242, 241, 240, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 222, 221, 220, 219, 218, 217, 216, 215, 214, 214, 213, 212, 211, 210, 209, 209 }, /* 210 */ { 210, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 247, 246, 245, 244, 243, 242, 241, 240, 239, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 215, 214, 213, 212, 211, 210, 210 }, /* 211 */ { 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 235, 234, 233, 232, 231, 230, 229, 228, 227, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 216, 215, 214, 213, 212, 211, 211 }, /* 212 */ { 212, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 217, 216, 215, 214, 213, 212, 212 }, /* 213 */ { 213, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 219, 218, 217, 216, 215, 214, 213, 213 }, /* 214 */ { 214, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 220, 219, 218, 217, 216, 215, 214, 214 }, /* 215 */ { 215, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 221, 220, 219, 218, 217, 216, 215, 215 }, /* 216 */ { 216, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 222, 221, 220, 219, 218, 217, 216, 216 }, /* 217 */ { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 224, 223, 222, 221, 220, 219, 218, 217, 217 }, /* 218 */ { 218, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 225, 224, 223, 222, 221, 220, 219, 218, 218 }, /* 219 */ { 219, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 227, 226, 225, 224, 223, 222, 221, 220, 219, 219 }, /* 220 */ { 220, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 228, 227, 226, 225, 224, 223, 222, 221, 220, 220 }, /* 221 */ { 221, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 221 }, /* 222 */ { 222, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 222 }, /* 223 */ { 223, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 241, 240, 239, 238, 237, 236, 235, 234, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 223 }, /* 224 */ { 224, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 239, 238, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 224 }, /* 225 */ { 225, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 225 }, /* 226 */ { 226, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 226 }, /* 227 */ { 227, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 227 }, /* 228 */ { 228, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 228 }, /* 229 */ { 229, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 229 }, /* 230 */ { 230, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 230 }, /* 231 */ { 231, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 231 }, /* 232 */ { 232, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 232 }, /* 233 */ { 233, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 233 }, /* 234 */ { 234, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 234 }, /* 235 */ { 235, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 235 }, /* 236 */ { 236, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 236 }, /* 237 */ { 237, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 237 }, /* 238 */ { 238, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 238 }, /* 239 */ { 239, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 239 }, /* 240 */ { 240, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 240 }, /* 241 */ { 241, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 241 }, /* 242 */ { 242, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 242 }, /* 243 */ { 243, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 243 }, /* 244 */ { 244, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 244 }, /* 245 */ { 245, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 245 }, /* 246 */ { 246, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 246 }, /* 247 */ { 247, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 247, 247 }, /* 248 */ { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 248, 248 }, /* 249 */ { 249, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 249, 249 }, /* 250 */ { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 250, 250 }, /* 251 */ { 251, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 251, 251 }, /* 252 */ { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 252, 252 }, /* 253 */ { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 253, 253 }, /* 254 */ { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254 }, /* 255 */ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } }; libgdiplus-6.0.4+dfsg/src/fontfamily-private.h0000644000175000017500000000361013542672033022103 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __FONTFAMILY_PRIVATE_H__ #define __FONTFAMILY_PRIVATE_H__ #include "gdiplus-private.h" struct _FontFamily { struct _FontCollection *collection; FcPattern* pattern; BOOL allocated; short height; short linespacing; short celldescent; short cellascent; }; #include "fontfamily.h" #endif libgdiplus-6.0.4+dfsg/src/metafile.c0000644000175000017500000017021713542674535020065 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "metafile-private.h" #include "solidbrush-private.h" #include "general-private.h" #include "graphics.h" #include "graphics-path-private.h" #include "hatchbrush-private.h" #include "pen.h" //#define DEBUG_METAFILE /* http://wvware.sourceforge.net/caolan/SaveDC.html */ GpStatus gdip_metafile_SaveDC (MetafilePlayContext *context) { #ifdef DEBUG_METAFILE printf ("SaveDC"); #endif /* TODO */ return Ok; } /* http://wvware.sourceforge.net/caolan/SetBkMode.html */ GpStatus gdip_metafile_SetBkMode (MetafilePlayContext *context, DWORD bkMode) { #ifdef DEBUG_METAFILE printf ("SetBkMode %d", bkMode); #endif /* TODO - currently unused elsewhere */ context->bk_mode = bkMode; return Ok; } /* http://wvware.sourceforge.net/caolan/SetMapMode.html */ GpStatus gdip_metafile_SetMapMode (MetafilePlayContext *context, DWORD mode) { GpStatus status; float scale; #ifdef DEBUG_METAFILE printf ("SetMapMode %d", mode); #endif context->map_mode = mode; switch (mode) { case MM_HIENGLISH: /* 1 logical unit == 0.001 inch */ scale = gdip_get_display_dpi () * 0.001; break; case MM_LOENGLISH: /* 1 logical unit == 0.01 inch */ scale = gdip_get_display_dpi () * 0.01; break; case MM_HIMETRIC: /* 1 logical unit == 0.01 mm */ scale = gdip_get_display_dpi () / (MM_PER_INCH * 100); break; case MM_LOMETRIC: /* 1 logical unit == 0.1 mm */ scale = gdip_get_display_dpi () / (MM_PER_INCH * 10); break; case MM_TWIPS: /* 1 logical point == 1/1440 inch (1/20 of a "old" printer point ;-) */ scale = gdip_get_display_dpi () / 1440; break; case MM_TEXT: default: /* 1 logical unit == 1 pixel */ scale = 1.0f; context->map_mode = MM_TEXT; break; case MM_ISOTROPIC: case MM_ANISOTROPIC: /* SetWindowExt will calculate the correct ratio */ return Ok; } /* this isn't cumulative (and we get a lot of "junk" calls) */ GdipSetWorldTransform (context->graphics, &context->matrix); status = GdipScaleWorldTransform (context->graphics, scale, scale, MatrixOrderPrepend); #ifdef DEBUG_METAFILE_2 printf ("\n\tGdipScaleWorldTransform sx %g, sy %g (status %d)", scale, scale, status); #endif return status; } /* http://wvware.sourceforge.net/caolan/SetROP2.html */ GpStatus gdip_metafile_SetROP2 (MetafilePlayContext *context, DWORD rop) { #ifdef DEBUG_METAFILE printf ("SetROP2 %d", rop); #endif /* TODO */ return Ok; } /* http://www.ousob.com/ng/win2api/ng30859.php */ GpStatus gdip_metafile_SetRelabs (MetafilePlayContext *context, DWORD mode) { #ifdef DEBUG_METAFILE printf ("SetRelabs %d", mode); #endif /* TODO */ return Ok; } /* http://wvware.sourceforge.net/caolan/SetPolyFillMode.html */ GpStatus gdip_metafile_SetPolyFillMode (MetafilePlayContext *context, DWORD fillmode) { #ifdef DEBUG_METAFILE printf ("SetPolyFillMode %d", fillmode); #endif switch (fillmode) { case WINDING: context->fill_mode = FillModeWinding; break; default: g_warning ("Unknown fillmode %d, assuming ALTERNATE", fillmode); /* fall through */ case ALTERNATE: context->fill_mode = FillModeAlternate; break; } return Ok; } /* http://wvware.sourceforge.net/caolan/SetStretchBltMode.html */ GpStatus gdip_metafile_SetStretchBltMode (MetafilePlayContext *context, int iStretchMode) { #ifdef DEBUG_METAFILE printf ("SetStretchBltMode %d", iStretchMode); #endif /* TODO */ return Ok; } /* http://wvware.sourceforge.net/caolan/RestoreDC.html */ GpStatus gdip_metafile_RestoreDC (MetafilePlayContext *context) { #ifdef DEBUG_METAFILE printf ("RestoreDC"); #endif /* TODO */ return Ok; } /* http://wvware.sourceforge.net/caolan/SelectObject.html */ GpStatus gdip_metafile_SelectObject (MetafilePlayContext *context, DWORD slot) { // EMF have some stock objects that do not requires creation if (slot & ENHMETA_STOCK_OBJECT) { #ifdef DEBUG_METAFILE printf ("SelectObject stock #%X", slot); #endif switch (slot - ENHMETA_STOCK_OBJECT) { case WHITE_BRUSH: case LTGRAY_BRUSH: case GRAY_BRUSH: case DKGRAY_BRUSH: case BLACK_BRUSH: case NULL_BRUSH: context->selected_brush = slot; break; case WHITE_PEN: case BLACK_PEN: case NULL_PEN: context->selected_pen = slot; break; case OEM_FIXED_FONT: case ANSI_FIXED_FONT: case ANSI_VAR_FONT: case SYSTEM_FONT: case DEVICE_DEFAULT_FONT: case SYSTEM_FIXED_FONT: context->selected_font = slot; break; case DEFAULT_PALETTE: context->selected_palette = slot; break; default: return InvalidParameter; } return Ok; } #ifdef DEBUG_METAFILE printf ("SelectObject %d (out of %d slots)", slot, context->objects_count); #endif if (slot >= context->objects_count) { g_warning ("SelectObject %d, invalid slot number.", slot); return InvalidParameter; } /* FIXME - what's first ? the created object or what's in the slot ? */ switch (context->created.type) { case METAOBJECT_TYPE_EMPTY: /* if nothing is "created" (and not yet selected into a slot) then we "reselect" the object */ switch (context->objects [slot].type) { case METAOBJECT_TYPE_EMPTY: g_warning ("SelectObject %d, no created object, slot empty.", slot); break; case METAOBJECT_TYPE_PEN: context->selected_pen = slot; break; case METAOBJECT_TYPE_BRUSH: context->selected_brush = slot; break; } return Ok; case METAOBJECT_TYPE_PEN: context->selected_pen = slot; break; case METAOBJECT_TYPE_BRUSH: context->selected_brush = slot; break; } context->objects [slot].type = context->created.type; context->objects [slot].ptr = context->created.ptr; context->created.type = METAOBJECT_TYPE_EMPTY; context->created.ptr = NULL; return Ok; } GpStatus gdip_metafile_ModifyWorldTransform (MetafilePlayContext *context, XFORM *lpXform, DWORD iMode) { GpMatrix matrix; GpMatrixOrder order; switch (iMode) { case MWT_IDENTITY: /* This is a reset and it ignores lpXform in this case */ /* we can't use GdipResetWorldTransform as we still want the original parameters */ return GdipSetWorldTransform (context->graphics, &context->matrix); case MWT_LEFTMULTIPLY: order = MatrixOrderPrepend; break; case MWT_RIGHTMULTIPLY: order = MatrixOrderPrepend; break; default: return InvalidParameter; } if (!lpXform) return InvalidParameter; matrix.xx = lpXform->eM11; matrix.yx = lpXform->eM12; matrix.xy = lpXform->eM21; matrix.yy = lpXform->eM22; matrix.x0 = lpXform->eDx; matrix.y0 = lpXform->eDy; return GdipMultiplyWorldTransform (context->graphics, &matrix, order); } /* http://wvware.sourceforge.net/caolan/SetTextAlign.html */ GpStatus gdip_metafile_SetTextAlign (MetafilePlayContext *context, DWORD textalign) { #ifdef DEBUG_METAFILE printf ("SetTextAlign %d", textalign); #endif /* TODO */ return Ok; } /* http://wvware.sourceforge.net/caolan/DeleteObject.html */ GpStatus gdip_metafile_DeleteObject (MetafilePlayContext *context, DWORD slot) { GpStatus status = Ok; MetaObject *obj; if (slot >= context->objects_count) { g_warning ("DeleteObject failure"); return InvalidParameter; } obj = &context->objects [slot]; switch (obj->type) { case METAOBJECT_TYPE_PEN: status = GdipDeletePen ((GpPen*)obj->ptr); break; case METAOBJECT_TYPE_BRUSH: status = GdipDeleteBrush ((GpBrush*)obj->ptr); break; case METAOBJECT_TYPE_EMPTY: break; } #ifdef DEBUG_METAFILE printf ("DeleteObject %d (type %d, ptr %p, status %d)", slot, obj->type, obj->ptr, status); #endif obj->type = METAOBJECT_TYPE_EMPTY; obj->ptr = NULL; return status; } /* http://wvware.sourceforge.net/caolan/SetBkColor.html */ GpStatus gdip_metafile_SetBkColor (MetafilePlayContext *context, DWORD color) { #ifdef DEBUG_METAFILE printf ("SetBkColor %X", color); #endif /* TODO - currently unused elsewhere */ context->bk_color = color; return Ok; } /* http://wvware.sourceforge.net/caolan/SetWindowOrg.html */ GpStatus gdip_metafile_SetWindowOrg (MetafilePlayContext *context, int x, int y) { #ifdef DEBUG_METAFILE printf ("SetWindowOrg X: %d, Y: %d", x, y); #endif /* TODO */ return Ok; } /* http://wvware.sourceforge.net/caolan/SetWindowExt.html */ GpStatus gdip_metafile_SetWindowExt (MetafilePlayContext *context, int height, int width) { GpStatus status; float sx, sy; #ifdef DEBUG_METAFILE printf ("SetWindowExt height %d, width %d", height, width); #endif switch (context->map_mode) { case MM_ISOTROPIC: sx = (float)context->metafile->metafile_header.Width / width; sy = (float)context->metafile->metafile_header.Height / height; /* keeps ratio to 1:1 */ if (sx < sy) sy = sx; break; case MM_ANISOTROPIC: sx = (float)context->metafile->metafile_header.Width / width; sy = (float)context->metafile->metafile_header.Height / height; break; default: /* most cases are handled by SetMapMode */ return Ok; } /* this isn't cumulative (and we get a lot of "junk" calls) */ GdipSetWorldTransform (context->graphics, &context->matrix); status = GdipScaleWorldTransform (context->graphics, sx, sy, MatrixOrderPrepend); #ifdef DEBUG_METAFILE_2 printf ("\n\tGdipScaleWorldTransform sx %g, sy %g (status %d)", sx, sy, status); #endif return status; } /* http://wvware.sourceforge.net/caolan/LineTo.html */ GpStatus gdip_metafile_LineTo (MetafilePlayContext *context, int x, int y) { GpStatus status; #ifdef DEBUG_METAFILE printf ("LineTo %s%d, %d", context->use_path ? "Path " : " ", x, y); #endif if (context->use_path) { status = GdipAddPathLine (context->path, context->current_x, context->current_y, x, y); } else { GpPen *pen = gdip_metafile_GetSelectedPen (context); status = GdipDrawLine (context->graphics, pen, context->current_x, context->current_y, x, y); } context->current_x = x; context->current_y = y; return status; } /* http://wvware.sourceforge.net/caolan/MoveTo.html */ GpStatus gdip_metafile_MoveTo (MetafilePlayContext *context, int x, int y) { #ifdef DEBUG_METAFILE printf ("MoveTo X: %d, Y: %d", x, y); #endif /* seems to always be called before Arc but, according to documentation, Arc doesn't depend on the current cursor position */ context->current_x = x; context->current_y = y; return Ok; } GpStatus gdip_metafile_SetMiterLimit (MetafilePlayContext *context, float eNewLimit, float *peOldLimit) { if (peOldLimit) *peOldLimit = context->miter_limit; /* GDI+ keeps the miter limit with it's pen, not the context, definition */ context->miter_limit = eNewLimit; return Ok; } /* http://wvware.sourceforge.net/caolan/CreatePenIndirect.html */ GpStatus gdip_metafile_CreatePenIndirect (MetafilePlayContext *context, DWORD style, DWORD width, DWORD color) { LOGBRUSH brush; brush.lbStyle = 0; brush.lbColor = color; brush.lbHatch = 0; return gdip_metafile_ExtCreatePen (context, style, width, &brush, 0, NULL); } GpStatus gdip_metafile_ExtCreatePen (MetafilePlayContext *context, DWORD dwPenStyle, DWORD dwWidth, CONST LOGBRUSH *lplb, DWORD dwStyleCount, CONST DWORD *lpStyle) { /* TODO - there's more cases to consider */ GpStatus status; GpPen *pen = NULL; GpLineCap line_cap = LineCapRound; GpLineJoin line_join = LineJoinRound; int s = dwPenStyle & PS_STYLE_MASK; DWORD color = lplb->lbColor; #ifdef DEBUG_METAFILE printf ("ExtCreatePenIndirect style %d, width %d, color %X", dwPenStyle, dwWidth, color); #endif if (s == PS_NULL) color &= 0x00FFFFFF; else color |= 0xFF000000; status = GdipCreatePen1 (color, dwWidth, UnitPixel, &pen); if (status != Ok) return status; /* The style is always solid for width > 1 */ if (dwWidth > 1) { switch (s) { default: g_warning ("Invalid pen style %d, style & PS_STYLE_MASK %d", dwPenStyle, s); /* fall through */ case PS_NULL: case PS_SOLID: break; case PS_DASH: case PS_DOT: case PS_DASHDOT: case PS_DASHDOTDOT: status = GdipSetPenDashStyle (pen, s); if (status != Ok) { GdipDeletePen (pen); return status; } break; } } /* at this stage we got a pen, so we won't abort drawing on it's style */ s = (dwPenStyle & PS_TYPE_MASK); if (s == PS_GEOMETRIC) { s = (dwPenStyle & PS_ENDCAP_MASK); switch (s) { default: g_warning ("Invalid pen endcap, style %d, (style & PS_ENDCAP_MASK) %d", dwPenStyle, s); /* fall through */ case PS_ENDCAP_ROUND: line_cap = LineCapRound; break; case PS_ENDCAP_SQUARE: line_cap = LineCapSquare; break; case PS_ENDCAP_FLAT: line_cap = LineCapFlat; break; } GdipSetPenStartCap (pen, line_cap); GdipSetPenEndCap (pen, line_cap); s = (dwPenStyle & PS_JOIN_MASK); switch (s) { default: g_warning ("Invalid pen join, style %d, (style & PS_JOIN_MASK) %d", dwPenStyle, s); /* fall through */ case PS_JOIN_ROUND: line_join = LineJoinRound; break; case PS_JOIN_BEVEL: line_join = LineJoinBevel; break; case PS_JOIN_MITER: line_join = LineJoinMiter; break; } GdipSetPenLineJoin (pen, line_join); } context->created.type = METAOBJECT_TYPE_PEN; context->created.ptr = pen; return Ok; } /* http://wvware.sourceforge.net/caolan/CreateBrushIndirect.html */ GpStatus gdip_metafile_CreateBrushIndirect (MetafilePlayContext *context, DWORD style, DWORD color, DWORD hatch) { GpStatus status = Ok; void *brush; switch (style) { case BS_SOLID: color |= 0xFF000000; status = GdipCreateSolidFill (color, (GpSolidFill **) &brush); break; case BS_NULL: color &= 0x00FFFFFF; status = GdipCreateSolidFill (color, (GpSolidFill **) &brush); break; case BS_HATCHED: color |= 0xFF000000; status = GdipCreateHatchBrush (hatch, color, 0xFFFFFFFF, (GpHatch **) &brush); break; default: g_warning ("gdip_metafile_CreateBrushIndirect unimplemented style %d", style); status = GdipCreateSolidFill (color, (GpSolidFill **) &brush); break; } #ifdef DEBUG_METAFILE printf ("CreateBrushIndirect style %d, color %X, hatch %d (%p, status %d)", style, color, hatch, brush, status); #endif context->created.type = METAOBJECT_TYPE_BRUSH; context->created.ptr = brush; return status; } /* http://wvware.sourceforge.net/caolan/Arc.html */ GpStatus gdip_metafile_Arc (MetafilePlayContext *context, int left, int top, int right, int bottom, int xstart, int ystart, int xend, int yend) { #ifdef DEBUG_METAFILE printf ("Arc left %d, top %d, right %d, bottom %d, xstart %d, ystart %d, xend %d, yend %d", left, top, right, bottom, xstart, ystart, xend, yend); #endif /* Don't draw if the width or height are empty. */ if ((right - left <= 0) || (bottom - top <= 0)) return Ok; return GdipDrawArc (context->graphics, gdip_metafile_GetSelectedPen (context), left, top, (right - left), (bottom - top), atan2 (ystart, xstart), atan2 (yend, xend)); } /* http://wvware.sourceforge.net/caolan/Rectangle.html */ GpStatus gdip_metafile_Rectangle (MetafilePlayContext *context, int bottomRect, int rightRect, int topRect, int leftRect) { GpStatus status; int x = min (leftRect, rightRect); int y = min (topRect, bottomRect); int width = abs (rightRect - leftRect); int height = abs (bottomRect - topRect); #ifdef DEBUG_METAFILE printf ("Rectangle bottom %d, right %d, top %d, left %d", bottomRect, rightRect, topRect, leftRect); #endif status = GdipFillRectangleI (context->graphics, gdip_metafile_GetSelectedBrush (context), x, y, width, height); if (status != Ok) return status; return GdipDrawRectangleI (context->graphics, gdip_metafile_GetSelectedPen (context), x, y, width, height); } GpStatus gdip_metafile_SetPixel (MetafilePlayContext *context, DWORD color, int x, int y) { color |= 0xFF000000; GpBrush *fill; GpStatus status = GdipCreateSolidFill (color, (GpSolidFill **) &fill); if (status != Ok) return status; status = GdipFillRectangle (context->graphics, fill, x, y, 1, 1); GdipDeleteBrush (fill); return status; } /* http://wvware.sourceforge.net/caolan/ora-wmf.html */ GpStatus gdip_metafile_StretchDIBits (MetafilePlayContext *context, int XDest, int YDest, int nDestWidth, int nDestHeight, int XSrc, int YSrc, int nSrcWidth, int nSrcHeight, CONST void *lpBits, CONST BITMAPINFO *lpBitsInfo, UINT iUsage, DWORD dwRop) { GpStatus status = OutOfMemory; GpImage *image = NULL; MemorySource ms; #ifdef DEBUG_METAFILE printf ("StretchDIBits\n\t[XDest %d, YDest %d, nDestWidth %d, nDestHeight %d]", XDest, YDest, nDestWidth, nDestHeight); printf ("\n\t[XSrc %d, YSrc %d, nSrcWidth %d, nSrcHeight %d]", XSrc, YSrc, nSrcWidth, nSrcHeight); printf ("\n\tlpBits %p, lpBitsInfo %p, iUsage %d, dwRop %d", lpBits, lpBitsInfo, iUsage, dwRop); printf ("\n\tBITMAPINFO\n\t\tSize: %d", lpBitsInfo->bmiHeader.biSize); printf ("\n\t\tWidth: %d", lpBitsInfo->bmiHeader.biWidth); printf ("\n\t\tHeight: %d", lpBitsInfo->bmiHeader.biHeight); printf ("\n\t\tPlanes: %d", lpBitsInfo->bmiHeader.biPlanes); printf ("\n\t\tBitCount: %d", lpBitsInfo->bmiHeader.biBitCount); printf ("\n\t\tCompression: %d", lpBitsInfo->bmiHeader.biCompression); printf ("\n\t\tSizeImage: %d", lpBitsInfo->bmiHeader.biSizeImage); printf ("\n\t\tXPelsPerMeter: %d", lpBitsInfo->bmiHeader.biXPelsPerMeter); printf ("\n\t\tYPelsPerMeter: %d", lpBitsInfo->bmiHeader.biXPelsPerMeter); printf ("\n\t\tClrUsed: %d", lpBitsInfo->bmiHeader.biClrUsed); printf ("\n\t\tClrImportant: %d", lpBitsInfo->bmiHeader.biClrImportant); #endif ms.ptr = (BYTE*)lpBitsInfo; if (lpBitsInfo->bmiHeader.biCompression == BI_RGB) { // Per the spec, if compression is RGB ImageSize must be ignored (and it should be zero anyway) // and calculated according to the following formula. ms.size = (floor ((lpBitsInfo->bmiHeader.biWidth * lpBitsInfo->bmiHeader.biPlanes * lpBitsInfo->bmiHeader.biBitCount + 31) / 32) * 4) * abs (lpBitsInfo->bmiHeader.biHeight); } else { ms.size = lpBitsInfo->bmiHeader.biSizeImage; } ms.pos = 0; status = gdip_read_bmp_image (&ms, &image, Memory); if (status == Ok) { status = GdipDrawImageRectRect (context->graphics, image, XDest, YDest, nDestWidth, nDestHeight, XSrc, YSrc, nSrcWidth, nSrcHeight, UnitPixel, NULL, NULL, NULL); } if (image) GdipDisposeImage (image); return status; } /* * Return the selected GDI+ Pen to draw on the metafile or NULL if none is selected/valid. */ GpPen* gdip_metafile_GetSelectedPen (MetafilePlayContext *context) { GpPen *pen; // EMF have some stock objects that do not requires explicit creation if (context->selected_pen & ENHMETA_STOCK_OBJECT) { switch (context->selected_pen - ENHMETA_STOCK_OBJECT) { case WHITE_PEN: if (!context->stock_pen_white) { if (GdipCreatePen1 (0xFFFFFFFF, 0, UnitPixel, &context->stock_pen_white) != Ok) return NULL; } pen = context->stock_pen_white; break; case BLACK_PEN: if (!context->stock_pen_black) { if (GdipCreatePen1 (0xFF000000, 0, UnitPixel, &context->stock_pen_black) != Ok) return NULL; } pen = context->stock_pen_black; break; case NULL_PEN: if (!context->stock_pen_null) { if (GdipCreatePen1 (0x00000000, 0, UnitPixel, &context->stock_pen_null) != Ok) return NULL; } pen = context->stock_pen_null; break; default: return NULL; } } else { if ((context->selected_pen < 0) || (context->selected_pen >= context->objects_count)) { g_warning ("Invalid pen handle %d [0..%d[", context->selected_pen, context->objects_count); return NULL; } if (context->objects [context->selected_pen].type != METAOBJECT_TYPE_PEN) { g_warning ("Wrong object type %d, expected pen (%d)", context->objects [context->selected_pen].type, METAOBJECT_TYPE_PEN); return NULL; } #ifdef DEBUG_METAFILE printf ("\tusing pen #%d (%p)", context->selected_pen, context->objects [context->selected_pen].ptr); #endif pen = (GpPen*) context->objects [context->selected_pen].ptr; } /* miter limit was global (i.e. context not pen specific) in GDI */ GdipSetPenMiterLimit (pen, context->miter_limit); return pen; } /* * Return the selected GDI+ Brush to fill on the metafile or NULL if none is selected/valid. */ GpBrush* gdip_metafile_GetSelectedBrush (MetafilePlayContext *context) { // EMF have some stock objects that do not requires explicit creation if (context->selected_brush & ENHMETA_STOCK_OBJECT) { switch (context->selected_brush - ENHMETA_STOCK_OBJECT) { case WHITE_BRUSH: if (!context->stock_brush_white) { if (GdipCreateSolidFill (0xFFFFFFFF, &context->stock_brush_white) != Ok) return NULL; } return (GpBrush*)context->stock_brush_white; case LTGRAY_BRUSH: if (!context->stock_brush_ltgray) { if (GdipCreateSolidFill (0xFFBBBBBB, &context->stock_brush_ltgray) != Ok) return NULL; } return (GpBrush*)context->stock_brush_ltgray; case GRAY_BRUSH: if (!context->stock_brush_gray) { if (GdipCreateSolidFill (0xFF888888, &context->stock_brush_gray) != Ok) return NULL; } return (GpBrush*)context->stock_brush_gray; case DKGRAY_BRUSH: if (!context->stock_brush_dkgray) { if (GdipCreateSolidFill (0xFF444444, &context->stock_brush_dkgray) != Ok) return NULL; } return (GpBrush*)context->stock_brush_dkgray; case BLACK_BRUSH: if (!context->stock_brush_black) { if (GdipCreateSolidFill (0xFF000000, &context->stock_brush_black) != Ok) return NULL; } return (GpBrush*)context->stock_brush_black; case NULL_BRUSH: if (!context->stock_brush_null) { if (GdipCreateSolidFill (0x00000000, &context->stock_brush_null) != Ok) return NULL; } return (GpBrush*)context->stock_brush_null; default: return NULL; } } if ((context->selected_brush < 0) || (context->selected_brush >= context->objects_count)) { g_warning ("Invalid brush handle %d [0..%d[", context->selected_brush, context->objects_count); return NULL; } if (context->objects [context->selected_brush].type != METAOBJECT_TYPE_BRUSH) { g_warning ("Wrong object type %d, expected brush (%d)", context->objects [context->selected_brush].type, METAOBJECT_TYPE_BRUSH); return NULL; } #ifdef DEBUG_METAFILE printf ("\tusing brush #%d (%p)", context->selected_brush, context->objects [context->selected_brush].ptr); #endif return (GpBrush*) context->objects [context->selected_brush].ptr; } GpStatus gdip_metafile_PolyBezier (MetafilePlayContext *context, GpPointF *points, int count) { GpStatus status; #ifdef DEBUG_METAFILE printf ("PolyBezier %s count %d", context->use_path ? "Path " : " ", count); #endif if (context->use_path) { status = GdipAddPathBeziers (context->path, points, count); } else { GpPen *pen = gdip_metafile_GetSelectedPen (context); return GdipDrawCurve (context->graphics, pen, points, count); } return status; } GpStatus gdip_metafile_Polygon (MetafilePlayContext *context, GpPointF *points, int count) { #ifdef DEBUG_METAFILE printf ("Polygon %s count %d", context->use_path ? "Path " : " ", count); #endif GpBrush *brush = gdip_metafile_GetSelectedBrush (context); GpStatus status = GdipFillPolygon (context->graphics, brush, points, count, context->fill_mode); if (status == Ok) { GpPen *pen = gdip_metafile_GetSelectedPen (context); status = GdipDrawPolygon (context->graphics, pen, points, count); } return status; } GpStatus gdip_metafile_BeginPath (MetafilePlayContext *context) { GpStatus status; if (context->path) { GdipDeletePath (context->path); context->path = NULL; } context->use_path = TRUE; status = GdipCreatePath (0, &context->path); #ifdef DEBUG_METAFILE printf ("BeginPath %p", context->path); #endif return status; } GpStatus gdip_metafile_EndPath (MetafilePlayContext *context) { #ifdef DEBUG_METAFILE printf ("EndPath %p", context->path); #endif context->use_path = FALSE; return Ok; } GpStatus gdip_metafile_CloseFigure (MetafilePlayContext *context) { #ifdef DEBUG_METAFILE printf ("CloseFigure %p", context->path); #endif return GdipClosePathFigures (context->path); } GpStatus gdip_metafile_FillPath (MetafilePlayContext *context) { #ifdef DEBUG_METAFILE printf ("FillPath %p", context->path); #endif GpBrush* brush = gdip_metafile_GetSelectedBrush (context); /* end path if required */ if (context->use_path) gdip_metafile_EndPath (context); return GdipFillPath (context->graphics, brush, context->path); } GpStatus gdip_metafile_StrokePath (MetafilePlayContext *context) { #ifdef DEBUG_METAFILE printf ("StrokePath %p", context->path); #endif GpPen *pen = gdip_metafile_GetSelectedPen (context); /* end path if required */ if (context->use_path) gdip_metafile_EndPath (context); return GdipDrawPath (context->graphics, pen, context->path); } GpStatus gdip_metafile_StrokeAndFillPath (MetafilePlayContext *context) { GpBrush *brush; GpStatus status; #ifdef DEBUG_METAFILE printf ("StrokeAndFillPath %p", context->path); #endif /* end path if required */ if (context->use_path) gdip_metafile_EndPath (context); brush = gdip_metafile_GetSelectedBrush (context); status = GdipFillPath (context->graphics, brush, context->path); if (status == Ok) { GpPen *pen = gdip_metafile_GetSelectedPen (context); status = GdipDrawPath (context->graphics, pen, context->path); } return status; } static GpMetafile* gdip_metafile_create () { GpMetafile* mf = (GpMetafile*) GdipAlloc (sizeof (GpMetafile)); if (mf) { memset (&mf->base, 0, sizeof (GpImage)); mf->base.type = ImageTypeMetafile; mf->delete = FALSE; mf->data = NULL; mf->length = 0; mf->recording = FALSE; mf->fp = NULL; mf->stream = NULL; } return mf; } GpStatus gdip_metafile_clone (GpMetafile *metafile, GpMetafile **clonedmetafile) { GpStatus status; GpMetafile *mf = gdip_metafile_create (); GpImage *base; if (!mf) return OutOfMemory; status = gdip_bitmap_clone (&metafile->base, &base); if (status != Ok) { GdipFree (mf); return status; } status = gdip_bitmap_setactive (base, NULL, 0); if (status != Ok) { GdipFree (mf); GdipFree (base); return status; } mf->base = *base; memcpy (&mf->metafile_header, &metafile->metafile_header, sizeof (MetafileHeader)); if (metafile->length > 0) { mf->data = GdipAlloc (metafile->length); if (!mf->data) { GdipFree (mf); return OutOfMemory; } memcpy (mf->data, metafile->data, metafile->length); mf->length = metafile->length; } *clonedmetafile = mf; return Ok; } GpStatus gdip_metafile_dispose (GpMetafile *metafile) { if (!metafile) return InvalidParameter; /* TODO deal with "delete" flag */ metafile->length = 0; if (metafile->data) { GdipFree (metafile->data); metafile->data = NULL; } if (metafile->recording) gdip_metafile_stop_recording (metafile); GdipFree (metafile); return Ok; } GpStatus gdip_get_bitmap_from_metafile (GpMetafile *metafile, INT width, INT height, GpImage **thumbnail) { if (width <= 0 || height <= 0) { switch (metafile->metafile_header.Type) { case MetafileTypeWmfPlaceable: case MetafileTypeWmf: { width = iround (metafile->metafile_header.Width / 1000.0f * gdip_get_display_dpi()); height = iround (metafile->metafile_header.Height / 1000.0f * gdip_get_display_dpi()); break; } case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: { width = metafile->metafile_header.Width; height = metafile->metafile_header.Height; break; } default: return GenericError; } } return GdipGetImageThumbnail ((GpImage *) metafile, width, height, thumbnail, NULL, NULL); } GpStatus gdip_metafile_stop_recording (GpMetafile *metafile) { /* TODO save current stuff */ if (metafile->fp) { fclose (metafile->fp); metafile->fp = NULL; } if (metafile->stream) { /* it's not ours to close, just forget about it */ metafile->stream = NULL; } /* we cannot open a new graphics instance on this metafile - recording is over */ metafile->recording = FALSE; return Ok; } MetafilePlayContext* gdip_metafile_play_setup (GpMetafile *metafile, GpGraphics *graphics, int x, int y, int width, int height) { int i; MetaObject *obj; MetafilePlayContext *context; float scaleX; float scaleY; float translateX; float translateY; /* metafiles always render as 32bppRgb */ if (!metafile || !graphics) return NULL; context = GdipAlloc (sizeof (MetafilePlayContext)); if (!context) { return NULL; } context->metafile = metafile; context->graphics = graphics; context->use_path = FALSE; context->path = NULL; /* keep a copy for clean up */ GdipGetWorldTransform (graphics, &context->initial); #ifdef DEBUG_METAFILE MetafileHeader *mh = &metafile->metafile_header; GpMatrix *m = &context->initial; g_warning ("\nMetafileHeader X %d, Y %d, W %d, H %d", mh->X, mh->Y, mh->Width, mh->Height); g_warning ("\n\tinitial matrix %g %g %g %g %g %g", m->xx, m->yx, m->xy, m->yy, m->x0, m->y0); #endif context->x = x; context->y = y; context->width = width; context->height = height; /* and keep an adjusted copy for providing "resets" */ scaleX = (float) width / (float) metafile->metafile_header.Width; scaleY = (float) height / (float) metafile->metafile_header.Height; GdipScaleWorldTransform (graphics, scaleX, scaleY, MatrixOrderPrepend); translateX = -metafile->metafile_header.X + x / scaleX; translateY = -metafile->metafile_header.Y + y / scaleY; GdipTranslateWorldTransform (graphics, translateX, translateY, MatrixOrderPrepend); GdipGetWorldTransform (graphics, &context->matrix); /* defaults */ context->fill_mode = FillModeAlternate; switch (context->metafile->metafile_header.Type) { case MetafileTypeWmfPlaceable: case MetafileTypeWmf: gdip_metafile_SetMapMode (context, MM_TWIPS); break; case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: gdip_metafile_SetMapMode (context, MM_TEXT); break; default: GdipFree (context); return NULL; } context->miter_limit = 10.0f; context->selected_pen = ENHMETA_STOCK_OBJECT + BLACK_PEN; context->selected_brush = ENHMETA_STOCK_OBJECT + WHITE_BRUSH; context->selected_font = -1; context->selected_palette = -1; /* Create* functions store the object here */ context->created.type = METAOBJECT_TYPE_EMPTY; context->created.ptr = NULL; /* stock objects */ context->stock_pen_white = NULL; context->stock_pen_black = NULL; context->stock_pen_null = NULL; context->stock_brush_white = NULL; context->stock_brush_ltgray = NULL; context->stock_brush_gray = NULL; context->stock_brush_dkgray = NULL; context->stock_brush_black = NULL; context->stock_brush_null = NULL; /* SelectObject | DeleteObject works on this array */ switch (context->metafile->metafile_header.Type) { case MetafileTypeWmfPlaceable: case MetafileTypeWmf: context->objects_count = metafile->metafile_header.Header.Wmf.mtNoObjects; break; case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: context->objects_count = metafile->metafile_header.Header.Emf.nHandles + 1; /* 0 is reserved */ break; default: GdipFree (context); return NULL; } context->objects = (MetaObject*) GdipAlloc (context->objects_count * sizeof (MetaObject)); if (!context->objects) { GdipFree (context); return NULL; } obj = context->objects; for (i = 0; i < context->objects_count; i++) { obj->type = METAOBJECT_TYPE_EMPTY; obj->ptr = NULL; obj++; } return context; } GpStatus gdip_metafile_play (MetafilePlayContext *context) { if (!context || !context->metafile) return InvalidParameter; switch (context->metafile->metafile_header.Type) { case MetafileTypeWmfPlaceable: case MetafileTypeWmf: return gdip_metafile_play_wmf (context); case MetafileTypeEmf: return gdip_metafile_play_emf (context); case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: return gdip_metafile_play_emf (context); default: g_warning ("Invalid metafile format %d", context->metafile->metafile_header.Type); break; } return NotImplemented; } GpStatus gdip_metafile_play_cleanup (MetafilePlayContext *context) { if (!context) return InvalidParameter; GdipSetWorldTransform (context->graphics, &context->initial); context->graphics = NULL; if (context->path) { GdipDeletePath (context->path); context->path = NULL; } context->created.type = METAOBJECT_TYPE_EMPTY; context->created.ptr = NULL; if (context->objects) { int i; MetaObject *obj = context->objects; /* free each object */ for (i = 0; i < context->objects_count; i++) { gdip_metafile_DeleteObject (context, i); obj++; } GdipFree (context->objects); context->objects = NULL; } context->selected_pen = -1; context->selected_brush = -1; context->selected_font = -1; context->selected_font = -1; context->selected_palette = -1; /* stock objects */ if (context->stock_pen_white) GdipDeletePen (context->stock_pen_white); if (context->stock_pen_black) GdipDeletePen (context->stock_pen_black); if (context->stock_pen_null) GdipDeletePen (context->stock_pen_null); if (context->stock_brush_white) GdipDeleteBrush ((GpBrush*)context->stock_brush_white); if (context->stock_brush_ltgray) GdipDeleteBrush ((GpBrush*)context->stock_brush_ltgray); if (context->stock_brush_gray) GdipDeleteBrush ((GpBrush*)context->stock_brush_gray); if (context->stock_brush_dkgray) GdipDeleteBrush ((GpBrush*)context->stock_brush_dkgray); if (context->stock_brush_black) GdipDeleteBrush ((GpBrush*)context->stock_brush_black); if (context->stock_brush_null) GdipDeleteBrush ((GpBrush*)context->stock_brush_null); GdipFree (context); return Ok; } static void WmfPlaceableFileHeaderLE (WmfPlaceableFileHeader *wmfPlaceableFileHeader) { #if G_BYTE_ORDER != G_LITTLE_ENDIAN /* header->Key is already adjusted */ wmfPlaceableFileHeader->Hmf = GUINT16_FROM_LE (wmfPlaceableFileHeader->Hmf); wmfPlaceableFileHeader->BoundingBox.Left = GUINT16_FROM_LE (wmfPlaceableFileHeader->BoundingBox.Left); wmfPlaceableFileHeader->BoundingBox.Top = GUINT16_FROM_LE (wmfPlaceableFileHeader->BoundingBox.Top); wmfPlaceableFileHeader->BoundingBox.Right = GUINT16_FROM_LE (wmfPlaceableFileHeader->BoundingBox.Right); wmfPlaceableFileHeader->BoundingBox.Bottom = GUINT16_FROM_LE (wmfPlaceableFileHeader->BoundingBox.Bottom); wmfPlaceableFileHeader->Inch = GUINT16_FROM_LE (wmfPlaceableFileHeader->Inch); wmfPlaceableFileHeader->Reserved = GUINT32_FROM_LE (wmfPlaceableFileHeader->Reserved); wmfPlaceableFileHeader->Checksum = GUINT16_FROM_LE (wmfPlaceableFileHeader->Checksum); #endif } static void MetafileHeaderLE (MetafileHeader *header) { #if G_BYTE_ORDER != G_LITTLE_ENDIAN header->Header.Wmf.mtType = GUINT16_FROM_LE (header->Header.Wmf.mtType); header->Header.Wmf.mtHeaderSize = GUINT16_FROM_LE (header->Header.Wmf.mtHeaderSize); header->Header.Wmf.mtVersion = GUINT16_FROM_LE (header->Header.Wmf.mtVersion); header->Header.Wmf.mtSize = GUINT32_FROM_LE (header->Header.Wmf.mtSize); header->Header.Wmf.mtNoObjects = GUINT16_FROM_LE (header->Header.Wmf.mtNoObjects); header->Header.Wmf.mtMaxRecord = GUINT32_FROM_LE (header->Header.Wmf.mtMaxRecord); header->Header.Wmf.mtNoParameters = GUINT16_FROM_LE (header->Header.Wmf.mtNoParameters); #endif } static void EnhMetaHeaderLE (ENHMETAHEADER3 *emf) { #if G_BYTE_ORDER != G_LITTLE_ENDIAN /* emf->iType is already adjusted */ emf->nSize = GUINT32_FROM_LE (emf->nSize); emf->rclBounds.left = GUINT32_FROM_LE (emf->rclBounds.left); emf->rclBounds.top = GUINT32_FROM_LE (emf->rclBounds.top); emf->rclBounds.right = GUINT32_FROM_LE (emf->rclBounds.right); emf->rclBounds.bottom = GUINT32_FROM_LE (emf->rclBounds.bottom); emf->rclFrame.left = GUINT32_FROM_LE (emf->rclFrame.left); emf->rclFrame.top = GUINT32_FROM_LE (emf->rclFrame.top); emf->rclFrame.right = GUINT32_FROM_LE (emf->rclFrame.right); emf->rclFrame.bottom = GUINT32_FROM_LE (emf->rclFrame.bottom); emf->dSignature = GUINT32_FROM_LE (emf->dSignature); emf->nVersion = GUINT32_FROM_LE (emf->nVersion); emf->nBytes = GUINT32_FROM_LE (emf->nBytes); emf->nRecords = GUINT32_FROM_LE (emf->nRecords); emf->nHandles = GUINT32_FROM_LE (emf->nHandles); emf->sReserved = GUINT32_FROM_LE (emf->sReserved); emf->nDescription = GUINT32_FROM_LE (emf->nDescription); emf->offDescription = GUINT32_FROM_LE (emf->offDescription); emf->nPalEntries = GUINT32_FROM_LE (emf->nPalEntries); emf->szlDevice.cx = GUINT32_FROM_LE (emf->szlDevice.cx); emf->szlDevice.cy = GUINT32_FROM_LE (emf->szlDevice.cy); emf->szlMillimeters.cx = GUINT32_FROM_LE (emf->szlMillimeters.cx); emf->szlMillimeters.cy = GUINT32_FROM_LE (emf->szlMillimeters.cy); #endif } static GpStatus combine_headers (GDIPCONST WmfPlaceableFileHeader *wmfPlaceableFileHeader, MetafileHeader *header) { if (wmfPlaceableFileHeader) { header->Type = MetafileTypeWmfPlaceable; header->X = min (wmfPlaceableFileHeader->BoundingBox.Right, wmfPlaceableFileHeader->BoundingBox.Left); header->Y = min (wmfPlaceableFileHeader->BoundingBox.Top, wmfPlaceableFileHeader->BoundingBox.Bottom); header->Width = abs (wmfPlaceableFileHeader->BoundingBox.Right - wmfPlaceableFileHeader->BoundingBox.Left); header->Height= abs (wmfPlaceableFileHeader->BoundingBox.Bottom - wmfPlaceableFileHeader->BoundingBox.Top); /* The units of a metafile are twips (1/20 of a point). The Inch field contains the number * of twips per inch used to represent the image. There are 1440 twips per inch by default. * Use the default if the placeable header has no twips per inch specified. */ if (wmfPlaceableFileHeader->Inch == 0) header->DpiX = 1440; else header->DpiX = wmfPlaceableFileHeader->Inch; } else { header->Type = MetafileTypeWmf; header->X = 0; header->Y = 0; /* TODO: GDI+ uses screen resolution for non-placeable metafiles */ header->Width = 1280; header->Height= 1024; header->DpiX = gdip_get_display_dpi (); } header->DpiY = header->DpiX; header->Size = header->Header.Wmf.mtSize * 2; header->Version = header->Header.Wmf.mtVersion; header->EmfPlusFlags = 0; header->EmfPlusHeaderSize = 0; header->LogicalDpiX = 0; header->LogicalDpiY = 0; return Ok; } /* Handle the record based headers that can exists in EMF files */ /* Note: GDI+ doesn't report correctly all stuff within the headers :| */ static GpStatus update_emf_header (MetafileHeader *header, BYTE* data, int length) { GpStatus status = Ok; MetafilePlayContext context; GpMetafile mf; if (length < sizeof (DWORD)) return Ok; DWORD *func = (DWORD*)data; switch (*func) { case EMR_HEADER: g_warning ("TODO - EMR_HEADER. Not common, need test case :)"); break; case EMR_GDICOMMENT: /* this could be an embedded EmfPlusRecordTypeHeader */ context.metafile = &mf; context.graphics = NULL; /* special case where we're not playing the metafile */ status = GdiComment (&context, data, length); if (status == Ok) { header->Type = mf.metafile_header.Type; header->Version = mf.metafile_header.Version; /* GDI+ seems to report the object header */ /* Horizontal and Vertical Logical DPI are available but not reported */ } break; } return status; } static GpStatus gdip_read_emf_header_optionals (ENHMETAHEADER3 *header, void *pointer, ImageSource source) { /* This algorithm is taken from the specification: https://msdn.microsoft.com/en-us/library/cc230635.aspx. */ const int HeaderRecordSize = sizeof (ENHMETAHEADER3); const int HeaderExtension1Size = sizeof (ENHMETAHEADER3) + sizeof (HeaderExtension1); /* Initialize header size to minimum. */ int headerSize = HeaderRecordSize; /* Valid header record size? */ if (header->nSize >= HeaderRecordSize) { /* Set HeaderSize to header record size. */ headerSize = header->nSize; /* Valid description values? If so, set HeaderSize to description offset. */ if (header->offDescription >= HeaderRecordSize && (header->offDescription + header->nDescription * 2) <= header->nSize) headerSize = header->offDescription; /* Header big enough to contain an extension? */ if (headerSize >= HeaderExtension1Size) { /* Match GDI+ behaviour where missing header data is set to 0. */ HeaderExtension1 extension; memset (&extension, 0, sizeof (HeaderExtension1)); gdip_read_emf_data (pointer, (BYTE *) &extension, sizeof (HeaderExtension1), source); /* Valid pixel format values? */ if (extension.offPixelFormat >= HeaderExtension1Size && (extension.offPixelFormat + extension.cbPixelFormat) <= header->nSize) { /* Pixel format before description? If so, set HeaderSize to pixel format offset. */ if (extension.offPixelFormat > header->offDescription) headerSize = extension.offPixelFormat; } } } header->nSize = headerSize; return Ok; } static GpStatus gdip_get_metafileheader_from (void *pointer, MetafileHeader *header, ImageSource source) { int size; DWORD key; GpStatus status = NotImplemented; WmfPlaceableFileHeader aldus_header; ENHMETAHEADER3 *emf; /* peek at first DWORD to select the right format */ size = sizeof (DWORD); if (gdip_read_wmf_data (pointer, (void*)&key, size, source) != size) return OutOfMemory; #if G_BYTE_ORDER != G_LITTLE_ENDIAN key = GUINT32_FROM_LE (key); #endif switch (key) { case ALDUS_PLACEABLE_METAFILE_KEY: aldus_header.Key = key; size = sizeof (WmfPlaceableFileHeader) - size; if (gdip_read_wmf_data(pointer, (BYTE*)(&aldus_header) + sizeof(DWORD), size, source) != size) return OutOfMemory; #ifdef DEBUG_METAFILE g_warning ("ALDUS_PLACEABLE_METAFILE key %d, hmf %d, L %d, T %d, R %d, B %d, inch %d, reserved %d, checksum %d", aldus_header.Key, aldus_header.Hmf, aldus_header.BoundingBox.Left, aldus_header.BoundingBox.Top, aldus_header.BoundingBox.Right, aldus_header.BoundingBox.Bottom, aldus_header.Inch, aldus_header.Reserved, aldus_header.Checksum); #endif size = sizeof (METAHEADER); if (gdip_read_wmf_data (pointer, (BYTE*)&header->Header.Wmf, size, source) != size) return OutOfMemory; WmfPlaceableFileHeaderLE (&aldus_header); MetafileHeaderLE (header); if (header->Header.Wmf.mtType != 1 && header->Header.Wmf.mtType != 2) return OutOfMemory; if (header->Header.Wmf.mtHeaderSize != 9) return OutOfMemory; if (header->Header.Wmf.mtVersion != 0x0100 && header->Header.Wmf.mtVersion != 0x0300) return OutOfMemory; status = combine_headers (&aldus_header, header); break; case WMF_TYPE_AND_HEADERSIZE_KEY: memcpy (&header->Header.Wmf, &key, size); size = sizeof (METAHEADER) - size; if (gdip_read_wmf_data (pointer, (BYTE*)(&header->Header.Wmf) + sizeof(DWORD), size, source) != size) return InvalidParameter; MetafileHeaderLE (header); status = combine_headers (NULL, header); break; case EMF_EMR_HEADER_KEY: emf = &header->Header.Emf; emf->iType = key; /* Match GDI+ behaviour where missing header data is set to 0. */ size = sizeof (ENHMETAHEADER3) - size; memset ((BYTE *) emf + sizeof (DWORD), 0, size); gdip_read_emf_data (pointer, (BYTE *) emf + sizeof (DWORD), size, source); EnhMetaHeaderLE (&header->Header.Emf); #ifdef DEBUG_METAFILE g_warning ("EMF HEADER iType %d, nSize %d, Bounds L %d, T %d, R %d, B %d, Frame L %d, T %d, R %d, B %d, signature %X, version %d, bytes %d, records %d, handles %d, reserved %d, description %d, %d, palentries %d, device %d, %d, millimeters %d, %d", emf->iType, emf->nSize, emf->rclBounds.left, emf->rclBounds.top, emf->rclBounds.right, emf->rclBounds.bottom, emf->rclFrame.left, emf->rclFrame.top, emf->rclFrame.right, emf->rclFrame.bottom, emf->dSignature, emf->nVersion, emf->nBytes, emf->nRecords, emf->nHandles, emf->sReserved, emf->nDescription, emf->offDescription, emf->nPalEntries, emf->szlDevice.cx, emf->szlDevice.cy, emf->szlMillimeters.cx, emf->szlMillimeters.cy); #endif if ((emf->iType != 1) || (emf->dSignature != 0x464D4520)) return OutOfMemory; if (emf->nRecords < 2) return OutOfMemory; if (emf->nHandles == 0) return OutOfMemory; if (emf->nBytes < emf->nSize || emf->nBytes & 3) return OutOfMemory; if (emf->szlDevice.cx == 0 || emf->szlDevice.cy == 0) return OutOfMemory; if (emf->szlMillimeters.cx == 0 || emf->szlMillimeters.cy == 0) return OutOfMemory; header->Type = MetafileTypeEmf; /* Convert millimetres to inches to get the DPI for each dimension. */ header->DpiX = emf->szlDevice.cx / (emf->szlMillimeters.cx / MM_PER_INCH); header->DpiY = emf->szlDevice.cy / (emf->szlMillimeters.cy / MM_PER_INCH); /* The bounding box of the metafile is derived from rclFrame, not rclBounds. * We need to perform some unit conversions from 100s of millimetres to pixels. */ REAL inchLeft = emf->rclFrame.left / (MM_PER_INCH * 100); REAL inchTop = emf->rclFrame.top / (MM_PER_INCH * 100); REAL inchRight = emf->rclFrame.right / (MM_PER_INCH * 100); REAL inchBottom = emf->rclFrame.bottom / (MM_PER_INCH * 100); header->X = iround (inchLeft * header->DpiX); header->Y = iround (inchTop * header->DpiY); /* The frame is inclusive, so we need to add 1. */ header->Width = iround ((inchRight - inchLeft) * header->DpiX) + 1; header->Height = iround ((inchBottom - inchTop) * header->DpiY) + 1; header->Size = emf->nBytes; header->Version = emf->nVersion; /* We need to check for the EmfHeader record (can't be done at this stage) but some files still returns * invalid values. E.g. Files with "strange" bounds also have insanely large EmfPlusHeaderSize and logical * DPI values (with MS GDI+) */ header->EmfPlusFlags = 0; header->EmfPlusHeaderSize = 0; header->LogicalDpiX = 0; header->LogicalDpiY = 0; status = gdip_read_emf_header_optionals (emf, pointer, source); break; default: status = OutOfMemory; } #ifdef DEBUG_METAFILE g_warning ("METAHEADER type %d, header %d, version %d, size %d, #obj %d, max rec %d, #params %d", header->Header.Wmf.mtType, header->Header.Wmf.mtHeaderSize, header->Header.Wmf.mtVersion, header->Header.Wmf.mtSize, header->Header.Wmf.mtNoObjects, header->Header.Wmf.mtMaxRecord, header->Header.Wmf.mtNoParameters); #endif return status; } GpStatus gdip_get_metafile_from (void *pointer, GpMetafile **metafile, ImageSource source) { BOOL adjust_emf_headers = FALSE; GpStatus status = OutOfMemory; GpMetafile *mf = gdip_metafile_create (); if (!mf) goto error; /* decode metafile header */ status = gdip_get_metafileheader_from (pointer, &mf->metafile_header, source); if (status != Ok) goto error; switch (mf->metafile_header.Type) { case MetafileTypeWmfPlaceable: case MetafileTypeWmf: mf->base.image_format = WMF; /* note: mtSize is in WORD, mtSize contains the METAHEADER, mf->length is in bytes */ mf->length = mf->metafile_header.Header.Wmf.mtSize * 2 - sizeof (METAHEADER); /* The file size has to be enough for an EOF record. */ if (mf->length == 0) { if (mf->metafile_header.Header.Wmf.mtMaxRecord != 3) { status = OutOfMemory; goto error; } } else if (mf->length <= 4) { status = OutOfMemory; goto error; } break; case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: mf->base.image_format = EMF; mf->length = mf->metafile_header.Header.Emf.nBytes - mf->metafile_header.Header.Emf.nSize; adjust_emf_headers = TRUE; break; default: status = GenericError; goto error; } mf->data = (BYTE*) GdipAlloc (mf->length); if (!mf->data) goto error; /* Copy the data into memory for playback later. To match GDI+ behaviour, we don't validate that there is * as much data as the header says. Instead, if the data length is invalid and there is no EOF record before * we run out of space in the buffer playback will fail. */ mf->length = gdip_read_wmf_data (pointer, (void *) mf->data, mf->length, source); if (adjust_emf_headers) { /* if the first EMF record is an EmfHeader (or an Header inside a Comment) then we have extra data to extract */ status = update_emf_header (&mf->metafile_header, mf->data, mf->length); if (status != Ok) goto error; } *metafile = mf; return Ok; error: if (mf) gdip_metafile_dispose (mf); *metafile = NULL; return status; } /* public (GDI+) functions */ GpStatus GdipCreateMetafileFromFile (GDIPCONST WCHAR *file, GpMetafile **metafile) { FILE *fp; char *file_name; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!file || !metafile) return InvalidParameter; file_name = (char *) utf16_to_utf8 ((const gunichar2 *)file, -1); if (!file_name) return InvalidParameter; fp = fopen (file_name, "rb"); if (!fp) { GdipFree (file_name); return GenericError; } /* Match GDI+ behaviour by either returning Ok or GenericError. */ status = gdip_get_metafile_from (fp, metafile, File); if (status != Ok) status = GenericError; fclose (fp); GdipFree (file_name); return status; } /* * GdipCreateMetafileFromStream will never be implemented, as 'stream' is a COM IStream ... */ GpStatus GdipCreateMetafileFromStream (void *stream, GpMetafile **metafile) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!stream || !metafile) return InvalidParameter; return NotImplemented; } /* * instead we'll use delegates to load the metafile header with this function */ GpStatus GdipCreateMetafileFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpMetafile **metafile) { GpStatus status = InvalidParameter; dstream_t *loader; if (!metafile) return InvalidParameter; loader = dstream_input_new (getBytesFunc, seekFunc); if (loader) { status = gdip_get_metafile_from (loader, metafile, DStream); dstream_free (loader); } return status; } GpStatus GdipCreateMetafileFromEmf (HENHMETAFILE hEmf, BOOL deleteEmf, GpMetafile **metafile) { GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!hEmf || !metafile) return InvalidParameter; switch (((GpMetafile *) hEmf)->metafile_header.Type) { case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: status = gdip_metafile_clone ((GpMetafile*)hEmf, metafile); if (status != Ok) return status; (*metafile)->delete = deleteEmf; return Ok; case MetafileTypeWmfPlaceable: case MetafileTypeWmf: default: *metafile = NULL; return GenericError; } } GpStatus GdipCreateMetafileFromWmf (HMETAFILE hWmf, BOOL deleteWmf, GDIPCONST WmfPlaceableFileHeader *wmfPlaceableFileHeader, GpMetafile **metafile) { GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!hWmf || !metafile) return InvalidParameter; status = gdip_metafile_clone ((GpMetafile*)hWmf, metafile); if (status != Ok) return status; switch ((*metafile)->metafile_header.Type) { case MetafileTypeWmfPlaceable: case MetafileTypeWmf: if (wmfPlaceableFileHeader) { status = GdipGetMetafileHeaderFromWmf (hWmf, wmfPlaceableFileHeader, &(*metafile)->metafile_header); if (status != Ok) { GdipFree (*metafile); return status; } } (*metafile)->delete = deleteWmf; return Ok; case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: default: GdipFree (*metafile); *metafile = NULL; return GenericError; } } GpStatus GdipGetMetafileHeaderFromWmf (HMETAFILE hWmf, GDIPCONST WmfPlaceableFileHeader *wmfPlaceableFileHeader, MetafileHeader *header) { GpMetafile *mf; if (!hWmf || !wmfPlaceableFileHeader || !header) return InvalidParameter; mf = (GpMetafile*)hWmf; memcpy (header, &mf->metafile_header, sizeof (MetafileHeader)); return combine_headers (wmfPlaceableFileHeader, header); } GpStatus GdipGetMetafileHeaderFromEmf (HENHMETAFILE hEmf, MetafileHeader *header) { GpMetafile* metafile = (GpMetafile*)hEmf; if (!metafile || !header) return InvalidParameter; switch (metafile->metafile_header.Type) { case MetafileTypeEmf: case MetafileTypeEmfPlusOnly: case MetafileTypeEmfPlusDual: return GdipGetMetafileHeaderFromMetafile (metafile, header); /* you can get a HENHMETAFILE from a WMF metafile but it seems (unit tests) that you can't use it as such */ case MetafileTypeWmfPlaceable: case MetafileTypeWmf: default: return InvalidParameter; } } GpStatus GdipGetMetafileHeaderFromFile (GDIPCONST WCHAR *filename, MetafileHeader *header) { FILE *fp; char *file_name; GpStatus status = InvalidParameter; if (!filename || !header) return InvalidParameter; file_name = (char *) utf16_to_utf8 ((const gunichar2 *)filename, -1); if (!file_name) return InvalidParameter; fp = fopen (file_name, "rb"); if (fp) { status = gdip_get_metafileheader_from (fp, header, File); /* if EMF check for additional header record */ if (header->Type == MetafileTypeEmf) { /* look for more details, possibly upgrading the metafile to MetafileTypeEmfPlusOnly or EMFPLUSDUAL */ /* TODO */ } fclose (fp); } GdipFree (file_name); return status; } /* * GdipGetMetafileHeaderFromStream will never be implemented, as 'stream' is a COM IStream ... */ GpStatus GdipGetMetafileHeaderFromStream (void *stream, MetafileHeader *header) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!stream || !header) return InvalidParameter; return NotImplemented; } /* * instead we'll use delegates to load the metafile header with this function */ GpStatus GdipGetMetafileHeaderFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, MetafileHeader *header) { GpStatus status = InvalidParameter; dstream_t *loader; if (!header) return status; loader = dstream_input_new (getBytesFunc, seekFunc); if (loader) { status = gdip_get_metafileheader_from (loader, header, DStream); /* if EMF check for additional header record */ if (header->Type == MetafileTypeEmf) { /* look for more details, possibly upgrading the metafile to MetafileTypeEmfPlusOnly or EMFPLUSDUAL */ /* TODO */ } dstream_free (loader); } return status; } GpStatus GdipGetMetafileHeaderFromMetafile (GpMetafile *metafile, MetafileHeader *header) { if (!metafile || !header) return InvalidParameter; memcpy (header, &metafile->metafile_header, sizeof (MetafileHeader)); return Ok; } GpStatus GdipGetHemfFromMetafile (GpMetafile *metafile, HENHMETAFILE *hEmf) { if (!metafile || !hEmf) return InvalidParameter; *hEmf = (HENHMETAFILE)metafile; return Ok; } GpStatus GdipGetMetafileDownLevelRasterizationLimit (GpMetafile *metafile, UINT *metafileRasterizationLimitDpi) { if (!metafile || !metafileRasterizationLimitDpi) return InvalidParameter; switch (metafile->metafile_header.Type) { case MetafileTypeEmf: case MetafileTypeEmfPlusDual: /* TODO */ *metafileRasterizationLimitDpi = 0; return Ok; case MetafileTypeWmfPlaceable: case MetafileTypeWmf: case MetafileTypeEmfPlusOnly: default: return WrongState; } } GpStatus GdipSetMetafileDownLevelRasterizationLimit (GpMetafile *metafile, UINT metafileRasterizationLimitDpi) { if (!metafile) return InvalidParameter; switch (metafile->metafile_header.Type) { case MetafileTypeEmf: case MetafileTypeEmfPlusDual: // values less than 10 left resolution unchanged (from GDI+ documentation) if (metafileRasterizationLimitDpi >= 10) { /* TODO */ } return Ok; case MetafileTypeWmfPlaceable: case MetafileTypeWmf: case MetafileTypeEmfPlusOnly: default: return WrongState; } } GpStatus GdipPlayMetafileRecord (GDIPCONST GpMetafile *metafile, EmfPlusRecordType recordType, UINT flags, UINT dataSize, GDIPCONST BYTE* data) { if (!metafile || (dataSize && !data)) return InvalidParameter; /* TODO */ return NotImplemented; } GpStatus GdipRecordMetafile (HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { GpMetafile *mf; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!referenceHdc || !frameRect || !metafile) return InvalidParameter; if ((type < EmfTypeEmfOnly) || (type > EmfTypeEmfPlusDual)) return InvalidParameter; if ((frameUnit < MetafileFrameUnitPixel) || (frameUnit > MetafileFrameUnitGdi)) return InvalidParameter; if (((frameRect->Width == 0) || (frameRect->Height == 0)) && (frameUnit != MetafileFrameUnitGdi)) return GenericError; mf = gdip_metafile_create (); if (!mf) return OutOfMemory; mf->metafile_header.X = frameRect->X; mf->metafile_header.Y = frameRect->Y; mf->metafile_header.Width = frameRect->Width; mf->metafile_header.Height = frameRect->Height; mf->metafile_header.Size = 0; mf->metafile_header.Type = (MetafileType)type; mf->recording = TRUE; /* TODO - more stuff here! */ *metafile = mf; return Ok; } GpStatus GdipRecordMetafileI (HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { GpRectF rect; if (!frameRect) return InvalidParameter; rect.X = frameRect->X; rect.Y = frameRect->Y; rect.Width = frameRect->Width; rect.Height = frameRect->Height; return GdipRecordMetafile (referenceHdc, type, (GDIPCONST GpRectF*) &rect, frameUnit, description, metafile); } GpStatus GdipRecordMetafileFileName (GDIPCONST WCHAR *fileName, HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { GpStatus status; GpMetafile *mf = NULL; char *file_name; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!fileName) return InvalidParameter; file_name = (char *) utf16_to_utf8 ((const gunichar2 *)fileName, -1); if (!file_name) { *metafile = NULL; return InvalidParameter; } status = GdipRecordMetafile (referenceHdc, type, frameRect, frameUnit, description, &mf); if (status != Ok) { GdipFree (file_name); return status; } /* yep, an existing file is overwritten */ mf->fp = fopen (file_name, "wb"); GdipFree (file_name); *metafile = mf; return Ok; } GpStatus GdipRecordMetafileFileNameI (GDIPCONST WCHAR *fileName, HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { GpRectF rect; if (!frameRect) return InvalidParameter; rect.X = frameRect->X; rect.Y = frameRect->Y; rect.Width = frameRect->Width; rect.Height = frameRect->Height; return GdipRecordMetafileFileName (fileName, referenceHdc, type, (GDIPCONST GpRectF*) &rect, frameUnit, description, metafile); } /* * GdipRecordMetafileStream and GdipRecordMetafileStreamI will never be implemented, as 'stream' is a COM IStream ... */ GpStatus GdipRecordMetafileStream (void /* IStream */ *stream, HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { if (!gdiplusInitialized) return GdiplusNotInitialized; return NotImplemented; } GpStatus GdipRecordMetafileStreamI (void /* IStream */ *stream, HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { return NotImplemented; } /* * instead we'll use delegates to create the metafile header with these functions */ GpStatus GdipRecordMetafileFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { GpStatus status; if (!putBytesFunc) return InvalidParameter; status = GdipRecordMetafile (referenceHdc, type, frameRect, frameUnit, description, metafile); if (status != Ok) return status; /* TODO - keep delegates around to write stuff */ return Ok; } GpStatus GdipRecordMetafileFromDelegateI_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile) { GpRectF rect; if (!frameRect) return InvalidParameter; rect.X = frameRect->X; rect.Y = frameRect->Y; rect.Width = frameRect->Width; rect.Height = frameRect->Height; return GdipRecordMetafileFromDelegate_linux (getHeaderFunc, getBytesFunc, putBytesFunc, seekFunc, closeFunc, sizeFunc, referenceHdc, type, (GDIPCONST GpRectF*) &rect, frameUnit, description, metafile); } libgdiplus-6.0.4+dfsg/src/brush.h0000644000175000017500000000301713233636545017414 0ustar directhexdirecthex/* * 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. * * Authors: * Ravindra (rkumar@novell.com) * * Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef __BRUSH_H__ #define __BRUSH_H__ typedef struct _InterpolationColors { ARGB* colors; float *positions; int count; } InterpolationColors; GpStatus WINGDIPAPI GdipCloneBrush (GpBrush *brush, GpBrush **clonedBrush); GpStatus WINGDIPAPI GdipDeleteBrush (GpBrush *brush); GpStatus WINGDIPAPI GdipGetBrushType (GpBrush *brush, GpBrushType *type); #endif libgdiplus-6.0.4+dfsg/src/graphics-path-private.h0000644000175000017500000000420713542674535022501 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __GRAPHICS_PATH_PRIVATE_H__ #define __GRAPHICS_PATH_PRIVATE_H__ #include "gdiplus-private.h" #include "graphics-private.h" #include "stringformat-private.h" typedef struct _Path { FillMode fill_mode; int count; int size; BYTE *types; GpPointF *points; BOOL start_new_fig; /* Flag to keep track if we need to start a new figure */ } Path; BOOL gdip_path_has_curve (GpPath *path) GDIP_INTERNAL; BOOL gdip_path_ensure_size (GpPath *path, int size) GDIP_INTERNAL; BOOL gdip_path_closed (GpPath *path) GDIP_INTERNAL; #include "graphics-path.h" #endif libgdiplus-6.0.4+dfsg/src/customlinecap.h0000644000175000017500000000323213542674535021142 0ustar directhexdirecthex/* * customlinecap.h * * Authors: * Ravindra (rkumar@novell.com) * * Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef __CUSTOMLINECAP_H__ #define __CUSTOMLINECAP_H__ /* CustomLineCap functions */ GpStatus WINGDIPAPI GdipCreateCustomLineCap (GpPath *fillPath, GpPath *strokePath, GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap); GpStatus WINGDIPAPI GdipDeleteCustomLineCap (GpCustomLineCap *customCap); GpStatus WINGDIPAPI GdipCloneCustomLineCap (GpCustomLineCap *customCap, GpCustomLineCap **clonedCap); GpStatus WINGDIPAPI GdipGetCustomLineCapType (GpCustomLineCap *customCap, CustomLineCapType *capType); GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps (GpCustomLineCap *customCap, GpLineCap startCap, GpLineCap endCap); GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeCaps (GpCustomLineCap *customCap, GpLineCap *startCap, GpLineCap *endCap); GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin (GpCustomLineCap *customCap, GpLineJoin lineJoin); GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin (GpCustomLineCap *customCap, GpLineJoin *lineJoin); GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap (GpCustomLineCap *customCap, GpLineCap baseCap); GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap (GpCustomLineCap *customCap, GpLineCap *baseCap); GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset (GpCustomLineCap *customCap, REAL inset); GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset (GpCustomLineCap *customCap, REAL *inset); GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale (GpCustomLineCap *customCap, REAL widthScale); GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale (GpCustomLineCap *customCap, REAL *widthScale); #endif libgdiplus-6.0.4+dfsg/src/hatchbrush.c0000644000175000017500000014532113542674535020430 0ustar directhexdirecthex/* * hatchbrush.c * * Copyright (C) 2004,2006-2007 Novell, Inc. http://www.novell.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. * * Authors: * Ravindra (rkumar@novell.com) * */ /* FIXME - match hatchbrush use the RenderOrigin stored in graphics */ #include "hatchbrush-private.h" #include "general-private.h" #include "graphics-private.h" static GpStatus gdip_hatch_setup (GpGraphics *graphics, GpBrush *brush); static GpStatus gdip_hatch_clone (GpBrush *brush, GpBrush **clonedBrush); static GpStatus gdip_hatch_destroy (GpBrush *brush); /* * We keep a single copy of vtable for * all instances of hatchbrush. */ static BrushClass vtable = { BrushTypeHatchFill, gdip_hatch_setup, gdip_hatch_clone, gdip_hatch_destroy }; static void gdip_hatch_init (GpHatch *hatch) { gdip_brush_init (&hatch->base, &vtable); hatch->backColor = 0; hatch->pattern = NULL; } static GpHatch* gdip_hatch_new (void) { GpHatch *result = (GpHatch *) GdipAlloc (sizeof (GpHatch)); if (result) gdip_hatch_init (result); return result; } /* helper functions */ static cairo_t* create_hatch_context (cairo_surface_t *hatch, cairo_line_cap_t line_cap, BOOL antialias) { cairo_t *ct = cairo_create (hatch); if (cairo_status (ct) != CAIRO_STATUS_SUCCESS) { cairo_destroy (ct); return NULL; } cairo_set_line_cap (ct, line_cap); if (!antialias) cairo_set_antialias (ct, CAIRO_ANTIALIAS_NONE); return ct; } static void set_color (cairo_t *ct, int color, BOOL alpha) { int A = (color & 0xFF000000) >> 24; int R = (color & 0x00FF0000) >> 16; int G = (color & 0x0000FF00) >> 8; int B = (color & 0x000000FF); if (alpha) { cairo_set_source_rgba (ct, (double) R / 255.0, (double) G / 255.0, (double) B / 255.0, (double) A / 255.0); } else { cairo_set_source_rgb (ct, (double) R / 255.0, (double) G / 255.0, (double) B / 255.0); } } static void draw_background (cairo_t *ct, int backcolor, int width, int height, BOOL alpha) { set_color (ct, backcolor, alpha); cairo_rectangle (ct, 0, 0, width, height); cairo_fill (ct); } /* The values used below are obtained by hit and trial to get the results similar to that of MS. */ static const double hatches_const[][3] = { /* HatchStyleHorizontal */ { HATCH_SIZE, HATCH_SIZE, LINE_WIDTH }, /* HatchStyleVertical */ { HATCH_SIZE, HATCH_SIZE, LINE_WIDTH }, /* HatchStyleForwardDiagonal */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleBackwardDiagonal */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleCross */ { HATCH_SIZE + 2.0, HATCH_SIZE + 2.0, LINE_WIDTH }, /* HatchStyleDiagonalCross */ { HATCH_SIZE, HATCH_SIZE, LINE_WIDTH }, /* HatchStyle05Percent */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyle10Percent */ { HATCH_SIZE + 1.0, 4.0, LINE_WIDTH }, /* HatchStyle20Percent */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyle25Percent */ { 4.0, 2.0, LINE_WIDTH }, /* HatchStyle30Percent */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyle40Percent */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyle50Percent */ { 2.0, 2.0, LINE_WIDTH }, /* HatchStyle60Percent */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyle70Percent */ { 4.0, 2.0, LINE_WIDTH }, /* HatchStyle75Percent */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyle80Percent */ { HATCH_SIZE + 1.0, 4.0, LINE_WIDTH }, /* HatchStyle90Percent */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleLightDownwardDiagonal */ { (HATCH_SIZE + 1.0) * 0.5, (HATCH_SIZE + 1.0) * 0.5, LINE_WIDTH }, /* HatchStyleLightUpwardDiagonal */ { (HATCH_SIZE + 1.0) * 0.5, (HATCH_SIZE + 1.0) * 0.5, LINE_WIDTH }, /* HatchStyleDarkDownwardDiagonal */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyleDarkUpwardDiagonal */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyleWideDownwardDiagonal */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH * 2.0 }, /* HatchStyleWideUpwardDiagonal */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH * 2.0 }, /* HatchStyleLightVertical */ { HATCH_SIZE * 0.7, HATCH_SIZE * 0.7, LINE_WIDTH }, /* HatchStyleLightHorizontal */ { HATCH_SIZE * 0.7, HATCH_SIZE * 0.7, LINE_WIDTH }, /* HatchStyleNarrowVertical */ { 2.0, 2.0, LINE_WIDTH }, /* HatchStyleNarrowHorizontal */ { 2.0, 2.0, LINE_WIDTH }, /* HatchStyleDarkVertical */ { HATCH_SIZE * 0.6, HATCH_SIZE * 0.6, LINE_WIDTH * 2.0 }, /* HatchStyleDarkHorizontal */ { HATCH_SIZE * 0.6, HATCH_SIZE * 0.6, LINE_WIDTH * 2.0 }, /* HatchStyleDashedDownwardDiagonal */ { 4.0, 8.0, LINE_WIDTH }, /* HatchStyleDashedUpwardDiagonal */ { 4.0, 8.0, LINE_WIDTH }, /* HatchStyleDashedHorizontal */ { 8.0, 8.0, LINE_WIDTH }, /* HatchStyleDashedVertical */ { 8.0, 8.0, LINE_WIDTH }, /* HatchStyleSmallConfetti */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleLargeConfetti */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleZigZag */ { HATCH_SIZE + 1.0, 4.0, LINE_WIDTH }, /* HatchStyleWave */ { HATCH_SIZE + 2.0, (HATCH_SIZE + 2.0) / 2.0, LINE_WIDTH }, /* HatchStyleDiagonalBrick */ { HATCH_SIZE + 0.0, HATCH_SIZE + 0.0, LINE_WIDTH }, /* HatchStyleHorizontalBrick */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleWeave */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStylePlaid */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleDivot */ { 9.0, 9.0, LINE_WIDTH }, /* HatchStyleDottedGrid */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleDottedDiamond */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleShingle */ { HATCH_SIZE + 1.0, HATCH_SIZE - 1.0, LINE_WIDTH }, /* HatchStyleTrellis */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyleSphere */ { 9.0, 9.0, LINE_WIDTH }, /* HatchStyleSmallGrid */ { (HATCH_SIZE + 2.0) * 0.6, (HATCH_SIZE + 2.0) * 0.6, LINE_WIDTH }, /* HatchStyleSmallCheckerBoard */ { 4.0, 4.0, LINE_WIDTH }, /* HatchStyleLargeCheckerBoard */ { 8.0, 8.0, LINE_WIDTH }, /* HatchStyleOutlinedDiamond */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH }, /* HatchStyleSolidDiamond */ { HATCH_SIZE + 1.0, HATCH_SIZE + 1.0, LINE_WIDTH } }; /* * functions to draw different hatch styles. */ static cairo_status_t draw_horizontal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw horizontal line in the foreground color */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_move_to (ct2, 0, hatch_size / 2.0); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_vertical_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw vertical line in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_move_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_forward_diagonal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, TRUE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw forward diagonal lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_move_to (ct2, 0, hatch_size / 2.0); cairo_line_to (ct2, hatch_size / 2.0, hatch_size); cairo_move_to (ct2, hatch_size / 2.0, 0); cairo_line_to (ct2, hatch_size, hatch_size / 2.0); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_backward_diagonal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, TRUE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw backward diagonal lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_move_to (ct2, hatch_size / 2.0, 0); cairo_line_to (ct2, 0, hatch_size / 2.0 ); cairo_move_to (ct2, hatch_size, hatch_size / 2.0); cairo_line_to (ct2, hatch_size / 2.0, hatch_size); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_cross_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); double dash [] = {1.0}; /* used for drawing dotted grid */ BOOL dotted = (hbr->hatchStyle == HatchStyleDottedGrid); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, dotted ? CAIRO_LINE_CAP_BUTT : CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw lines in the foregound */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); if (hbr->hatchStyle == HatchStyleDottedGrid) cairo_set_dash (ct2, dash, 1, 0); /* draw a horizontal line */ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); /* draw a vertical line */ cairo_move_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_diagonal_cross_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, TRUE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw diagonal lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* draw a forward diagonal line */ cairo_move_to (ct2, 0, 0); cairo_line_to (ct2, hatch_size, hatch_size); /* draw a backward diagonal line */ cairo_move_to (ct2, hatch_size, 0); cairo_line_to (ct2, 0, hatch_size); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_percent_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_wd = gdip_hatch_get_width (hbr); double hatch_ht = gdip_hatch_get_height (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* some patterns requires to reverse the colors */ switch (hbr->hatchStyle) { case HatchStyle05Percent: case HatchStyle10Percent: case HatchStyle20Percent: case HatchStyle25Percent: draw_background (ct2, hbr->backColor, hatch_wd, hatch_ht, hbr->alpha); set_color (ct2, hbr->foreColor, hbr->alpha); break; default: draw_background (ct2, hbr->foreColor, hatch_wd, hatch_ht, hbr->alpha); set_color (ct2, hbr->backColor, hbr->alpha); } /* draw four dots */ /* left middle */ gdip_cairo_pixel (ct2, 0, hatch_ht / 2.0); /* top middle */ gdip_cairo_pixel (ct2, hatch_wd / 2.0, 0); /* bottom middle */ gdip_cairo_pixel (ct2, hatch_wd / 2.0, hatch_ht); /* right middle */ gdip_cairo_pixel (ct2, hatch_wd, hatch_ht / 2.0); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_30_percent_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* HatchStyle30Percent and HatchStyle60Percent are identical, but the colors are reversed */ if (hbr->hatchStyle == HatchStyle60Percent) { draw_background (ct2, hbr->foreColor, hatch_size, hatch_size, hbr->alpha); set_color (ct2, hbr->backColor, hbr->alpha); } else { draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); set_color (ct2, hbr->foreColor, hbr->alpha); } /* draw two diagonal lines in the foreground */ cairo_set_line_width (ct2, line_width); /* near top left corner */ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); /* near top right corner */ cairo_move_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* simulate the dots by drawing lines in background color */ if (hbr->hatchStyle == HatchStyleDottedDiamond) { double i; set_color (ct2, hbr->backColor, hbr->alpha); for (i = 0.0; i <= hatch_size; i += 2.0) { cairo_move_to (ct2, i, 0.0); cairo_line_to (ct2, i, hatch_size); } cairo_stroke (ct2); } /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_40_percent_hatch (cairo_t *ct, cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); cairo_pattern_t *pattern; cairo_t *ct2; double temp_size = 2; /* calculate radius using, pi * square (r) = % of hatch area */ double rad = sqrt ((10.0 * hatch_size * hatch_size) / (2 * PI * 100.0)); cairo_surface_t *temp = cairo_surface_create_similar (cairo_get_target (ct), CAIRO_CONTENT_COLOR_ALPHA, temp_size, temp_size); if (cairo_surface_status (temp) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (temp); return CAIRO_STATUS_NO_MEMORY; } /* draw a 50% hatch */ ct2 = create_hatch_context (temp, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) { cairo_surface_destroy (temp); return CAIRO_STATUS_NO_MEMORY; } /* draw background */ draw_background (ct2, hbr->backColor, temp_size, temp_size, hbr->alpha); /* draw two diagonal lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_rectangle (ct2, 0, 0, temp_size / 2.0, temp_size / 2.0); cairo_rectangle (ct2, temp_size / 2.0, temp_size / 2.0, temp_size, temp_size); cairo_fill (ct2); /* set the pattern for the consequent fill or stroke */ pattern = cairo_pattern_create_for_surface (temp); if (cairo_pattern_status (pattern) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (temp); cairo_destroy (ct2); cairo_pattern_destroy (pattern); return CAIRO_STATUS_NO_MEMORY; } cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); /* Clean up 50% */ cairo_surface_destroy (temp); cairo_destroy (ct2); /* temp hatch is used as background, so we get 50% hatch */ ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) { cairo_pattern_destroy (pattern); return CAIRO_STATUS_NO_MEMORY; } cairo_set_source (ct2, pattern); cairo_rectangle (ct2, 0, 0, hatch_size, hatch_size); cairo_fill (ct2); /* foreground is filled with 10% hatch of background color */ set_color (ct2, hbr->backColor, hbr->alpha); /* 0.5 is added for pixel adjustment. It's ugly but it makes output better. */ /* draw four semi circles in the foregound to make dots */ /* left middle */ cairo_arc (ct2, 0, hatch_size / 2.0, rad, - PI / 2.0, PI / 2.0); cairo_fill (ct2); /* top middle */ cairo_arc (ct2, hatch_size / 2.0, 0, rad, 0, PI); cairo_fill (ct2); /* bottom middle */ cairo_arc (ct2, hatch_size / 2.0, hatch_size, rad, - PI, 0); cairo_fill (ct2); /* right middle */ cairo_arc (ct2, hatch_size, hatch_size / 2.0, rad, PI / 2.0, - PI / 2.0); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); cairo_pattern_destroy (pattern); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_50_percent_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw two rectangles in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_rectangle (ct2, 0, 0, hatch_size / 2.0, hatch_size / 2.0); cairo_rectangle (ct2, hatch_size / 2.0, hatch_size / 2.0, hatch_size, hatch_size); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_downward_diagonal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw diagonal line in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_move_to (ct2, CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_move_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_dark_diagonal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw diagonal line in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); if (hbr->hatchStyle == HatchStyleDarkDownwardDiagonal) { cairo_rectangle (ct2, 0, 0, 2, 1); cairo_rectangle (ct2, 1, 1, 2, 1); cairo_rectangle (ct2, 2, 2, 2, 1); cairo_rectangle (ct2, 0, 3, 1, 1); cairo_rectangle (ct2, 3, 3, 1, 1); } else { cairo_rectangle (ct2, 1, 3, 2, 1); cairo_rectangle (ct2, 2, 2, 2, 1); cairo_rectangle (ct2, 3, 1, 1, 1); cairo_rectangle (ct2, 0, 1, 1, 1); cairo_rectangle (ct2, 0, 0, 2, 1); } cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_upward_diagonal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw diagonal line in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_move_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_move_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_dashed_diagonal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_wd = gdip_hatch_get_width (hbr); double hatch_ht = gdip_hatch_get_height (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_wd, hatch_ht, hbr->alpha); /* draw slant line in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); if (hbr->hatchStyle == HatchStyleDashedUpwardDiagonal) { /* 45 deg slant line */ cairo_move_to (ct2, hatch_wd + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, CAIRO_AA_OFFSET_X, hatch_wd + CAIRO_AA_OFFSET_Y); } else { /* HatchStyleDashedDownwardDiagonal */ /* -45 deg slant line */ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_wd, hatch_wd - CAIRO_AA_OFFSET_Y); } cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_dashed_horizontal_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_wd = gdip_hatch_get_width (hbr); double hatch_ht = gdip_hatch_get_height (hbr); double line_width = gdip_hatch_get_line_width (hbr); double line_space = 4; double dash_len = 4; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_wd, hatch_ht, hbr->alpha); /* draw horizontal lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* upper left dash */ cairo_move_to (ct2, 0, line_space / 2 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, dash_len, line_space / 2 + CAIRO_AA_OFFSET_Y); /* lower right dash */ cairo_move_to (ct2, hatch_wd - dash_len + CAIRO_AA_OFFSET_X, hatch_ht - line_space / 2 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_wd, hatch_ht - line_space / 2 + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_dashed_vertical_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_wd = gdip_hatch_get_width (hbr); double hatch_ht = gdip_hatch_get_height (hbr); double line_width = gdip_hatch_get_line_width (hbr); double line_space = 4; double dash_len = 4; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_wd, hatch_ht, hbr->alpha); /* draw vertical lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* upper left dash */ cairo_move_to (ct2, line_space / 2 + CAIRO_AA_OFFSET_X, 0); cairo_line_to (ct2, line_space / 2 + CAIRO_AA_OFFSET_X, dash_len - CAIRO_AA_OFFSET_Y); /* lower right dash */ cairo_move_to (ct2, hatch_wd - line_space / 2 + CAIRO_AA_OFFSET_X, hatch_ht - dash_len + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_wd - line_space / 2 + CAIRO_AA_OFFSET_X, hatch_ht); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_confetti_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double confetti_size = (hbr->hatchStyle == HatchStyleLargeConfetti) ? 1.5 : 1.0; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw small rectangles in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); /* draw four rectangles on the left reversed 'L' shape */ cairo_rectangle (ct2, 0, 0, confetti_size, confetti_size); cairo_rectangle (ct2, hatch_size / 8.0, hatch_size / 4.0, confetti_size, confetti_size); cairo_rectangle (ct2, 3 * hatch_size / 8.0, hatch_size / 2.0, confetti_size, confetti_size); cairo_rectangle (ct2, hatch_size / 4.0, 3 * hatch_size / 4.0, confetti_size, confetti_size); /* draw four rectangles on the other left reversed 'L' shape */ cairo_rectangle (ct2, hatch_size / 2.0, hatch_size / 8.0, confetti_size, confetti_size); cairo_rectangle (ct2, 3 * hatch_size / 4.0, 3 * hatch_size / 8.0, confetti_size, confetti_size); cairo_rectangle (ct2, 7 * hatch_size / 8.0, 5 * hatch_size / 8.0, confetti_size, confetti_size); cairo_rectangle (ct2, 5 * hatch_size / 8.0, 7 * hatch_size / 8.0, confetti_size, confetti_size); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_zigzag_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); set_color (ct2, hbr->foreColor, hbr->alpha); /* draw two diagonal lines in the foreground */ cairo_set_line_width (ct2, line_width); /* first half*/ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); /* second half */ cairo_move_to (ct2, hatch_size - 1 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, 1 - CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_wave_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_wd = gdip_hatch_get_width (hbr); double hatch_ht = gdip_hatch_get_height (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_wd, hatch_ht, hbr->alpha); /* set foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* draw a horizontal 'S' shape */ cairo_move_to (ct2, 1.0 + CAIRO_AA_OFFSET_X, 1.0 + CAIRO_AA_OFFSET_Y); cairo_curve_to (ct2, 1.0 + CAIRO_AA_OFFSET_X, 1.0 + CAIRO_AA_OFFSET_Y, hatch_wd / 4.0 + CAIRO_AA_OFFSET_X, hatch_ht + CAIRO_AA_OFFSET_Y, hatch_wd / 2.0 + CAIRO_AA_OFFSET_X, hatch_ht / 2.0 + CAIRO_AA_OFFSET_Y); cairo_curve_to (ct2, hatch_wd / 2.0 + CAIRO_AA_OFFSET_X, hatch_ht / 2.0 + CAIRO_AA_OFFSET_Y, 3 * hatch_wd / 4.0 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y, hatch_wd - 1.0 + CAIRO_AA_OFFSET_X, hatch_ht - 1.0 + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_diagonal_brick_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* set foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* draw one full diagonal line and half of another diagonal line */ gdip_cairo_pixel (ct2, 0, 0); cairo_fill (ct2); cairo_move_to (ct2, CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_move_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_horizontal_brick_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* set foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* draw a 'C' shape */ cairo_move_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); /* draw lower connector */ cairo_move_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_weave_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); double dash [] = {0.5}; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* set foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); cairo_set_dash (ct2, dash, 1, 0); /* draw a reversed 'C' shape diagonally with one connector towards * one of the other two vertices of the square and three connectors * towards the fourth vertex. */ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); /* this makes up one of the lower connectors also */ cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); /* complete the diagonal 'C' shape */ cairo_move_to (ct2, 3 * hatch_size / 4.0 + CAIRO_AA_OFFSET_X, hatch_size / 4.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); /* draw one upper connector */ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 4.0 + CAIRO_AA_OFFSET_X, hatch_size / 4.0 + CAIRO_AA_OFFSET_Y); /* draw lower connectors */ cairo_move_to (ct2, hatch_size / 4.0 + CAIRO_AA_OFFSET_X, 3 * hatch_size / 4.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_move_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_plaid_hatch (cairo_t *ct, cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double temp_size = 2; cairo_t *ct2; cairo_pattern_t *pattern; /* draw one hatch that has 50% of area as 50% hatch and remaining area * equally covered by each of foreground and background colors. */ cairo_surface_t *temp = cairo_surface_create_similar (cairo_get_target (ct), CAIRO_CONTENT_COLOR_ALPHA, temp_size, temp_size); if (cairo_surface_status (temp) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (temp); return CAIRO_STATUS_NO_MEMORY; } /* draw a 50% hatch */ ct2 = create_hatch_context (temp, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) { cairo_surface_destroy (temp); return CAIRO_STATUS_NO_MEMORY; } /* draw background */ draw_background (ct2, hbr->backColor, temp_size, temp_size, hbr->alpha); /* draw two diagonal lines in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_rectangle (ct2, 0, 0, temp_size / 2.0, temp_size / 2.0); cairo_rectangle (ct2, temp_size / 2.0, temp_size / 2.0, temp_size, temp_size); cairo_fill (ct2); /* create the pattern for the consequent fill or stroke */ pattern = cairo_pattern_create_for_surface (temp); if (cairo_pattern_status (pattern) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (temp); cairo_destroy (ct2); cairo_pattern_destroy (pattern); return CAIRO_STATUS_NO_MEMORY; } cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); /* Clean up the 50% objects */ cairo_surface_destroy (temp); cairo_destroy (ct2); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) { cairo_pattern_destroy (pattern); return CAIRO_STATUS_NO_MEMORY; } /* temp hatch is used to fill 50% of area */ cairo_set_source(ct2, pattern); cairo_rectangle (ct2, 0, 0, hatch_size, hatch_size / 2.0); cairo_fill (ct2); /* draw two rectangle in the foregound to make up 50% of plaid */ /* foreground is filled with 25% of background color and 25% of foreground color */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_rectangle (ct2, 0, hatch_size / 2.0, hatch_size / 2.0, hatch_size / 2.0); cairo_fill (ct2); set_color (ct2, hbr->backColor, hbr->alpha); cairo_rectangle (ct2, hatch_size / 2.0, hatch_size / 2.0, hatch_size / 2.0, hatch_size / 2.0); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); cairo_pattern_destroy (pattern); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_divot_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); double x, y; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* set foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* draw two angle brackets in the foreground */ x = hatch_size / 8.0 + CAIRO_AA_OFFSET_X; y = hatch_size / 8.0 + CAIRO_AA_OFFSET_Y; gdip_cairo_pixel (ct2, x, y); gdip_cairo_pixel (ct2, x + 1, y + 1); gdip_cairo_pixel (ct2, x, y + 2); x += 5; y += 6; gdip_cairo_pixel (ct2, x, y); gdip_cairo_pixel (ct2, x - 1, y - 1); gdip_cairo_pixel (ct2, x, y - 2); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_solid_diamond_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_wd = gdip_hatch_get_width (hbr); double hatch_ht = gdip_hatch_get_height (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_BUTT, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_wd, hatch_ht, hbr->alpha); /* draw two triangles in the foreground with left and right sides as their bases */ set_color (ct2, hbr->foreColor, hbr->alpha); /* draw left triangle */ cairo_move_to (ct2, -0.5, 0.5); cairo_line_to (ct2, hatch_wd / 2.0 - 0.5, hatch_ht / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, 0, hatch_ht); cairo_close_path (ct2); cairo_fill (ct2); /* draw right triangle */ cairo_move_to (ct2, hatch_wd, 0.5); cairo_line_to (ct2, hatch_wd / 2.0 + 0.5, hatch_ht / 2.0); cairo_line_to (ct2, hatch_wd, hatch_ht); cairo_close_path (ct2); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_shingle_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); double dash [] = {1.0}; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw two curves in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); cairo_set_dash (ct2, dash, 1, 0); cairo_set_line_width (ct2, line_width); /* draw a curve thru left top, center and right top corners */ cairo_move_to (ct2, CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size / 4.0 + CAIRO_AA_OFFSET_X, hatch_size / 4.0 + CAIRO_AA_OFFSET_Y); cairo_curve_to (ct2, hatch_size / 4.0 + CAIRO_AA_OFFSET_X, hatch_size / 4.0 + CAIRO_AA_OFFSET_Y, hatch_size / 2.0 + CAIRO_AA_OFFSET_X, hatch_size / 2.0 + CAIRO_AA_OFFSET_Y, 3 * hatch_size / 4.0 + CAIRO_AA_OFFSET_X, hatch_size / 4.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size + CAIRO_AA_OFFSET_X, CAIRO_AA_OFFSET_Y); /* draw a quarter circle thru center and right bottom corner */ cairo_arc (ct2, CAIRO_AA_OFFSET_X, hatch_size + CAIRO_AA_OFFSET_Y, hatch_size, -PI/4.0, 0); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_trellis_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* note: we swap the colors (easier to draw this way) */ /* draw background */ draw_background (ct2, hbr->foreColor, hatch_size, hatch_size, hbr->alpha); /* draw rectangles in the foreground */ set_color (ct2, hbr->backColor, hbr->alpha); /* upper left rectangle */ cairo_rectangle (ct2,0, hatch_size / 4.0, hatch_size / 2.0, hatch_size / 4.0); /* lower right rectangle */ cairo_rectangle (ct2, hatch_size / 2.0, 3 * hatch_size / 4.0, hatch_size / 2.0, hatch_size / 4.0); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_sphere_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); double line_width = gdip_hatch_get_line_width (hbr); double rad = hatch_size / 4.0 + 0.5; /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw half circles in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); /* left middle */ cairo_arc (ct2, 0, hatch_size / 2.0, rad, - PI / 2.0, PI / 2.0); cairo_fill (ct2); /* top middle */ cairo_arc (ct2, hatch_size / 2.0, 0, rad, 0, PI); cairo_fill (ct2); /* bottom middle */ cairo_arc (ct2, hatch_size / 2.0, hatch_size, rad, - PI, 0); cairo_fill (ct2); /* right middle */ cairo_arc (ct2, hatch_size, hatch_size / 2.0, rad, PI / 2.0, - PI / 2.0); cairo_fill (ct2); /* draw lines to mark sphere shining */ set_color (ct2, hbr->backColor, hbr->alpha); cairo_set_line_width (ct2, line_width); /* first line */ cairo_move_to (ct2, hatch_size - 1.0, hatch_size / 2.0 - rad / 2.0 + CAIRO_AA_OFFSET_Y); cairo_line_to (ct2, hatch_size - rad / 2.0 + CAIRO_AA_OFFSET_X, hatch_size / 2.0 - rad / 2.0 + CAIRO_AA_OFFSET_Y); /* second line */ cairo_move_to (ct2, hatch_size / 2.0 - rad / 4.0, hatch_size - rad / 2.0); cairo_line_to (ct2, hatch_size / 2.0 + rad / 4.0 - 1.0, hatch_size - rad / 2.0); cairo_stroke (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } static cairo_status_t draw_checker_hatch (cairo_surface_t *hatch, GpHatch *hbr) { double hatch_size = gdip_hatch_get_width (hbr); /* draw one hatch that has two colored squares at upper left and lower right corners */ /* hatch is not supposed to be affected by user matrix (so we create a new context) */ cairo_t *ct2 = create_hatch_context (hatch, CAIRO_LINE_CAP_SQUARE, FALSE); if (ct2 == NULL) return CAIRO_STATUS_NO_MEMORY; /* draw background */ draw_background (ct2, hbr->backColor, hatch_size, hatch_size, hbr->alpha); /* draw squares in the foreground */ set_color (ct2, hbr->foreColor, hbr->alpha); /* upper left square */ cairo_rectangle (ct2, 0, 0, hatch_size / 2.0, hatch_size / 2.0); /* lower right square */ cairo_rectangle (ct2, hatch_size / 2.0, hatch_size / 2.0, hatch_size, hatch_size); cairo_fill (ct2); /* clean up */ cairo_destroy (ct2); return CAIRO_STATUS_SUCCESS; } GpStatus gdip_hatch_setup (GpGraphics *graphics, GpBrush *brush) { GpHatch *hbr; cairo_t *ct; cairo_status_t status; if (!graphics || !brush) return InvalidParameter; ct = graphics->ct; if (!ct) return InvalidParameter; /* We create the new pattern for brush, if the brush is changed * or if pattern has not been created yet. */ hbr = (GpHatch *) brush; if (hbr->base.changed || (hbr->pattern) == NULL) { cairo_surface_t *hatch; cairo_antialias_t alias; int width = gdip_hatch_get_width (hbr); int height = gdip_hatch_get_height (hbr); hbr->alpha = (graphics->composite_mode == CompositingModeSourceOver); /* destroy the existing pattern */ if (hbr->pattern) cairo_pattern_destroy (hbr->pattern); hatch = cairo_surface_create_similar (cairo_get_target (ct), CAIRO_CONTENT_COLOR_ALPHA, width, height); status = cairo_surface_status (hatch); if (status != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (hatch); return gdip_get_status (status); } alias = cairo_get_antialias (ct); cairo_set_antialias(ct, CAIRO_ANTIALIAS_NONE); switch (hbr->hatchStyle) { /* case HatchStyleMin: */ case HatchStyleHorizontal: case HatchStyleLightHorizontal: case HatchStyleNarrowHorizontal: case HatchStyleDarkHorizontal: status = draw_horizontal_hatch (hatch, hbr); break; case HatchStyleVertical: case HatchStyleLightVertical: case HatchStyleNarrowVertical: case HatchStyleDarkVertical: status = draw_vertical_hatch (hatch, hbr); break; case HatchStyleForwardDiagonal: status = draw_forward_diagonal_hatch (hatch, hbr); break; case HatchStyleBackwardDiagonal: status = draw_backward_diagonal_hatch (hatch, hbr); break; /* case HatchStyleCross: */ case HatchStyleLargeGrid: case HatchStyleSmallGrid: case HatchStyleDottedGrid: status = draw_cross_hatch (hatch, hbr); break; case HatchStyleDiagonalCross: status = draw_diagonal_cross_hatch (hatch, hbr); break; case HatchStyle05Percent: case HatchStyle10Percent: case HatchStyle20Percent: case HatchStyle25Percent: case HatchStyle70Percent: /* same as 25% but colors will be reversed (not a typo for 75) */ case HatchStyle75Percent: /* same as 20% but colors will be reversed (not a typo for 80) */ case HatchStyle80Percent: /* same as 10% but colors will be reversed (not a typo for 90) */ case HatchStyle90Percent: /* same as 5% but colors will be reversed (not a typo) */ status = draw_percent_hatch (hatch, hbr); break; case HatchStyle30Percent: case HatchStyle60Percent: /* same as 30% but colors will be reversed (not a typo for 70) */ case HatchStyleOutlinedDiamond: /* hack: perfect width */ case HatchStyleDottedDiamond: /* hack */ status = draw_30_percent_hatch (hatch, hbr); break; case HatchStyle40Percent: status = draw_40_percent_hatch (ct, hatch, hbr); break; case HatchStyle50Percent: status = draw_50_percent_hatch (hatch, hbr); break; case HatchStyleLightDownwardDiagonal: case HatchStyleWideDownwardDiagonal: status = draw_downward_diagonal_hatch (hatch, hbr); break; case HatchStyleDarkUpwardDiagonal: case HatchStyleDarkDownwardDiagonal: status = draw_dark_diagonal_hatch (hatch, hbr); break; case HatchStyleLightUpwardDiagonal: case HatchStyleWideUpwardDiagonal: status = draw_upward_diagonal_hatch (hatch, hbr); break; case HatchStyleDashedDownwardDiagonal: case HatchStyleDashedUpwardDiagonal: status = draw_dashed_diagonal_hatch (hatch, hbr); break; case HatchStyleDashedHorizontal: status = draw_dashed_horizontal_hatch (hatch, hbr); break; case HatchStyleDashedVertical: status = draw_dashed_vertical_hatch (hatch, hbr); break; case HatchStyleSmallConfetti: case HatchStyleLargeConfetti: status = draw_confetti_hatch (hatch, hbr); break; case HatchStyleZigZag: status = draw_zigzag_hatch (hatch, hbr); break; case HatchStyleWave: status = draw_wave_hatch (hatch, hbr); break; case HatchStyleDiagonalBrick: status = draw_diagonal_brick_hatch (hatch, hbr); break; case HatchStyleHorizontalBrick: status = draw_horizontal_brick_hatch (hatch, hbr); break; case HatchStyleWeave: status = draw_weave_hatch (hatch, hbr); break; case HatchStylePlaid: status = draw_plaid_hatch (ct, hatch, hbr); break; case HatchStyleDivot: status = draw_divot_hatch (hatch, hbr); break; case HatchStyleShingle: status = draw_shingle_hatch (hatch, hbr); break; case HatchStyleTrellis: status = draw_trellis_hatch (hatch, hbr); break; case HatchStyleSphere: status = draw_sphere_hatch (hatch, hbr); break; case HatchStyleSmallCheckerBoard: case HatchStyleLargeCheckerBoard: status = draw_checker_hatch (hatch, hbr); break; /* case HatchStyleMax: */ case HatchStyleSolidDiamond: status = draw_solid_diamond_hatch (hatch, hbr); break; default: status = CAIRO_STATUS_INVALID_RESTORE; /* will be converted into InvalidParameter */ break; } cairo_set_antialias (ct, alias); if (status != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (hatch); return gdip_get_status (status); } /* create and verity the pattern created from the surface */ hbr->pattern = cairo_pattern_create_for_surface (hatch); status = cairo_pattern_status (hbr->pattern); if (status != CAIRO_STATUS_SUCCESS) { cairo_pattern_destroy (hbr->pattern); hbr->pattern = NULL; cairo_surface_destroy (hatch); return gdip_get_status (status); } /* finally set the pattern into the context and destroy the hatch surface */ cairo_pattern_set_extend (hbr->pattern, CAIRO_EXTEND_REPEAT); cairo_surface_destroy (hatch); } cairo_set_source (ct, hbr->pattern); return gdip_get_status (cairo_status (ct)); } GpStatus gdip_hatch_clone (GpBrush *brush, GpBrush **clonedBrush) { GpHatch *result; GpHatch *hatch; if (!brush || !clonedBrush) return InvalidParameter; result = gdip_hatch_new (); if (!result) { *clonedBrush = NULL; return OutOfMemory; } hatch = (GpHatch *) brush; result->base = hatch->base; result->hatchStyle = hatch->hatchStyle; result->foreColor = hatch->foreColor; result->backColor = hatch->backColor; result->base.changed = TRUE; result->pattern = NULL; *clonedBrush = (GpBrush *) result; return Ok; } GpStatus gdip_hatch_destroy (GpBrush *brush) { GpHatch *hatch = (GpHatch *) brush; if (hatch->pattern) { cairo_pattern_destroy (hatch->pattern); hatch->pattern = NULL; } return Ok; } // coverity[+alloc : arg-*3] GpStatus GdipCreateHatchBrush (GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush) { GpHatch *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!brush) return InvalidParameter; if (hatchstyle < HatchStyleMin || hatchstyle > HatchStyleMax) return InvalidParameter; result = gdip_hatch_new (); if (!result) return OutOfMemory; result->hatchStyle = hatchstyle; result->foreColor = forecol; result->backColor = backcol; *brush = result; return Ok; } GpStatus GdipGetHatchStyle (GpHatch *brush, GpHatchStyle *hatchstyle) { if (!brush || !hatchstyle) return InvalidParameter; *hatchstyle = brush->hatchStyle; return Ok; } GpStatus GdipGetHatchForegroundColor (GpHatch *brush, ARGB *forecol) { if (!brush || !forecol) return InvalidParameter; *forecol = brush->foreColor; return Ok; } GpStatus GdipGetHatchBackgroundColor (GpHatch *brush, ARGB *backcol) { if (!brush || !backcol) return InvalidParameter; *backcol = brush->backColor; return Ok; } libgdiplus-6.0.4+dfsg/src/bitmap.h0000644000175000017500000000673613542672033017553 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __BITMAP_H__ #define __BITMAP_H__ GpStatus WINGDIPAPI GdipCreateBitmapFromStream (void *stream, GpBitmap **bitmap); GpStatus WINGDIPAPI GdipCreateBitmapFromFile (GDIPCONST WCHAR* filename, GpBitmap **bitmap); GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM (void *stream, GpBitmap **bitmap); GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM (GDIPCONST WCHAR* filename, GpBitmap **bitmap); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0 (INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap **bitmap); GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics (INT width, INT height, GpGraphics *target, GpBitmap **bitmap); GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP (HBITMAP hbm, HPALETTE hpal, GpBitmap** bitmap); GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap (GpBitmap* bitmap, HBITMAP *hbmReturn, ARGB background); GpStatus WINGDIPAPI GdipCreateBitmapFromHICON (HICON hicon, GpBitmap** bitmap); GpStatus WINGDIPAPI GdipCreateHICONFromBitmap (GpBitmap* bitmap, HICON *hbmReturn); GpStatus WINGDIPAPI GdipCreateBitmapFromResource (HINSTANCE hInstance, GDIPCONST WCHAR *lpBitmapName, GpBitmap** bitmap); GpStatus WINGDIPAPI GdipBitmapLockBits (GpBitmap *bitmap, GDIPCONST Rect *rect, UINT flags, PixelFormat format, BitmapData *lockedBitmapData); GpStatus WINGDIPAPI GdipBitmapUnlockBits (GpBitmap *bitmap, BitmapData *lockedBitmapData); GpStatus WINGDIPAPI GdipBitmapSetPixel (GpBitmap *bitmap, INT x, INT y, ARGB color); GpStatus WINGDIPAPI GdipBitmapGetPixel (GpBitmap *bitmap, INT x, INT y, ARGB *color); GpStatus WINGDIPAPI GdipCloneBitmapArea (REAL x, REAL y, REAL width, REAL height, PixelFormat format, GpBitmap *srcBitmap, GpBitmap **dstBitmap); GpStatus WINGDIPAPI GdipCloneBitmapAreaI (INT x, INT y, INT width, INT height, PixelFormat format, GpBitmap *srcBitmap, GpBitmap **dstBitmap); GpStatus WINGDIPAPI GdipBitmapSetResolution (GpBitmap *bitmap, REAL xdpi, REAL ydpi); /* missing API GdipCreateBitmapFromDirectDrawSurface GdipCreateBitmapFromGdiDib */ #endif libgdiplus-6.0.4+dfsg/src/text.c0000644000175000017500000001172713542674535017263 0ustar directhexdirecthex/* * text.c * * Copyright (c) 2003 Alexandre Pigolkine, Novell Inc. * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Sebastien Pouliot */ #include "gdiplus-private.h" #ifdef USE_PANGO_RENDERING #include "text-pango-private.h" #else #include "text-cairo-private.h" #endif #include "text-metafile-private.h" /* * Text API - validate and delegate */ GpStatus WINGDIPAPI GdipDrawString (GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, GpBrush *brush) { GDIPCONST WCHAR *ptr = NULL; if (length == 0) { return Ok; } else if (length == -1) { ptr = string; length = 0; while (*ptr != 0) { length++; ptr++; } } if (!graphics || !string || !font || !layoutRect) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: return text_DrawString (graphics, string, length, font, layoutRect, stringFormat, brush); case GraphicsBackEndMetafile: return metafile_DrawString (graphics, string, length, font, layoutRect, stringFormat, brush); default: return GenericError; } } GpStatus WINGDIPAPI GdipMeasureString (GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, RectF *boundingBox, INT *codepointsFitted, INT *linesFilled) { GDIPCONST WCHAR *ptr = NULL; if (length == 0) { if (boundingBox) { if (layoutRect) { boundingBox->X = layoutRect->X; boundingBox->Y = layoutRect->Y; } else { boundingBox->X = 0; boundingBox->Y = 0; } boundingBox->Width = 0; boundingBox->Height = 0; } if (linesFilled) { *linesFilled = 0; } if (codepointsFitted) { *codepointsFitted = 0; } return Ok; } else if (length == -1) { ptr = string; length = 0; while (*ptr != 0) { length++; ptr++; } } if (!graphics || !string || !font || !layoutRect) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: /* a metafile-based graphics returns the correct measures but doesn't record anything */ case GraphicsBackEndMetafile: return text_MeasureString (graphics, string, length, font, layoutRect, stringFormat, boundingBox, codepointsFitted, linesFilled); default: return GenericError; } } GpStatus WINGDIPAPI GdipMeasureCharacterRanges (GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST GpRectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, INT regionCount, GpRegion **regions) { /* note: a NULL format is invalid */ if (!graphics || !string || (length == 0) || !font || !layoutRect || !stringFormat || !regions) return InvalidParameter; /* No char range or bounding rect is set for measurements */ if (stringFormat->charRangeCount == 0) { *regions = NULL; return Ok; } /* if non-zero (previous check) format->charRangeCount must match regionCount */ if (regionCount != stringFormat->charRangeCount) return InvalidParameter; switch (graphics->backend) { case GraphicsBackEndCairo: /* a metafile-based graphics returns the correct measures but doesn't record anything */ case GraphicsBackEndMetafile: return text_MeasureCharacterRanges (graphics, string, length, font, layoutRect, stringFormat, regionCount, regions); default: return GenericError; } } GpStatus WINGDIPAPI GdipDrawDriverString (GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix) { return NotImplemented; } GpStatus WINGDIPAPI GdipMeasureDriverString (GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix, RectF *boundingBox) { return NotImplemented; }libgdiplus-6.0.4+dfsg/src/metafile-private.h0000644000175000017500000001766113542674535021545 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __METAFILE_PRIVATE_H__ #define __METAFILE_PRIVATE_H__ #include "gdiplus-private.h" #include "codecs-private.h" #include "bitmap-private.h" #include "matrix-private.h" #include "bmpcodec.h" #include "emfcodec.h" #include "wmfcodec.h" /* * http://wvware.sourceforge.net/caolan/ora-wmf.html */ #define ALDUS_PLACEABLE_METAFILE_KEY 0x9AC6CDD7 #define WMF_TYPE_AND_HEADERSIZE_KEY 0x00090001 #define EMF_EMR_HEADER_KEY 0x1 #define MM_PER_INCH 25.4f /* object types */ #define METAOBJECT_TYPE_EMPTY 0 #define METAOBJECT_TYPE_PEN 1 #define METAOBJECT_TYPE_BRUSH 2 #define gdip_get_metaheader(image) (&((GpMetafile*)image)->metafile_header) #if G_BYTE_ORDER == G_LITTLE_ENDIAN #define GETDW(x) (*(DWORD*)(data + (x))) #else #define GETDW(x) (GUINT32_FROM_LE(*(DWORD*)(data + (x)))) #endif typedef struct { void *ptr; int type; } MetaObject; struct _Metafile { GpImage base; MetafileHeader metafile_header; BOOL delete; BYTE *data; int length; BOOL recording; /* recording into memory (data), file (fp) or user stream (stream) */ FILE *fp; void *stream; }; typedef struct { GpMetafile *metafile; int x, y, width, height; int objects_count; MetaObject *objects; MetaObject created; GpGraphics *graphics; GpMatrix initial; GpMatrix matrix; DWORD bk_mode; DWORD bk_color; float miter_limit; int selected_pen; int selected_brush; int selected_font; int selected_palette; int map_mode; FillMode fill_mode; int current_x, current_y; /* path related data */ BOOL use_path; GpPath *path; int path_x, path_y; /* stock objects */ GpPen *stock_pen_white; GpPen *stock_pen_black; GpPen *stock_pen_null; GpSolidFill *stock_brush_white; GpSolidFill *stock_brush_ltgray; GpSolidFill *stock_brush_gray; GpSolidFill *stock_brush_dkgray; GpSolidFill *stock_brush_black; GpSolidFill *stock_brush_null; /* bitmap representation */ BYTE *scan0; } MetafilePlayContext; typedef struct { int num; GpPointF *points; } PointFList; typedef struct { DWORD cbPixelFormat; DWORD offPixelFormat; DWORD bOpenGL; } HeaderExtension1; GpStatus gdip_get_metafile_from (void *pointer, GpMetafile **metafile, ImageSource source) GDIP_INTERNAL; GpStatus gdip_metafile_clone (GpMetafile *metafile, GpMetafile **clonedmetafile) GDIP_INTERNAL; GpStatus gdip_metafile_dispose (GpMetafile *metafile) GDIP_INTERNAL; GpStatus gdip_get_bitmap_from_metafile (GpMetafile *metafile, INT width, INT height, GpImage **thumbnail) GDIP_INTERNAL; GpStatus gdip_metafile_stop_recording (GpMetafile *metafile) GDIP_INTERNAL; GpStatus gdip_metafile_play_emf (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_play_wmf (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_play_emfplus_block (MetafilePlayContext *context, BYTE* data, int length) GDIP_INTERNAL; MetafilePlayContext* gdip_metafile_play_setup (GpMetafile *metafile, GpGraphics *graphics, int x, int y, int width, int height) GDIP_INTERNAL; GpStatus gdip_metafile_play (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_play_cleanup (MetafilePlayContext *context) GDIP_INTERNAL; GpPen* gdip_metafile_GetSelectedPen (MetafilePlayContext *context) GDIP_INTERNAL; GpBrush* gdip_metafile_GetSelectedBrush (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus GdiComment (MetafilePlayContext *context, BYTE* data, DWORD size) GDIP_INTERNAL; GpStatus gdip_metafile_SaveDC (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_SetBkMode (MetafilePlayContext *context, DWORD bkMode) GDIP_INTERNAL; GpStatus gdip_metafile_SetMapMode (MetafilePlayContext *context, DWORD mode) GDIP_INTERNAL; GpStatus gdip_metafile_SetROP2 (MetafilePlayContext *context, DWORD rop) GDIP_INTERNAL; GpStatus gdip_metafile_SetRelabs (MetafilePlayContext *context, DWORD mode) GDIP_INTERNAL; GpStatus gdip_metafile_SetPolyFillMode (MetafilePlayContext *context, DWORD mode) GDIP_INTERNAL; GpStatus gdip_metafile_SetStretchBltMode (MetafilePlayContext *context, int iStretchMode) GDIP_INTERNAL; GpStatus gdip_metafile_RestoreDC (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_SelectObject (MetafilePlayContext *context, DWORD slot) GDIP_INTERNAL; GpStatus gdip_metafile_ModifyWorldTransform (MetafilePlayContext *context, XFORM *lpXform, DWORD iMode) GDIP_INTERNAL; GpStatus gdip_metafile_SetTextAlign (MetafilePlayContext *context, DWORD textalign) GDIP_INTERNAL; GpStatus gdip_metafile_DeleteObject (MetafilePlayContext *context, DWORD slot) GDIP_INTERNAL; GpStatus gdip_metafile_SetBkColor (MetafilePlayContext *context, DWORD color) GDIP_INTERNAL; GpStatus gdip_metafile_SetWindowOrg (MetafilePlayContext *context, int x, int y) GDIP_INTERNAL; GpStatus gdip_metafile_SetWindowExt (MetafilePlayContext *context, int height, int width) GDIP_INTERNAL; GpStatus gdip_metafile_LineTo (MetafilePlayContext *context, int x, int y) GDIP_INTERNAL; GpStatus gdip_metafile_MoveTo (MetafilePlayContext *context, int x, int y) GDIP_INTERNAL; GpStatus gdip_metafile_SetMiterLimit (MetafilePlayContext *context, float eNewLimit, float *peOldLimit) GDIP_INTERNAL; GpStatus gdip_metafile_CreatePenIndirect (MetafilePlayContext *context, DWORD style, DWORD width, DWORD color) GDIP_INTERNAL; GpStatus gdip_metafile_ExtCreatePen (MetafilePlayContext *context, DWORD dwPenStyle, DWORD dwWidth, CONST LOGBRUSH *lplb, DWORD dwStyleCount, CONST DWORD *lpStyle) GDIP_INTERNAL; GpStatus gdip_metafile_CreateBrushIndirect (MetafilePlayContext *context, DWORD style, DWORD color, DWORD hatch) GDIP_INTERNAL; GpStatus gdip_metafile_Arc (MetafilePlayContext *context, int left, int top, int right, int bottom, int xstart, int ystart, int xend, int yend) GDIP_INTERNAL; GpStatus gdip_metafile_Rectangle (MetafilePlayContext *context, int bottomRect, int rightRect, int topRect, int leftRect) GDIP_INTERNAL; GpStatus gdip_metafile_SetPixel (MetafilePlayContext *context, DWORD color, int x, int y) GDIP_INTERNAL; GpStatus gdip_metafile_StretchDIBits (MetafilePlayContext *context, int XDest, int YDest, int nDestWidth, int nDestHeight, int XSrc, int YSrc, int nSrcWidth, int nSrcHeight, CONST void *lpBits, CONST BITMAPINFO *lpBitsInfo, UINT iUsage, DWORD dwRop) GDIP_INTERNAL; GpStatus gdip_metafile_PolyBezier (MetafilePlayContext *context, GpPointF *points, int count) GDIP_INTERNAL; GpStatus gdip_metafile_Polygon (MetafilePlayContext *context, GpPointF *points, int count) GDIP_INTERNAL; GpStatus gdip_metafile_BeginPath (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_EndPath (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_CloseFigure (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_FillPath (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_StrokePath (MetafilePlayContext *context) GDIP_INTERNAL; GpStatus gdip_metafile_StrokeAndFillPath (MetafilePlayContext *context) GDIP_INTERNAL; #include "metafile.h" #endif libgdiplus-6.0.4+dfsg/src/icocodec.c0000644000175000017500000002474413542674535020052 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "gdiplus-private.h" #include "icocodec.h" GUID gdip_ico_image_format_guid = {0xb96b3cb5U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; /* Codecinfo related data*/ static ImageCodecInfo ico_codec; static const WCHAR ico_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'I', 'C', 'O', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in ICO */ static const WCHAR ico_extension[] = {'*','.','I', 'C', 'O', 0}; /* *.ICO */ static const WCHAR ico_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'x', '-', 'i', 'c', 'o', 'n', 0}; /* image/x-icon */ static const WCHAR ico_format[] = {'I', 'C', 'O', 0}; /* ICO */ static const BYTE ico_sig_pattern[] = { 0x00, 0x00, 0x01, 0x00 }; static const BYTE ico_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF }; ImageCodecInfo* gdip_getcodecinfo_ico () { ico_codec.Clsid = (CLSID) { 0x557cf407, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; ico_codec.FormatID = gdip_ico_image_format_guid; ico_codec.CodecName = (const WCHAR*) ico_codecname; ico_codec.DllName = NULL; ico_codec.FormatDescription = (const WCHAR*) ico_format; ico_codec.FilenameExtension = (const WCHAR*) ico_extension; ico_codec.MimeType = (const WCHAR*) ico_mimetype; ico_codec.Flags = ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; ico_codec.Version = 1; ico_codec.SigCount = 1; ico_codec.SigSize = 4; ico_codec.SigPattern = ico_sig_pattern; ico_codec.SigMask = ico_sig_mask; return &ico_codec; } static BYTE get_ico_data (BYTE *data, int x, int y, int bpp, int line_length) { BYTE result = 0; BYTE *line_data = data + y * line_length; switch (bpp) { case 1: result = (line_data [x >> 3] >> (7 - (x & 7))) & 0x01; break; case 4: result = line_data [x >> 1]; if ((x & 1) == 1) result &= 0x0F; else result >>= 4; break; case 8: result = line_data [x]; break; } return result; } static BOOL read_ICONDIRENTRY (void *pointer, ICONDIRENTRY *entry, ImageSource source, BOOL decode) { if (gdip_read_ico_data (pointer, (void*)entry, sizeof (ICONDIRENTRY), source) != sizeof (ICONDIRENTRY)) return FALSE; #if WORDS_BIGENDIAN if (decode) { BYTE *b; /* entry->bWidth, bHeight, bColorCount, bReserved are all BYTE, no change required */ b = (BYTE*)&entry->wPlanes; entry->wPlanes = (b[1] << 8) | b[0]; b = (BYTE*)&entry->wBitCount; entry->wBitCount = (b[1] << 8) | b[0]; b = (BYTE*)&entry->dwBytesInRes; entry->dwBytesInRes = ((guint32)b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; b = (BYTE*)&entry->dwImageOffset; entry->dwImageOffset = ((guint32)b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; } #endif return TRUE; } static GpStatus gdip_read_ico_image_from_file_stream (void *pointer, GpImage **image, ImageSource source) { GpStatus status = OutOfMemory; GpBitmap *result = NULL; BYTE *pixels = NULL; WORD w, count; void *p = &w; BYTE *b = (BYTE*)&w; ICONDIRENTRY entry; int i, pos; BOOL upsidedown = TRUE; BITMAPV5HEADER bih; int palette_entries = -1; ARGB *colors = NULL; int x, y; int line_xor_length, xor_size; int line_and_length, and_size; BYTE *xor_data = NULL, *and_data = NULL; /* WORD ICONDIR.idReserved / reversed, MUST be 0 */ if (gdip_read_ico_data (pointer, p, sizeof (WORD), source) != sizeof (WORD)) goto error; if (w != 0) goto error; /* WORD ICONDIR.idType / resource type, MUST be 1 for icons */ if (gdip_read_ico_data (pointer, p, sizeof (WORD), source) != sizeof (WORD)) goto error; i = (b[1] << 8 | b[0]); if (i != 1) goto error; /* WORD ICONDIR.idCount / number of icons, must be greater than 0 */ if (gdip_read_ico_data (pointer, p, sizeof (WORD), source) != sizeof (WORD)) goto error; count = (b[1] << 8 | b[0]); if (count < 1) goto error; pos = 6; /* * NOTE: it looks like (from unit tests) that we get the last icon * (e.g. it can return the 16 pixel version, instead of the 32 or 48 pixels available in the same file) */ for (i = 0; i < count - 1; i++) { if (!read_ICONDIRENTRY (pointer, &entry, source, FALSE)) goto error; pos += sizeof (ICONDIRENTRY); } /* last one is important, so we must decode (endianess) it's values */ if (!read_ICONDIRENTRY (pointer, &entry, source, TRUE)) goto error; pos += sizeof (ICONDIRENTRY); while (pos < entry.dwImageOffset) { if (gdip_read_ico_data (pointer, p, sizeof (WORD), source) != sizeof (WORD)) goto error; pos += sizeof (WORD); } /* BITMAPINFOHEADER */ status = gdip_read_BITMAPINFOHEADER (pointer, source, &bih, &upsidedown); if (status != Ok) goto error; result = gdip_bitmap_new_with_frame (NULL, TRUE); if (!result) { status = OutOfMemory; goto error; } result->type = ImageTypeBitmap; result->image_format = ICON; result->active_bitmap->pixel_format = PixelFormat32bppARGB; /* icons are always promoted to 32 bbp */ result->active_bitmap->width = entry.bWidth; result->active_bitmap->height = entry.bHeight; result->active_bitmap->stride = result->active_bitmap->width * 4; /* Ensure 32bits alignment */ gdip_align_stride (result->active_bitmap->stride); result->active_bitmap->dpi_horz = 96.0f; result->active_bitmap->dpi_vert = 96.0f; switch (bih.bV5BitCount) { case 1: case 4: case 8: /* support 2, 16 and 256 colors icons, with palettes, no compression */ if (bih.bV5Compression == 0) palette_entries = 1 << bih.bV5BitCount; break; case 24: /* support 24bits + alpha bitmap, this is not documented anywhere but Windows accept them as valid */ case 32: /* support 24bits + 8 bits alpha (aka "XP" icons), no palette, no compression */ if (bih.bV5Compression == 0) palette_entries = 0; break; } if (palette_entries < 0) { status = OutOfMemory; goto error; } /* * Strangely, even if we're supplying a 32bits ARGB image, * the icon's palette is also supplied with the image. */ result->active_bitmap->palette = GdipAlloc (sizeof(ColorPalette) + sizeof(ARGB) * palette_entries); if (result->active_bitmap->palette == NULL) { status = OutOfMemory; goto error; } result->active_bitmap->palette->Flags = 0; result->active_bitmap->palette->Count = palette_entries; for (i = 0; i < palette_entries; i++) { /* colors are stored as R, G, B and reserved (always 0) */ BYTE color[4]; void *p = &color; if (gdip_read_ico_data (pointer, p, 4, source) < 4) { status = OutOfMemory; goto error; } set_pixel_bgra (result->active_bitmap->palette->Entries, i * 4, (color[0] & 0xFF), /* B */ (color[1] & 0xFF), /* G */ (color[2] & 0xFF), /* R */ 0xFF); /* Alpha */ } /* * Let's build the 32bpp ARGB bitmap from the icon's XOR and AND bitmaps * notes: * - XORBitmap can be a 1, 4 or 8 bpp bitmap * - ANDBitmap is *always* a monochrome (1bpp) bitmap * - in every case each line is padded to 32 bits boundary */ unsigned long long int size = (unsigned long long int)result->active_bitmap->stride * result->active_bitmap->height; if (size > G_MAXINT32) { status = OutOfMemory; goto error; } pixels = GdipAlloc (size); if (pixels == NULL) { status = OutOfMemory; goto error; } result->active_bitmap->scan0 = pixels; result->active_bitmap->reserved = GBD_OWN_SCAN0; result->active_bitmap->image_flags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize | ImageFlagsColorSpaceRGB | ImageFlagsHasAlpha; line_xor_length = (((bih.bV5BitCount * entry.bWidth + 31) & ~31) >> 3); xor_size = line_xor_length * entry.bHeight; xor_data = (BYTE*) GdipAlloc (xor_size); if (!xor_data) { status = OutOfMemory; goto error; } if (gdip_read_ico_data (pointer, xor_data, xor_size, source) < xor_size) { status = OutOfMemory; goto error; } line_and_length = (((entry.bWidth + 31) & ~31) >> 3); and_size = line_and_length * entry.bHeight; and_data = (BYTE*) GdipAlloc (and_size); if (!and_data) { status = OutOfMemory; goto error; } if (gdip_read_ico_data (pointer, and_data, and_size, source) < and_size) { status = OutOfMemory; goto error; } colors = result->active_bitmap->palette->Entries; for (y = 0; y < entry.bHeight; y++) { for (x = 0; x < entry.bWidth; x++) { ARGB color; if (palette_entries > 0) { color = colors [get_ico_data (xor_data, x, y, bih.bV5BitCount, line_xor_length)]; if (get_ico_data (and_data, x, y, 1, line_and_length) == 1) color &= 0x00FFFFFF; } else if (bih.bV5BitCount == 24) { /* take 1bpp alpha from the and_data */ if (get_ico_data (and_data, x, y, 1, line_and_length) == 1) { color = 0; } else { BYTE *line_data = xor_data + y * line_xor_length + x * 3; color = 0xFF000000 | (line_data [0] | line_data [1] << 8| line_data [2] << 16); } } else { BYTE *line_data = xor_data + y * line_xor_length + x * 4; /* ARGB to BRGA */ color = (line_data [0] | line_data [1] << 8 | line_data [2] << 16 | (guint32)line_data [3] << 24); } /* image is reversed (y) */ GdipBitmapSetPixel (result, x, entry.bHeight - y - 1, color); } } GdipFree (xor_data); GdipFree (and_data); *image = result; return Ok; error: if (result) GdipDisposeImage (result); if (xor_data) GdipFree (xor_data); if (and_data) GdipFree (and_data); return status; } GpStatus gdip_load_ico_image_from_file (FILE *fp, GpImage **image) { return gdip_read_ico_image_from_file_stream ((void*)fp, image, File); } GpStatus gdip_load_ico_image_from_stream_delegate (dstream_t *loader, GpImage **image) { return gdip_read_ico_image_from_file_stream ((void *)loader, image, DStream); } libgdiplus-6.0.4+dfsg/src/jpegcodec.c0000644000175000017500000006375513545154626020227 0ustar directhexdirecthex/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t -*- * * jpegcodec.c : Contains function definitions for encoding decoding jpeg images * * Copyright (C) 2003-2004,2007 Novell, Inc (http://www.novell.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. * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * */ #include "config.h" #include "codecs-private.h" #include "jpegcodec.h" GUID gdip_jpg_image_format_guid = {0xb96b3caeU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; #ifdef HAVE_LIBJPEG #include /* pkgsrc */ #undef HAVE_STDLIB_H #include #include "dstream.h" #ifdef HAVE_LIBEXIF #include #include #include #endif /* Codecinfo related data*/ static ImageCodecInfo jpeg_codec; static const WCHAR jpeg_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'J', 'P', 'E', 'G', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in JPEG Codec */ static const WCHAR jpeg_extension[] = {'*', '.', 'J', 'P','G', ';','*', '.', 'J','P', 'E', 'G', ';', '*', '.', 'J', 'P', 'E', ';', '*', '.', 'J', 'F','I','F', 0}; /* JPG;*.JPEG;*.JPE;*.JFIF */ static const WCHAR jpeg_mimetype[] = {'i', 'm', 'a','g', 'e','/', 'j', 'p', 'e', 'g', 0}; /* image/png */ static const WCHAR jpeg_format[] = {'J', 'P', 'E', 'G', 0}; /* JPEG */ static const BYTE jpeg_sig_pattern[] = { 0xFF, 0xD8 }; static const BYTE jpeg_sig_mask[] = { 0xFF, 0xFF }; ImageCodecInfo * gdip_getcodecinfo_jpeg () { jpeg_codec.Clsid = (CLSID) { 0x557cf401, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; jpeg_codec.FormatID = gdip_jpg_image_format_guid; jpeg_codec.CodecName = (const WCHAR*) jpeg_codecname; jpeg_codec.DllName = NULL; jpeg_codec.FormatDescription = (const WCHAR*) jpeg_format; jpeg_codec.FilenameExtension = (const WCHAR*) jpeg_extension; jpeg_codec.MimeType = (const WCHAR*) jpeg_mimetype; jpeg_codec.Flags = ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; jpeg_codec.Version = 1; jpeg_codec.SigCount = 1; jpeg_codec.SigSize = 2; jpeg_codec.SigPattern = jpeg_sig_pattern; jpeg_codec.SigMask = jpeg_sig_mask; return &jpeg_codec; } #if !defined(HAVE_SIGSETJMP) && !defined(sigsetjmp) #define sigjmp_buf jmp_buf #define sigsetjmp(jb, x) setjmp(jb) #define siglongjmp longjmp #endif #define JPEG_BUFFER_SIZE 65536 struct gdip_stdio_jpeg_source_mgr { struct jpeg_source_mgr parent; FILE *infp; JOCTET *buf; }; typedef struct gdip_stdio_jpeg_source_mgr *gdip_stdio_jpeg_source_mgr_ptr; struct gdip_stream_jpeg_source_mgr { struct jpeg_source_mgr parent; dstream_t *loader; JOCTET *buf; }; typedef struct gdip_stream_jpeg_source_mgr *gdip_stream_jpeg_source_mgr_ptr; struct gdip_stream_jpeg_dest_mgr { struct jpeg_destination_mgr parent; PutBytesDelegate putBytesFunc; JOCTET *buf; }; typedef struct gdip_stream_jpeg_dest_mgr *gdip_stream_jpeg_dest_mgr_ptr; struct gdip_jpeg_error_mgr { struct jpeg_error_mgr parent; sigjmp_buf setjmp_buffer; GError **error; }; typedef struct gdip_jpeg_error_mgr *gdip_jpeg_error_mgr_ptr; static void _gdip_jpeg_error_exit (j_common_ptr cinfo) { gdip_jpeg_error_mgr_ptr err = (gdip_jpeg_error_mgr_ptr) cinfo->err; char buffer[JMSG_LENGTH_MAX]; (* cinfo->err->format_message) (cinfo, buffer); /* There is some very bizzare stuff happening with error * reporting. These are supposed to be fatal errors, * but libjpeg goes through a bunch of these calls and then * -finishes uncompressing the image-. I have no idea * what's going on here. * -- FIXME */ g_warning ("jpeg error: %d %s\n", err->parent.msg_code, buffer); siglongjmp (err->setjmp_buffer, 1); } static void _gdip_jpeg_output_message (j_common_ptr cinfo) { /* shh. */ } static void _gdip_source_dummy_init (j_decompress_ptr cinfo) { /* nothing */ } static BOOL _gdip_source_stdio_fill_input_buffer (j_decompress_ptr cinfo) { gdip_stdio_jpeg_source_mgr_ptr src = (gdip_stdio_jpeg_source_mgr_ptr) cinfo->src; size_t nb; nb = fread (src->buf, 1, JPEG_BUFFER_SIZE, src->infp); if (nb <= 0) { /* this is a hack learned from gdk-pixbuf */ /* insert fake EOI marker, to try to salvage image * in case of malformed/incomplete input */ src->buf[0] = (JOCTET) 0xFF; src->buf[1] = (JOCTET) JPEG_EOI; nb = 2; } src->parent.next_input_byte = src->buf; src->parent.bytes_in_buffer = nb; return TRUE; } static void _gdip_source_stdio_skip_input_data (j_decompress_ptr cinfo, long skipbytes) { gdip_stdio_jpeg_source_mgr_ptr src = (gdip_stdio_jpeg_source_mgr_ptr) cinfo->src; if (skipbytes > 0) { if (skipbytes > (long) src->parent.bytes_in_buffer) { skipbytes -= (long) src->parent.bytes_in_buffer; fseek (src->infp, skipbytes, SEEK_CUR); (void) _gdip_source_stdio_fill_input_buffer (cinfo); } else { src->parent.next_input_byte += (size_t) skipbytes; src->parent.bytes_in_buffer -= (size_t) skipbytes; } } } static BOOL _gdip_source_stream_fill_input_buffer (j_decompress_ptr cinfo) { gdip_stream_jpeg_source_mgr_ptr src = (gdip_stream_jpeg_source_mgr_ptr) cinfo->src; dstream_t *loader = src->loader; size_t nb; nb = dstream_read (loader, src->buf, JPEG_BUFFER_SIZE, 0); if (nb <= 0) { /* this is a hack learned from gdk-pixbuf */ /* insert fake EOI marker, to try to salvage image * in case of malformed/incomplete input */ src->buf[0] = (JOCTET) 0xFF; src->buf[1] = (JOCTET) JPEG_EOI; nb = 2; } src->parent.next_input_byte = src->buf; src->parent.bytes_in_buffer = nb; return TRUE; } static void _gdip_source_stream_skip_input_data (j_decompress_ptr cinfo, long skipbytes) { gdip_stream_jpeg_source_mgr_ptr src = (gdip_stream_jpeg_source_mgr_ptr) cinfo->src; dstream_t *loader = src->loader; if (skipbytes > 0) { if (skipbytes > (long) src->parent.bytes_in_buffer) { skipbytes -= (long) src->parent.bytes_in_buffer; dstream_skip (loader, skipbytes); (void) _gdip_source_stream_fill_input_buffer (cinfo); } else { src->parent.next_input_byte += (size_t) skipbytes; src->parent.bytes_in_buffer -= (size_t) skipbytes; } } } static void _gdip_source_dummy_term (j_decompress_ptr cinfo) { /* nothing */ } static void _gdip_dest_stream_init (j_compress_ptr cinfo) { gdip_stream_jpeg_dest_mgr_ptr dest = (gdip_stream_jpeg_dest_mgr_ptr) cinfo->dest; dest->parent.next_output_byte = dest->buf; dest->parent.free_in_buffer = JPEG_BUFFER_SIZE; } static BOOL _gdip_dest_stream_empty_output_buffer (j_compress_ptr cinfo) { gdip_stream_jpeg_dest_mgr_ptr dest = (gdip_stream_jpeg_dest_mgr_ptr) cinfo->dest; dest->putBytesFunc (dest->buf, JPEG_BUFFER_SIZE); dest->parent.next_output_byte = dest->buf; dest->parent.free_in_buffer = JPEG_BUFFER_SIZE; return TRUE; } static void _gdip_dest_stream_term (j_compress_ptr cinfo) { gdip_stream_jpeg_dest_mgr_ptr dest = (gdip_stream_jpeg_dest_mgr_ptr) cinfo->dest; dest->putBytesFunc (dest->buf, JPEG_BUFFER_SIZE - dest->parent.free_in_buffer); } static GpStatus gdip_load_jpeg_image_internal (struct jpeg_source_mgr *src, GpImage **image) { struct jpeg_decompress_struct cinfo; struct gdip_jpeg_error_mgr jerr; GpBitmap *result; BYTE *destbuf; BYTE *destptr; BYTE *lines[4] = {NULL, NULL, NULL, NULL}; GpStatus status; int stride; unsigned long long int size; destbuf = NULL; result = NULL; cinfo.err = jpeg_std_error ((struct jpeg_error_mgr *) &jerr); jerr.parent.error_exit = _gdip_jpeg_error_exit; jerr.parent.output_message = _gdip_jpeg_output_message; if (sigsetjmp (jerr.setjmp_buffer, 1)) { /* Error occured during decompression */ status = OutOfMemory; goto error; } jpeg_create_decompress (&cinfo); cinfo.src = src; jpeg_read_header (&cinfo, TRUE); cinfo.do_fancy_upsampling = FALSE; cinfo.do_block_smoothing = FALSE; result = gdip_bitmap_new_with_frame (NULL, TRUE); if (!result) { status = OutOfMemory; goto error; } result->type = ImageTypeBitmap; result->active_bitmap->width = cinfo.image_width; result->active_bitmap->height = cinfo.image_height; result->active_bitmap->image_flags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize; if (cinfo.density_unit == 1) { /* dpi */ result->active_bitmap->dpi_horz = cinfo.X_density; result->active_bitmap->dpi_vert = cinfo.Y_density; } else if (cinfo.density_unit == 2) { /* dots/cm */ result->active_bitmap->dpi_horz = cinfo.X_density * 2.54; result->active_bitmap->dpi_vert = cinfo.Y_density * 2.54; } else { /* unknown density */ result->active_bitmap->dpi_horz = 0; result->active_bitmap->dpi_vert = 0; } if (result->active_bitmap->dpi_horz && result->active_bitmap->dpi_vert) result->active_bitmap->image_flags |= ImageFlagsHasRealDPI; if (cinfo.num_components == 1) { result->cairo_format = CAIRO_FORMAT_A8; result->active_bitmap->pixel_format = PixelFormat8bppIndexed; size = 1; } else if (cinfo.num_components == 3) { /* libjpeg gives us RGB for many formats and * we convert to RGB format when needed. JPEG * does not support alpha (transparency). */ result->cairo_format = CAIRO_FORMAT_ARGB32; result->active_bitmap->pixel_format = PixelFormat24bppRGB; size = 4; } else if (cinfo.num_components == 4) { result->cairo_format = CAIRO_FORMAT_ARGB32; result->active_bitmap->pixel_format = PixelFormat32bppRGB; size = 4; } else { status = InvalidParameter; goto error; } switch (cinfo.jpeg_color_space) { case JCS_GRAYSCALE: result->active_bitmap->image_flags |= ImageFlagsColorSpaceGRAY; if (cinfo.num_components == 1) { result->active_bitmap->palette = gdip_create_greyscale_palette (256); if (!result->active_bitmap->palette) { status = OutOfMemory; goto error; } } break; default: result->active_bitmap->image_flags |= ImageFlagsColorSpaceRGB; break; } size *= cinfo.image_width; /* stride is a (signed) _int_ and once multiplied by 4 it should hold a value that can be allocated by GdipAlloc * this effectively limits 'width' to 536870911 pixels */ if (size > G_MAXINT32) { status = OutOfMemory; goto error; } stride = result->active_bitmap->stride = size; /* Request cairo-compat output */ /* libjpeg can do only following conversions, * YCbCr => GRAYSCALE, YCbCr => RGB * GRAYSCALE => RGB, YCCK => CMYK. * Therefore, we convert YCbCr, GRAYSCALE to RGB and * YCCK to CMYK using the libjpeg. We convert CMYK * to RGB ourself. */ switch (cinfo.jpeg_color_space) { case JCS_GRAYSCALE: /* special case for indexed 256 greyscale images (bug #81552) */ if (cinfo.num_components == 1) { cinfo.out_color_space = JCS_GRAYSCALE; cinfo.out_color_components = 1; break; } /* else treat as RGB and */ /* fall through */ case JCS_RGB: case JCS_YCbCr: cinfo.out_color_space = JCS_RGB; cinfo.out_color_components = 3; break; case JCS_YCCK: case JCS_CMYK: cinfo.out_color_space = JCS_CMYK; cinfo.out_color_components = 4; break; default: /* Unsupported JPEG color space */ status = InvalidParameter; goto error; } jpeg_start_decompress (&cinfo); /* ensure total 'size' does not overflow an integer and fits inside our 2GB limit */ size *= cinfo.output_height; if (size > G_MAXINT32) { status = OutOfMemory; goto error; } destbuf = GdipAlloc (size); if (destbuf == NULL) { status = OutOfMemory; goto error; } destptr = destbuf; while (cinfo.output_scanline < cinfo.output_height) { int i; int nlines; for (i = 0; i < cinfo.rec_outbuf_height; i++) { lines[i] = destptr; destptr += stride; } nlines = jpeg_read_scanlines (&cinfo, lines, cinfo.rec_outbuf_height); /* If the out colorspace is not RBG, we need to convert it to RBG. */ if (cinfo.out_color_space == JCS_CMYK) { int i, j; for (i = 0; i < cinfo.rec_outbuf_height; i++) { BYTE *lineptr = lines [i]; for (j = 0; j < cinfo.output_width; j++) { JOCTET c, m, y, k; JOCTET r, g, b; c = lineptr [0]; m = lineptr [1]; y = lineptr [2]; k = lineptr [3]; /* Adobe photoshop seems to have a bug and inverts the CMYK data. * We might need to remove this check, if Adobe decides to fix it. */ if (cinfo.saw_Adobe_marker) { b = (k * c) / 255; g = (k * m) / 255; r = (k * y) / 255; } else { b = (255 - k) * (255 - c) / 255; g = (255 - k) * (255 - m) / 255; r = (255 - k) * (255 - y) / 255; } set_pixel_bgra(lineptr, 0, b, g, r, 0xff); lineptr += 4; } } } else if (cinfo.out_color_components == 1) { /* no decoding required, we already have all we need */ } else { int width = result->active_bitmap->width; for (i = 0; i < nlines; i++) { int j; BYTE *inptr, *outptr; inptr = lines[i] + (width * 3); outptr = lines[i] + stride; /* this loop can't work for the last two lines as it will overwrite values it requires */ for (j = 0; j < width - 2; j++) { /* Note the swapping of R and B, to get ARGB from what * looks like BGR data. */ inptr -= 3; outptr -= 4; g_assert (inptr && outptr); set_pixel_bgra(outptr, 0, inptr[2], inptr[1], inptr[0], 0xff); } /* keep last 2 lines in temporary variables */ if (width > 1) { BYTE b2, g2, r2, b1, g1, r1; inptr -= 3; g_assert (inptr); b2 = inptr[2]; g2 = inptr[1]; r2 = inptr[0]; inptr -= 3; g_assert (inptr); b1 = inptr[2]; g1 = inptr[1]; r1 = inptr[0]; outptr -= 4; g_assert (outptr); set_pixel_bgra(outptr, 0, b2, g2, r2, 0xff); outptr -= 4; set_pixel_bgra(outptr, 0, b1, g1, r1, 0xff); } else if (width > 0) { /* in case the jpeg has a single line */ BYTE b, g, r; inptr -= 3; g_assert (inptr); b = inptr[2]; g = inptr[1]; r = inptr[0]; outptr -= 4; g_assert (outptr); set_pixel_bgra(outptr, 0, b, g, r, 0xff); } } } } jpeg_finish_decompress (&cinfo); jpeg_destroy_decompress (&cinfo); result->active_bitmap->scan0 = destbuf; result->active_bitmap->reserved = GBD_OWN_SCAN0; *image = result; return Ok; error: /* coverity[dead_error_line] */ if (destbuf != NULL) { GdipFree (destbuf); } if (result != NULL) { gdip_bitmap_dispose (result); } *image = NULL; return status; } #ifdef HAVE_LIBEXIF static void add_properties_from_entry (ExifEntry *entry, void *user_data) { ActiveBitmapData *bitmap_data = (ActiveBitmapData *) user_data; gdip_bitmapdata_property_add (bitmap_data, entry->tag, entry->size, entry->format, entry->data); } static void add_properties_from_content (ExifContent *content, void *user_data) { exif_content_foreach_entry (content, add_properties_from_entry, user_data); } static void load_exif_data (ExifData *exif_data, GpImage *image) { ActiveBitmapData *bitmap; if (exif_data == NULL) return; bitmap = image->active_bitmap; exif_data_foreach_content (exif_data, add_properties_from_content, bitmap); /* thumbnail */ if (exif_data->size != 0) { gdip_bitmapdata_property_add (bitmap, PropertyTagThumbnailData, exif_data->size, PropertyTagTypeByte, exif_data->data); } exif_data_unref (exif_data); } #endif GpStatus gdip_load_jpeg_image_from_file (FILE *fp, const char *filename, GpImage **image) { GpStatus st; gdip_stdio_jpeg_source_mgr_ptr src; src = (gdip_stdio_jpeg_source_mgr_ptr) GdipAlloc (sizeof (struct gdip_stdio_jpeg_source_mgr)); if (src == NULL) { return OutOfMemory; } src->buf = GdipAlloc (JPEG_BUFFER_SIZE * sizeof(JOCTET)); if (src->buf == NULL) { GdipFree(src); return OutOfMemory; } src->parent.init_source = _gdip_source_dummy_init; src->parent.fill_input_buffer = (boolean(*)(j_decompress_ptr))_gdip_source_stdio_fill_input_buffer; src->parent.skip_input_data = _gdip_source_stdio_skip_input_data; src->parent.resync_to_restart = jpeg_resync_to_restart; src->parent.term_source = _gdip_source_dummy_term; src->parent.bytes_in_buffer = 0; src->parent.next_input_byte = NULL; src->infp = fp; st = gdip_load_jpeg_image_internal ((struct jpeg_source_mgr *) src, image); GdipFree (src->buf); GdipFree (src); #ifdef HAVE_LIBEXIF if (st == Ok) { load_exif_data (exif_data_new_from_file (filename), *image); } #endif return st; } GpStatus gdip_load_jpeg_image_from_stream_delegate (dstream_t *loader, GpImage **image) { GpStatus st; #ifdef HAVE_LIBEXIF unsigned int length; BYTE *ptr; #endif gdip_stream_jpeg_source_mgr_ptr src; src = (gdip_stream_jpeg_source_mgr_ptr) GdipAlloc (sizeof (struct gdip_stream_jpeg_source_mgr)); if (!src) { return OutOfMemory; } src->buf = GdipAlloc (JPEG_BUFFER_SIZE * sizeof(JOCTET)); if (!src->buf) { GdipFree (src); return OutOfMemory; } src->parent.init_source = _gdip_source_dummy_init; src->parent.fill_input_buffer = (boolean(*)(j_decompress_ptr))_gdip_source_stream_fill_input_buffer; src->parent.skip_input_data = _gdip_source_stream_skip_input_data; src->parent.resync_to_restart = jpeg_resync_to_restart; src->parent.term_source = _gdip_source_dummy_init; src->parent.bytes_in_buffer = 0; src->parent.next_input_byte = NULL; src->loader = loader; #ifdef HAVE_LIBEXIF dstream_keep_exif_buffer (loader); #endif st = gdip_load_jpeg_image_internal ((struct jpeg_source_mgr *) src, image); GdipFree (src->buf); GdipFree (src); #ifdef HAVE_LIBEXIF if (st == Ok){ dstream_get_exif_buffer (loader, &ptr, &length); load_exif_data (exif_data_new_from_data (ptr, length), *image); } #endif return st; } static GpStatus gdip_save_jpeg_image_internal (FILE *fp, PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { gdip_stream_jpeg_dest_mgr_ptr dest = NULL; struct jpeg_compress_struct cinfo; struct gdip_jpeg_error_mgr jerr; const EncoderParameter *param; JOCTET *scanline = NULL; int need_argb_conversion = 0; GpStatus status; /* Verify that we can support this pixel format */ switch (image->active_bitmap->pixel_format) { case PixelFormat32bppARGB: case PixelFormat32bppPARGB: case PixelFormat32bppRGB: case PixelFormat24bppRGB: break; case PixelFormat1bppIndexed: case PixelFormat4bppIndexed: case PixelFormat8bppIndexed: image = gdip_convert_indexed_to_rgb (image); if (image == NULL) { return OutOfMemory; } /* We recurse, makes flow and cleanup more straightforward */ status = gdip_save_jpeg_image_internal(fp, putBytesFunc, image, params); return status; default: status = InvalidParameter; goto error; } cinfo.err = jpeg_std_error ((struct jpeg_error_mgr *) &jerr); jerr.parent.error_exit = _gdip_jpeg_error_exit; jerr.parent.output_message = _gdip_jpeg_output_message; if (sigsetjmp (jerr.setjmp_buffer, 1)) { status = GenericError; goto error; } jpeg_create_compress (&cinfo); if (fp != NULL) { jpeg_stdio_dest (&cinfo, fp); } else { dest = GdipAlloc (sizeof (struct gdip_stream_jpeg_dest_mgr)); if (!dest) { status = OutOfMemory; goto error; } dest->parent.init_destination = _gdip_dest_stream_init; dest->parent.empty_output_buffer = (boolean(*)(j_compress_ptr))_gdip_dest_stream_empty_output_buffer; dest->parent.term_destination = _gdip_dest_stream_term; dest->putBytesFunc = putBytesFunc; dest->buf = GdipAlloc (JPEG_BUFFER_SIZE); if (!dest->buf) { status = OutOfMemory; goto error; } cinfo.dest = (struct jpeg_destination_mgr *) dest; } cinfo.image_width = image->active_bitmap->width; cinfo.image_height = image->active_bitmap->height; if (gdip_get_pixel_format_components (image->active_bitmap->pixel_format) == 3) { cinfo.in_color_space = JCS_RGB; cinfo.input_components = 3; if (image->active_bitmap->pixel_format == PixelFormat24bppRGB) { need_argb_conversion = 1; } else { need_argb_conversion = 0; } } else if (gdip_get_pixel_format_components (image->active_bitmap->pixel_format) == 4) { cinfo.in_color_space = JCS_RGB; cinfo.input_components = 3; need_argb_conversion = 1; } else if (gdip_get_pixel_format_components (image->active_bitmap->pixel_format) == 1) { cinfo.in_color_space = JCS_RGB; cinfo.input_components = 1; need_argb_conversion = 1; /* do this conversion */ } jpeg_set_defaults (&cinfo); if (gdip_get_pixel_format_components (image->active_bitmap->pixel_format) == 1) { jpeg_set_colorspace (&cinfo, JCS_GRAYSCALE); } /* Handle encoding parameters */ if (params) { param = gdip_find_encoder_parameter (params, &GdipEncoderQuality); if (param != NULL) { int quality; if (param->Type == EncoderParameterValueTypeLong) { quality = * (int *) param->Value; } else if (param->Type == EncoderParameterValueTypeLongRange) { const int *pval = (int *) param->Value; quality = (pval[0] + pval[1]) / 2; } else if (param->Type == EncoderParameterValueTypeByte) { quality = *(BYTE*)param->Value; } else if (param->Type == EncoderParameterValueTypeShort) { quality = *(short *)param->Value; } else { /* Should we report an error here? */ quality = 80; } jpeg_set_quality (&cinfo, quality, 0); } } jpeg_start_compress (&cinfo, TRUE); if (need_argb_conversion) { BYTE *inptr, *outptr; int i, j; scanline = GdipAlloc (image->active_bitmap->stride); if (!scanline) { status = OutOfMemory; goto error; } for (i = 0; i < image->active_bitmap->height; i++) { inptr = image->active_bitmap->scan0 + (i * image->active_bitmap->stride); outptr = scanline; for (j = 0; j < image->active_bitmap->width; j++) { #ifdef WORDS_BIGENDIAN *outptr++ = inptr[1]; /* R */ *outptr++ = inptr[2]; /* G */ *outptr++ = inptr[3]; /* B */ #else *outptr++ = inptr[2]; /* R */ *outptr++ = inptr[1]; /* G */ *outptr++ = inptr[0]; /* B */ #endif inptr += 4; /* skip RGB+A */ } jpeg_write_scanlines (&cinfo, &scanline, 1); } GdipFree (scanline); scanline = NULL; } else { int i; for (i = 0; i < image->active_bitmap->height; i++) { scanline = image->active_bitmap->scan0 + (i * image->active_bitmap->stride); jpeg_write_scanlines (&cinfo, &scanline, 1); } } jpeg_finish_compress (&cinfo); jpeg_destroy_compress (&cinfo); if (dest != NULL) { if (dest->buf != NULL) { GdipFree (dest->buf); } GdipFree (dest); } return Ok; error: jpeg_destroy_compress (&cinfo); /* coverity[dead_error_line] */ if (dest != NULL) { if (dest->buf != NULL) { GdipFree (dest->buf); } GdipFree (dest); } if (scanline != NULL && need_argb_conversion) { GdipFree (scanline); } return status; } GpStatus gdip_save_jpeg_image_to_file (FILE *fp, GpImage *image, GDIPCONST EncoderParameters *params) { return gdip_save_jpeg_image_internal (fp, NULL, image, params); } GpStatus gdip_save_jpeg_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return gdip_save_jpeg_image_internal (NULL, putBytesFunc, image, params); } #else /* No libjpeg */ #include "image.h" #include "dstream.h" ImageCodecInfo * gdip_getcodecinfo_jpeg () { return NULL; } GpStatus gdip_load_jpeg_image_from_file (FILE *fp, const char *filename, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_save_jpeg_image_to_file (FILE *fp, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } GpStatus gdip_load_jpeg_image_from_stream_delegate (dstream_t *loader, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_save_jpeg_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } #endif GpStatus gdip_fill_encoder_parameter_list_jpeg (EncoderParameters *buffer, UINT size) { JpegEncoderParameters *jpegBuffer = (JpegEncoderParameters *) buffer; if (!buffer || size != sizeof (JpegEncoderParameters)) return InvalidParameter; jpegBuffer->count = 5; jpegBuffer->transformation.Guid = GdipEncoderTransformation; jpegBuffer->transformation.NumberOfValues = 5; jpegBuffer->transformation.Type = EncoderParameterValueTypeLong; jpegBuffer->transformationData[0] = EncoderValueTransformRotate90; jpegBuffer->transformationData[1] = EncoderValueTransformRotate180; jpegBuffer->transformationData[2] = EncoderValueTransformRotate270; jpegBuffer->transformationData[3] = EncoderValueTransformFlipHorizontal; jpegBuffer->transformationData[4] = EncoderValueTransformFlipVertical; jpegBuffer->transformation.Value = &jpegBuffer->transformationData; jpegBuffer->quality.Guid = GdipEncoderQuality; jpegBuffer->quality.NumberOfValues = 1; jpegBuffer->quality.Type = EncoderParameterValueTypeLongRange; jpegBuffer->qualityRange[0] = 0; jpegBuffer->qualityRange[1] = 100; jpegBuffer->quality.Value = &jpegBuffer->qualityRange; jpegBuffer->luminanceTable.Guid = GdipEncoderLuminanceTable; jpegBuffer->luminanceTable.NumberOfValues = 0; jpegBuffer->luminanceTable.Type = EncoderParameterValueTypeShort; jpegBuffer->luminanceTable.Value = NULL; jpegBuffer->chrominanceTable.Guid = GdipEncoderChrominanceTable; jpegBuffer->chrominanceTable.NumberOfValues = 0; jpegBuffer->chrominanceTable.Type = EncoderParameterValueTypeShort; jpegBuffer->chrominanceTable.Value = NULL; jpegBuffer->imageItems.Guid = GdipEncoderImageItems; jpegBuffer->imageItems.NumberOfValues = 0; jpegBuffer->imageItems.Type = 9; // Undocumented type. jpegBuffer->imageItems.Value = NULL; return Ok; } libgdiplus-6.0.4+dfsg/src/font.h0000644000175000017500000000560713542674535017252 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __FONT_H__ #define __FONT_H__ /* Font public API (only!) */ GpStatus WINGDIPAPI GdipCreateFont (GDIPCONST GpFontFamily *family, REAL emSize, INT style, Unit unit, GpFont **font); GpStatus WINGDIPAPI GdipCreateFontFromDC (HDC hdc, GpFont **font); GpStatus WINGDIPAPI GdipCreateFontFromLogfontA (HDC hdc, GDIPCONST LOGFONTA *logfont, GpFont **font); GpStatus WINGDIPAPI GdipCreateFontFromLogfontW (HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font); GpStatus WINGDIPAPI GdipCloneFont (GpFont *font, GpFont **cloneFont); GpStatus WINGDIPAPI GdipDeleteFont (GpFont *font); GpStatus WINGDIPAPI GdipGetLogFontA (GpFont *font, GpGraphics *graphics, LOGFONTA *logfontA); GpStatus WINGDIPAPI GdipGetLogFontW (GpFont *font, GpGraphics *graphics, LOGFONTW *logfontW); GpStatus WINGDIPAPI GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height); GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, REAL dpi, REAL *height); GpStatus WINGDIPAPI GdipGetFontSize (GpFont *font, REAL *size); GpStatus WINGDIPAPI GdipGetFontStyle (GpFont *font, INT *style); GpStatus WINGDIPAPI GdipGetFontUnit (GpFont *font, Unit *unit); GpStatus WINGDIPAPI GdipGetFamily (GpFont *font, GpFontFamily **family); /* libgdiplus extra API (not availble in MSGDI+ but exported from libgdiplus) */ GpStatus WINGDIPAPI GdipCreateFontFromHfontA (HFONT hfont, GpFont **font, void *lf); #endif libgdiplus-6.0.4+dfsg/src/font-private.h0000644000175000017500000000472713542674535020724 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __FONT_PRIVATE_H__ #define __FONT_PRIVATE_H__ #include "gdiplus-private.h" #ifdef USE_PANGO_RENDERING #include #include #include #endif struct _Font { float sizeInPixels; FontStyle style; unsigned char* face; GpFontFamily *family; float emSize; GpUnit unit; #ifdef USE_PANGO_RENDERING PangoFontDescription *pango; #else cairo_font_face_t *cairofnt; #endif }; GpStatus gdip_create_font_without_validation (GDIPCONST GpFontFamily *family, REAL emSize, INT style, Unit unit, GpFont **font); void gdip_font_clear_pattern_cache (void) GDIP_INTERNAL; void gdip_delete_system_fonts (void) GDIP_INTERNAL; #ifdef USE_PANGO_RENDERING PangoFontDescription* gdip_get_pango_font_description (GpFont *font); #else cairo_font_face_t* gdip_get_cairo_font_face (GpFont *font); #endif #include "font.h" #endif libgdiplus-6.0.4+dfsg/src/customlinecap.c0000644000175000017500000002641713542674535021147 0ustar directhexdirecthex/* * customlinecap.c * * Copyright (C) Novell, Inc. 2003-2004. * * 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. * * Author: * Ravindra (rkumar@novell.com) * * Copyright (C) 2004 Novell, Inc. http://www.novell.com */ #include "customlinecap-private.h" #include "general-private.h" #include "graphics-path-private.h" #include "graphics-private.h" #include "graphics-cairo-private.h" static GpStatus gdip_custom_linecap_setup (GpGraphics *graphics, GpCustomLineCap *cap); static GpStatus gdip_custom_linecap_clone_cap (GpCustomLineCap *cap, GpCustomLineCap **clonedCap); static GpStatus gdip_custom_linecap_destroy (GpCustomLineCap *cap); static GpStatus gdip_custom_linecap_draw (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *cap, float x, float y, float otherend_x, float otherend_y); /* * we have a single copy of vtable for * all instances of custom linecap. */ static CapClass vtable = { CustomLineCapTypeDefault, gdip_custom_linecap_setup, gdip_custom_linecap_clone_cap, gdip_custom_linecap_destroy, gdip_custom_linecap_draw }; void gdip_custom_linecap_init (GpCustomLineCap *cap, CapClass *vt) { cap->vtable = vt; cap->base_cap = LineCapTriangle; cap->start_cap = LineCapFlat; cap->end_cap = LineCapFlat; cap->stroke_join = LineJoinMiter; cap->base_inset = 0.0; cap->width_scale = 1.0; cap->fill_path = NULL; cap->stroke_path = NULL; } static GpCustomLineCap* gdip_custom_linecap_new (void) { GpCustomLineCap *result = (GpCustomLineCap *) GdipAlloc (sizeof (GpCustomLineCap)); if (result) gdip_custom_linecap_init (result, &vtable); return result; } GpStatus gdip_custom_linecap_clone_cap (GpCustomLineCap *cap, GpCustomLineCap **clonedCap) { GpCustomLineCap *newcap; GpPath *fillpath = NULL, *strokepath = NULL; if (!cap || !clonedCap) return InvalidParameter; newcap = (GpCustomLineCap *) GdipAlloc (sizeof (GpCustomLineCap)); if (!newcap) return OutOfMemory; newcap->vtable = cap->vtable; newcap->base_cap = cap->base_cap; newcap->start_cap = cap->start_cap; newcap->end_cap = cap->end_cap; newcap->stroke_join = cap->stroke_join; newcap->base_inset = cap->base_inset; newcap->width_scale = cap->width_scale; if (cap->fill_path) { if (GdipClonePath (cap->fill_path, &fillpath) != Ok) { if (fillpath != NULL) GdipFree (fillpath); GdipFree (newcap); return OutOfMemory; } } newcap->fill_path = fillpath; if (cap->stroke_path) { if (GdipClonePath (cap->stroke_path, &strokepath) != Ok) { if (strokepath != NULL) GdipFree (strokepath); GdipFree (fillpath); GdipFree (newcap); return OutOfMemory; } } newcap->stroke_path = strokepath; *clonedCap = newcap; return Ok; } GpStatus gdip_custom_linecap_destroy (GpCustomLineCap *cap) { if (!cap) return InvalidParameter; if (cap->fill_path) { GdipDeletePath (cap->fill_path); cap->fill_path = NULL; } if (cap->stroke_path) { GdipDeletePath (cap->stroke_path); cap->stroke_path = NULL; } GdipFree (cap); return Ok; } /* MonoTODO: Implement this function when cairo supports cairo_stroke_path API */ static GpStatus gdip_custom_linecap_setup (GpGraphics *graphics, GpCustomLineCap *customCap) { if (!graphics || !customCap) return InvalidParameter; return NotImplemented; } double gdip_custom_linecap_angle (float x, float y, float otherend_x, float otherend_y) { float slope; double angle; if (x == otherend_x) { slope = 0; if (y < otherend_y) { angle = PI; } else { angle = PI * 2; } } else if (y == otherend_y) { slope = 0; if (x < otherend_x) { angle = PI/2; } else { angle = PI/-2; } } else { if (y < otherend_y) { slope = (otherend_y - y) / (otherend_x - x); if (x < otherend_x) { angle = PI/2; } else { angle = PI/-2; } } else { slope = (otherend_x - x) / (y - otherend_y); angle = 0; } } angle += atan (slope); return angle; } GpStatus gdip_custom_linecap_draw (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *customCap, float x, float y, float otherend_x, float otherend_y) { double angle; int points; int i, idx = 0; float penwidth; if (!graphics || !pen || !customCap) return InvalidParameter; penwidth = pen->width; angle = gdip_custom_linecap_angle (x, y, otherend_x, otherend_y); cairo_save (graphics->ct); /* FIXME: handle base_inset (including set/get!) */ cairo_translate (graphics->ct, x, y); cairo_rotate (graphics->ct, angle); if (customCap->stroke_path) { GpPath *path = customCap->stroke_path; points = path->count; for (i = 0; i < points; i++) { /* Adapted from gdip_plot_path() */ GpPointF point = path->points[i]; BYTE type = path->types[i]; GpPointF pts [3]; /* mask the bits so that we get only the type value not the other flags */ switch (type & PathPointTypePathTypeMask) { case PathPointTypeStart: gdip_cairo_move_to (graphics, (double)point.X * penwidth, (double)point.Y * penwidth, TRUE, TRUE); break; case PathPointTypeLine: gdip_cairo_line_to (graphics, (double)point.X * penwidth, (double)point.Y * penwidth, TRUE, TRUE); break; case PathPointTypeBezier: /* make sure we only add at most 3 points to pts */ if (idx < 3) { pts [idx] = point; idx ++; } /* once we've added 3 pts, we can draw the curve */ if (idx == 3) { gdip_cairo_curve_to (graphics, (double)pts[0].X * penwidth, (double)pts[0].Y * penwidth, (double)pts[1].X * penwidth, (double)pts[1].Y * penwidth, (double)pts[2].X * penwidth, (double)pts[2].Y * penwidth, TRUE, TRUE); idx = 0; } break; default: g_warning ("Unknown PathPointType %d", type); return NotImplemented; } /* close the subpath */ if (type & PathPointTypeCloseSubpath) { cairo_close_path (graphics->ct); } } gdip_pen_setup (graphics, pen); cairo_stroke (graphics->ct); gdip_cairo_set_matrix (graphics, graphics->copy_of_ctm); } /* FIXME: handle fill_path */ cairo_restore (graphics->ct); return gdip_get_status (cairo_status (graphics->ct)); } /* this setup function gets called from pen */ GpStatus gdip_linecap_setup (GpGraphics *graphics, GpCustomLineCap *customCap) { if (!graphics || !customCap) return InvalidParameter; return customCap->vtable->setup (graphics, customCap); } /* this draw function gets called from pen */ GpStatus gdip_linecap_draw (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *customCap, float x, float y, float otherend_x, float otherend_y) { if (!graphics || !pen || !customCap) return InvalidParameter; return customCap->vtable->draw (graphics, pen, customCap, x, y, otherend_x, otherend_y); } /* CustomLineCap functions */ // coverity[+alloc : arg-*4] GpStatus WINGDIPAPI GdipCreateCustomLineCap (GpPath *fillPath, GpPath *strokePath, GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap) { GpStatus status; GpCustomLineCap *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if ((!fillPath && !strokePath) || !customCap) return InvalidParameter; result = gdip_custom_linecap_new (); if (!result) return OutOfMemory; if (fillPath) { status = GdipClonePath (fillPath, &result->fill_path); if (status != Ok) { GdipDeleteCustomLineCap (result); return status; } } if (strokePath) { status = GdipClonePath (strokePath, &result->stroke_path); if (status != Ok) { GdipDeleteCustomLineCap (result); return status; } } if (baseCap >= LineCapFlat && baseCap <= LineCapTriangle) { result->base_cap = baseCap; } else { result->base_cap = LineCapFlat; } result->base_inset = baseInset; *customCap = result; return Ok; } GpStatus WINGDIPAPI GdipDeleteCustomLineCap (GpCustomLineCap *customCap) { if (!customCap) return InvalidParameter; return customCap->vtable->destroy (customCap); } GpStatus WINGDIPAPI GdipCloneCustomLineCap (GpCustomLineCap *customCap, GpCustomLineCap **clonedCap) { if (!customCap || !clonedCap) return InvalidParameter; return customCap->vtable->clone_cap (customCap, clonedCap); } GpStatus WINGDIPAPI GdipGetCustomLineCapType (GpCustomLineCap *customCap, CustomLineCapType *capType) { if (!customCap || !capType) return InvalidParameter; *capType = customCap->vtable->type; return Ok; } GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps (GpCustomLineCap *customCap, GpLineCap startCap, GpLineCap endCap) { if (!customCap || startCap < LineCapFlat || startCap > LineCapTriangle || endCap < LineCapFlat || endCap > LineCapTriangle) return InvalidParameter; customCap->start_cap = startCap; customCap->end_cap = endCap; return Ok; } GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeCaps (GpCustomLineCap *customCap, GpLineCap *startCap, GpLineCap *endCap) { if (!customCap || !startCap || !endCap) return InvalidParameter; *startCap = customCap->start_cap; *endCap = customCap->end_cap; return Ok; } GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin (GpCustomLineCap *customCap, GpLineJoin lineJoin) { if (!customCap) return InvalidParameter; customCap->stroke_join = lineJoin; return Ok; } GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin (GpCustomLineCap *customCap, GpLineJoin *lineJoin) { if (!customCap || !lineJoin) return InvalidParameter; *lineJoin = customCap->stroke_join; return Ok; } GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap (GpCustomLineCap *customCap, GpLineCap baseCap) { if (!customCap || baseCap > LineCapTriangle) return InvalidParameter; customCap->base_cap = baseCap; return Ok; } GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap (GpCustomLineCap *customCap, GpLineCap *baseCap) { if (!customCap || !baseCap) return InvalidParameter; *baseCap = customCap->base_cap; return Ok; } GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset (GpCustomLineCap *customCap, REAL inset) { if (!customCap) return InvalidParameter; customCap->base_inset = inset; return Ok; } GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset (GpCustomLineCap *customCap, REAL *inset) { if (!customCap || !inset) return InvalidParameter; *inset = customCap->base_inset; return Ok; } GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale (GpCustomLineCap *customCap, REAL widthScale) { if (!customCap) return InvalidParameter; customCap->width_scale = widthScale; return Ok; } GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale (GpCustomLineCap *customCap, REAL *widthScale) { if (!customCap || !widthScale) return InvalidParameter; *widthScale = customCap->width_scale; return Ok; } libgdiplus-6.0.4+dfsg/src/stringformat.c0000644000175000017500000002537113542674535021016 0ustar directhexdirecthex/* * Copyright (C) 2004 Ximian inc. http://www.ximian.com * Copyright (C) 2004,2006-2007 Novell Inc. http://www.novell.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. * * Authors: * Jordi Mas i Hernandez , 2004 * Ravindra * Sebastien Pouliot * */ #include "stringformat-private.h" #include "general-private.h" static GpStringFormat stringFormatDefault; static GpStringFormat stringFormatTypographic; static void gdip_string_format_clear (GpStringFormat *format) { if (format->tabStops) { GdipFree (format->tabStops); format->tabStops = NULL; } if (format->charRanges) { GdipFree (format->charRanges); format->charRanges = NULL; } } static void gdip_string_format_init (GpStringFormat *result) { result->alignment = StringAlignmentNear; result->lineAlignment = StringAlignmentNear; result->hotkeyPrefix = HotkeyPrefixNone; result->formatFlags = 0; result->trimming = StringTrimmingCharacter; result->substitute = StringDigitSubstituteUser; result->language = 0; result->firstTabOffset = 0; result->tabStops = NULL; result->numtabStops = 0; result->charRanges = NULL; result->charRangeCount = 0; } void gdip_create_generic_stringformats () { gdip_string_format_init (&stringFormatDefault); gdip_string_format_init (&stringFormatTypographic); stringFormatTypographic.formatFlags = StringFormatFlagsNoFitBlackBox | StringFormatFlagsLineLimit | StringFormatFlagsNoClip; stringFormatTypographic.trimming = StringTrimmingNone; } void gdip_delete_generic_stringformats () { gdip_string_format_clear (&stringFormatDefault); gdip_string_format_clear (&stringFormatTypographic); } static GpStringFormat * gdip_string_format_new () { GpStringFormat *result = GdipAlloc (sizeof (GpStringFormat)); if (result) gdip_string_format_init (result); return result; } /* coverity[+alloc : arg-*2] */ GpStatus WINGDIPAPI GdipCreateStringFormat (INT formatAttributes, LANGID language, GpStringFormat **format) { GpStringFormat *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!format) return InvalidParameter; result = gdip_string_format_new (); if (!result) { *format = NULL; return OutOfMemory; } result->formatFlags = formatAttributes; *format = result; return Ok; } /* coverity[+alloc : arg-*0] */ GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault (GpStringFormat **format) { if (!format) return InvalidParameter; if (!gdiplusInitialized) return GdiplusNotInitialized; *format = &stringFormatDefault; return Ok; } /* coverity[+alloc : arg-*0] */ GpStatus WINGDIPAPI GdipStringFormatGetGenericTypographic (GpStringFormat **format) { if (!format) return InvalidParameter; if (!gdiplusInitialized) return GdiplusNotInitialized; *format = &stringFormatTypographic; return Ok; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipCloneStringFormat (GDIPCONST GpStringFormat *format, GpStringFormat **newFormat) { GpStringFormat *result; if (!format || !newFormat) return InvalidParameter; result = gdip_string_format_new (); if (!result) goto error; result->alignment = format->alignment; result->lineAlignment = format->lineAlignment; result->hotkeyPrefix = format->hotkeyPrefix; result->formatFlags = format->formatFlags; result->trimming = format->trimming; result->substitute = format->substitute; result->language = format->language; result->firstTabOffset = format->firstTabOffset; result->numtabStops = format->numtabStops; result->charRangeCount = format->charRangeCount; /* Create a copy of tab stops for the clone */ result->tabStops = (float *) GdipAlloc (sizeof (float) * format->numtabStops); if (!result->tabStops) goto error; memcpy (result->tabStops, format->tabStops, format->numtabStops * sizeof (float)); /* Create a copy of char ranges for the clone */ result->charRanges = (CharacterRange *) GdipAlloc (format->charRangeCount * sizeof (CharacterRange)); if (result->charRanges == NULL) goto error; memcpy (result->charRanges, format->charRanges, format->charRangeCount * sizeof (CharacterRange)); *newFormat = result; return Ok; error: if (result) GdipDeleteStringFormat (result); *newFormat = NULL; return OutOfMemory; } GpStatus WINGDIPAPI GdipDeleteStringFormat (GpStringFormat *format) { if (!format) return InvalidParameter; // These are singletons cleared on shutdown. if (format == &stringFormatDefault || format == &stringFormatTypographic) return Ok; gdip_string_format_clear (format); GdipFree (format); return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatAlign (GpStringFormat *format, StringAlignment align) { if (!format || align < StringAlignmentNear || align > StringAlignmentFar) return InvalidParameter; format->alignment = align; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatAlign (GDIPCONST GpStringFormat *format, StringAlignment *align) { if (!format || !align) return InvalidParameter; *align = format->alignment; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatLineAlign (GpStringFormat *format, StringAlignment align) { if (!format || align < StringAlignmentNear || align > StringAlignmentFar) return InvalidParameter; format->lineAlignment = align; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatLineAlign (GDIPCONST GpStringFormat *format, StringAlignment *align) { if (!format || !align) return InvalidParameter; *align = format->lineAlignment; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix (GpStringFormat *format, INT hotkeyPrefix) { if (!format || hotkeyPrefix < HotkeyPrefixNone || hotkeyPrefix > HotkeyPrefixHide) return InvalidParameter; format->hotkeyPrefix = hotkeyPrefix; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix (GDIPCONST GpStringFormat *format, INT *hotkeyPrefix) { if (!format || !hotkeyPrefix) return InvalidParameter; *hotkeyPrefix = format->hotkeyPrefix; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatFlags (GpStringFormat *format, INT flags) { if (!format) return InvalidParameter; format->formatFlags = flags; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatFlags (GDIPCONST GpStringFormat *format, INT *flags) { if (!format || !flags) return InvalidParameter; *flags = format->formatFlags; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatTrimming (GpStringFormat *format, StringTrimming trimming) { if (!format || trimming < StringTrimmingNone || trimming > StringTrimmingEllipsisPath) return InvalidParameter; format->trimming = trimming; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatTrimming (GDIPCONST GpStringFormat *format, StringTrimming *trimming) { if (!format || !trimming) return InvalidParameter; *trimming = format->trimming; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatTabStops (GpStringFormat *format, REAL firstTabOffset, INT count, GDIPCONST REAL *tabStops) { REAL *tabStopsResult; if (!format || !tabStops) return InvalidParameter; if (count <= 0) return Ok; if (firstTabOffset < 0) return NotImplemented; for (int i = 0; i < count; i++) { if (tabStops[i] < 0) return NotImplemented; } /* Avoid allocating memory if the count is the same. */ if (count != format->numtabStops) { tabStopsResult = GdipAlloc (count * sizeof (REAL)); if (!tabStopsResult) return OutOfMemory; if (format->tabStops) GdipFree (format->tabStops); format->tabStops = tabStopsResult; } format->firstTabOffset = firstTabOffset; format->numtabStops = count; memcpy (format->tabStops, tabStops, count * sizeof (REAL)); return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution (GDIPCONST GpStringFormat *format, LANGID *language, StringDigitSubstitute *substitute) { if (!format) return InvalidParameter; if (language) *language = format->language; if (substitute) *substitute = format->substitute; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution (GpStringFormat *format, LANGID language, StringDigitSubstitute substitute) { if (!format) return InvalidParameter; format->language = language; format->substitute = substitute; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatTabStopCount (GDIPCONST GpStringFormat *format, INT *count) { if (!format || !count) return InvalidParameter; *count = format->numtabStops; return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatTabStops (GDIPCONST GpStringFormat *format, INT count, REAL *firstTabOffset, REAL *tabStops) { int elems; if (!format || !firstTabOffset || !tabStops || count < 0) return InvalidParameter; elems = countnumtabStops ? count : format->numtabStops; *firstTabOffset = format->firstTabOffset; memcpy (tabStops, format->tabStops, elems * sizeof (REAL)); return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount (GDIPCONST GpStringFormat *format, INT *count) { if (! format || !count) return InvalidParameter; *count = format->charRangeCount; return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges (GpStringFormat *format, INT rangeCount, GDIPCONST CharacterRange *ranges) { CharacterRange *rangesResult = NULL; if (!format || !ranges) return InvalidParameter; if (rangeCount > 32) return ValueOverflow; if (rangeCount > 0) { if (format->charRangeCount == rangeCount) { /* Avoid allocating memory if the count is the same. */ rangesResult = format->charRanges; } else { rangesResult = (CharacterRange *) GdipAlloc (rangeCount * sizeof (CharacterRange)); if (!rangesResult) return OutOfMemory; } memcpy (rangesResult, ranges, rangeCount * sizeof (CharacterRange)); } else { rangesResult = NULL; rangeCount = 0; } if (format->charRanges && format->charRangeCount != rangeCount) { GdipFree (format->charRanges); format->charRanges = NULL; } format->charRanges = rangesResult; format->charRangeCount = rangeCount; return Ok; } libgdiplus-6.0.4+dfsg/src/graphics-private.h0000644000175000017500000001504413542674535021550 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * Frederik Carlier * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __GRAPHICS_PRIVATE_H__ #define __GRAPHICS_PRIVATE_H__ #include "gdiplus-private.h" #include "imageattributes-private.h" #include "pen-private.h" #include "region-private.h" #include "metafile.h" #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1,6,0) #define CAIRO_AA_OFFSET_X 1 #define CAIRO_AA_OFFSET_Y 0.5 #else #define CAIRO_AA_OFFSET_X 0.5 #define CAIRO_AA_OFFSET_Y 0.5 #endif #define CURVE_MIN_TERMS 1 #define CURVE_MAX_TERMS 7 #define DEFAULT_TEXT_CONTRAST 4 /* Recursion depth of the flattening algorithm */ #define FLATTEN_RECURSION_LIMIT 10 /* not 100% identical to MS GDI+ which varies a little from int and float, but still around 0x40000000 */ #define GDIP_MAX_COORD 1073741824 #define gdip_is_overflow(a) (((a) < -GDIP_MAX_COORD) || ((a) > GDIP_MAX_COORD)) typedef enum { CURVE_OPEN, CURVE_CLOSE } _CurveType; typedef enum { gtUndefined, gtX11Drawable, gtMemoryBitmap, gtOSXDrawable, gtPostScript } GraphicsType; typedef enum { GraphicsBackEndInvalid = -1, GraphicsBackEndCairo = 0, GraphicsBackEndMetafile = 1 } GraphicsBackEnd; typedef struct { cairo_matrix_t matrix; cairo_matrix_t previous_matrix; GpRegion* clip; cairo_matrix_t clip_matrix; CompositingMode composite_mode; CompositingQuality composite_quality; InterpolationMode interpolation; GpUnit page_unit; float scale; SmoothingMode draw_mode; TextRenderingHint text_mode; PixelOffsetMode pixel_mode; int org_x; int org_y; int text_contrast; } GpState; typedef enum { GraphicsStateValid = 0, GraphicsStateBusy = 1 } GraphicsInternalState; typedef struct _Graphics { GraphicsBackEnd backend; /* cairo-specific stuff */ cairo_t *ct; GpMatrix *copy_of_ctm; cairo_matrix_t previous_matrix; #if defined(HAVE_X11) #ifdef CAIRO_HAS_XLIB_SURFACE Display *display; Drawable drawable; #endif #endif void *image; int type; GpPen* last_pen; /* caching pen and brush to avoid unnecessary sets */ GpBrush* last_brush; float aa_offset_x; float aa_offset_y; /* metafile-specific stuff */ EmfType emf_type; GpMetafile *metafile; cairo_surface_t *metasurface; /* bogus surface to satisfy some API calls */ /* common-stuff */ GpRegion* clip; GpMatrix* clip_matrix; GpRect bounds; GpRect orig_bounds; GpUnit page_unit; float scale; InterpolationMode interpolation; SmoothingMode draw_mode; TextRenderingHint text_mode; GpState* saved_status; int saved_status_pos; CompositingMode composite_mode; CompositingQuality composite_quality; PixelOffsetMode pixel_mode; int render_origin_x; int render_origin_y; float dpi_x; float dpi_y; int text_contrast; GraphicsInternalState state; #ifdef CAIRO_HAS_QUARTZ_SURFACE void *cg_context; #endif } Graphics; float gdip_unit_conversion (Unit from, Unit to, float dpi, GraphicsType type, float nSrc) GDIP_INTERNAL; void gdip_set_cairo_clipping (GpGraphics *graphics) GDIP_INTERNAL; GpGraphics* gdip_graphics_new (cairo_surface_t *surface) GDIP_INTERNAL; GpGraphics* gdip_metafile_graphics_new (GpMetafile *metafile) GDIP_INTERNAL; BOOL gdip_is_scaled (GpGraphics *graphics) GDIP_INTERNAL; /* prototypes for cairo wrappers to deal with coordonates limits, unit conversion and antialiasing) */ void gdip_cairo_rectangle (GpGraphics *graphics, double x, double y, double width, double height, BOOL antialiasing) GDIP_INTERNAL; void gdip_cairo_move_to (GpGraphics *graphics, double x, double y, BOOL convert_units, BOOL antialiasing) GDIP_INTERNAL; void gdip_cairo_line_to (GpGraphics *graphics, double x, double y, BOOL convert_units, BOOL antialiasing) GDIP_INTERNAL; void gdip_cairo_curve_to (GpGraphics *graphics, double x1, double y1, double x2, double y2, double x3, double y3, BOOL convert_units, BOOL antialiasing) GDIP_INTERNAL; void gdip_cairo_set_matrix (GpGraphics *graphics, GpMatrix *matrixPageUnits) GDIP_INTERNAL; #ifdef CAIRO_HAS_QUARTZ_SURFACE #if __i386__ typedef float CGFloat; #else typedef double CGFloat; #endif // For the Quartz backend to function we need a few structures and function declarations. // Unfortunately including the headers causes conflicts with internal types. This must // be kept in sync with any changes that might happen (albeit unlikely) to apples structures struct CGPoint { CGFloat x; CGFloat y; }; typedef struct CGPoint CGPoint; struct CGSize { CGFloat width; CGFloat height; }; typedef struct CGSize CGSize; struct CGRect { CGPoint origin; CGSize size; }; typedef struct CGRect CGRect; void *CGBitmapContextCreateImage (void *context); void CGContextDrawImage (void *context, CGRect rect, void *image); void CGImageRelease (void *image); void *cairo_quartz_surface_get_cg_context(cairo_surface_t *surface); cairo_surface_t *cairo_quartz_surface_create (int format, int width, int height); cairo_surface_t *cairo_quartz_surface_create_for_cg_context (void *ctx, int width, int height); #endif /* include public API */ #include "image.h" #include "graphics.h" #endif libgdiplus-6.0.4+dfsg/src/emfcodec.c0000644000175000017500000004624113542674535020043 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "emfcodec.h" //#define DEBUG_EMF_ALL #ifdef DEBUG_EMF_ALL #define DEBUG_EMF #define DEBUG_EMF_2 #define DEBUG_EMF_3 #define DEBUG_EMF_NOTIMPLEMENTED #endif #ifdef DEBUG_EMF_NOTIMPLEMENTED #define NOTIMPLEMENTED(s) printf(s) #define NOTIMPLEMENTED1(s,p1) printf(s, (p1)) #define NOTIMPLEMENTED2(s,p1,p2) printf(s, (p1), (p2)) #define NOTIMPLEMENTED3(s,p1,p2,p3) printf(s, (p1), (p2), (p3)) #define NOTIMPLEMENTED4(s,p1,p2,p3,p4) printf(s, (p1), (p2), (p3), (p4)) #define NOTIMPLEMENTED5(s,p1,p2,p3,p4,p5) printf(s, (p1), (p2), (p3), (p4), (p5)) #define NOTIMPLEMENTED6(s,p1,p2,p3,p4,p5,p6) printf(s, (p1), (p2), (p3), (p4), (p5), (p6)) #else #define NOTIMPLEMENTED(s) #define NOTIMPLEMENTED1(s,p1) #define NOTIMPLEMENTED2(s,p1,p2) #define NOTIMPLEMENTED3(s,p1,p2,p3) #define NOTIMPLEMENTED4(s,p1,p2,p3,p4) #define NOTIMPLEMENTED5(s,p1,p2,p3,p4,p5) #define NOTIMPLEMENTED6(s,p1,p2,p3,p4,p5,p6) #endif GUID gdip_emf_image_format_guid = {0xb96b3cacU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; /* Codecinfo related data*/ static ImageCodecInfo emf_codec; static const WCHAR emf_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'E', 'M', 'F', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in EMF Codec */ static const WCHAR emf_extension[] = {'*','.','E', 'M', 'F', 0}; /* *.EMF */ static const WCHAR emf_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'x', '-', 'e', 'm', 'f', 0}; /* image/x-emf */ static const WCHAR emf_format[] = {'E', 'M', 'F', 0}; /* EMF */ static const BYTE emf_sig_pattern[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x45, 0x4D, 0x46 }; static const BYTE emf_sig_mask[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF }; ImageCodecInfo* gdip_getcodecinfo_emf () { emf_codec.Clsid = (CLSID) { 0x557cf403, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; emf_codec.FormatID = gdip_emf_image_format_guid; emf_codec.CodecName = (const WCHAR*) emf_codecname; emf_codec.DllName = NULL; emf_codec.FormatDescription = (const WCHAR*) emf_format; emf_codec.FilenameExtension = (const WCHAR*) emf_extension; emf_codec.MimeType = (const WCHAR*) emf_mimetype; emf_codec.Flags = ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; emf_codec.Version = 1; emf_codec.SigCount = 1; emf_codec.SigSize = 44; emf_codec.SigPattern = emf_sig_pattern; emf_codec.SigMask = emf_sig_mask; return &emf_codec; } #if G_BYTE_ORDER == G_LITTLE_ENDIAN #define GETDW(x) (*(DWORD*)(data + (x))) #define GETFLOAT(x) (*(float*)(data + (x))) #else #define GETDW(x) (GUINT32_FROM_LE(*(DWORD*)(data + (x)))) #define GETFLOAT(x) ((float)GETDW(x)) #endif static DWORD GetColor (DWORD color) { BYTE *p = (BYTE*)&color; BYTE temp = p[0]; p[0] = p[2]; p[2] = temp; return color; } static GpStatus PolyBezier (MetafilePlayContext *context, BYTE *data, int len, BOOL compact) { DWORD num; GpPointF *points, *pt; GpStatus status; int p, n = 0; RECTL bounds; bounds.left = GETDW(DWP(n)); n++; bounds.top = GETDW(DWP(n)); n++; bounds.right = GETDW(DWP(n)); n++; bounds.bottom = GETDW(DWP(n)); n++; /* make sure we're not reading more data than what's available in this record */ num = GETDW(DWP(n)); n++; if (compact) { /* len = bounds (4 * DWORD) + num (DWORD) + 2 * num * (x WORD + y WORD) */ if (num > ((len - 5 * sizeof (DWORD)) >> 2)) return InvalidParameter; } else { /* len = bounds (4 * DWORD) + num (DWORD) + 2 * num * (x DWORD + y DWORD) */ if (num > ((len - 5 * sizeof (DWORD)) >> 3)) return InvalidParameter; } #ifdef DEBUG_EMF printf ("PolyBezier%s bounds [%d, %d, %d, %d] with %d points", (compact ? "16" : ""), bounds.left, bounds.top, bounds.right, bounds.bottom, num); #else (void) bounds; // Avoid an unused variable warning. #endif /* we need to supply the current x,y position */ points = (GpPointF*) GdipAlloc ((num + 1) * sizeof (GpPointF)); if (!points) return OutOfMemory; pt = points; pt->X = context->current_x; pt->Y = context->current_y; #ifdef DEBUG_EMF_2 printf ("\n\tmoveto to %g,%g", pt->X, pt->Y); #endif context->path_x = pt->X; context->path_y = pt->Y; pt++; for (p = 0; p < num; p++, pt++) { if (compact) { DWORD xy = GETDW(DWP(n)); n++; pt->X = (xy & 0x0000FFFF); pt->Y = (xy >> 16); } else { pt->X = GETDW(DWP(n)); n++; pt->Y = GETDW(DWP(n)); n++; } #ifdef DEBUG_EMF_2 printf ("\n\tbezier to %g,%g", pt->X, pt->Y); #endif } /* keep last point of the path so we can close the figure as GDI does (line) */ pt--; context->current_x = pt->X; context->current_y = pt->Y; /* PolyBezier doesn't use the current point (GDI wise) but metafiles seems different */ status = gdip_metafile_PolyBezier (context, points, num + 1); GdipFree (points); return status; } /* the structure is different from WMF (16 or 32bits, RECTL bounds) */ static GpStatus Polygon (MetafilePlayContext *context, BYTE *data, int len, BOOL compact) { DWORD num; GpPointF *points, *pt; GpStatus status; int p, n = 0; RECTL bounds; bounds.left = GETDW(DWP(n)); n++; bounds.top = GETDW(DWP(n)); n++; bounds.right = GETDW(DWP(n)); n++; bounds.bottom = GETDW(DWP(n)); n++; /* make sure we're not reading more data than what's available in this record */ num = GETDW(DWP(n)); n++; if (compact) { /* len = bounds (4 * DWORD) + num (DWORD) + 2 * num * (x WORD + y WORD) */ if (num > ((len - 5 * sizeof (DWORD)) >> 2)) return InvalidParameter; } else { /* len = bounds (4 * DWORD) + num (DWORD) + 2 * num * (x DWORD + y DWORD) */ if (num > ((len - 5 * sizeof (DWORD)) >> 3)) return InvalidParameter; } #ifdef DEBUG_EMF printf ("Polygon%s bounds [%d, %d, %d, %d] with %d points", (compact ? "16" : ""), bounds.left, bounds.top, bounds.right, bounds.bottom, num); #else (void) bounds; // Avoid an unused variable warning. #endif points = (GpPointF*) GdipAlloc (num * sizeof (GpPointF)); if (!points) return OutOfMemory; for (p = 0, pt = points; p < num; p++, pt++) { if (compact) { DWORD xy = GETDW(DWP(n)); n++; pt->X = (xy & 0x0000FFFF); pt->Y = (xy >> 16); } else { pt->X = GETDW(DWP(n)); n++; pt->Y = GETDW(DWP(n)); n++; } #ifdef DEBUG_EMF_2 printf ("\n\tpoly to %g,%g", pt->X, pt->Y); #endif } status = gdip_metafile_Polygon (context, points, num); GdipFree (points); return status; } /* the structure is different from WMF */ static GpStatus PolyPolygon (MetafilePlayContext *context, BYTE *data, BOOL compact) { GpStatus status = Ok; int poly_num; int n = 0; RECTL bounds; bounds.left = GETDW(DWP(n)); n++; bounds.top = GETDW(DWP(n)); n++; bounds.right = GETDW(DWP(n)); n++; bounds.bottom = GETDW(DWP(n)); n++; /* variable number of polygons */ poly_num = GETDW(DWP(n)); n++; /* total number of points (in all polygons)*/ // int total = GETDW(DWP(n)); n++; int i, j; PointFList *list = GdipAlloc (poly_num * sizeof (PointFList)); if (!list) return OutOfMemory; PointFList *current = list; #ifdef DEBUG_EMF printf ("PolyPolygon%s bounds [%d, %d, %d, %d] with %d polygons", (compact ? "16" : ""), bounds.left, bounds.top, bounds.right, bounds.bottom, poly_num); #else (void) bounds; // Avoid an unused variable warning. #endif /* read size of each polygon and allocate the required memory */ for (i = 0; i < poly_num; i++) { current->num = GETDW(DWP(n)); n++; current->points = (GpPointF*) GdipAlloc (current->num * sizeof (GpPointF)); if (!current->points) { for (j = 0; j < i; j++) { GdipFree (list[j].points); } GdipFree (list); return OutOfMemory; } #ifdef DEBUG_EMF_2 printf ("\n\tSub Polygon #%d has %d points", i, current->num); #endif current++; } /* read the points for each polygons */ current = list; for (i = 0; i < poly_num; i++) { GpPointF *pt = current->points; int p; for (p = 0; p < current->num; p++) { if (compact) { DWORD xy = GETDW(DWP(n)); n++; pt->X = (xy & 0x0000FFFF); pt->Y = (xy >> 16); } else { pt->X = GETDW(DWP(n)); n++; pt->Y = GETDW(DWP(n)); n++; } #ifdef DEBUG_EMF_3 printf ("\n\t\tpoly to %g,%g", pt->X, pt->Y); #endif pt++; } GpStatus s = gdip_metafile_Polygon (context, current->points, current->num); if (s != Ok) status = s; /* free points */ GdipFree (current->points); current++; } /* all points were freed, after being drawn, so we just have to free the polygon list*/ GdipFree (list); return status; } /* http://wvware.sourceforge.net/caolan/ora-wmf.html */ GpStatus GdiComment (MetafilePlayContext *context, BYTE* data, DWORD size) { #ifdef DEBUG_EMF printf ("GdiComment record size %d", size); #endif DWORD length = GETDW(DWP1); if (length >= 4) { DWORD header = GETDW(DWP2); if ((header == 0x2B464D45) && (size >= 8)) { #ifdef DEBUG_EMF_2 printf (", EMF+ length %d", length); #endif /* move past func, size, comment length, remove EMF+ comment header */ data += sizeof (DWORD) * 4; /* remove EMF+ header from length */ length -= sizeof (DWORD); /* play the EMF+ comment-embedded block */ return gdip_metafile_play_emfplus_block (context, data, length); } } #ifdef DEBUG_EMF_NOTIMPLEMENTED int i; printf (" - "); for (i = 0; i < size; i++) printf ("%2X ", *data++); #endif return Ok; } static GpStatus ExtCreatePen (MetafilePlayContext *context, BYTE *data, int size) { LOGBRUSH lb; #ifdef DEBUG_EMF printf ("EMR_EXTCREATEPEN"); #endif if ((GETDW(DWP2) != size) || (GETDW(DWP3) != 0) || (GETDW(DWP4) != size) || (GETDW(DWP5) != 0)) return InvalidParameter; lb.lbStyle = GETDW(DWP8); lb.lbColor = GetColor(GETDW(DWP9)); lb.lbHatch = GETDW(DWP10); return gdip_metafile_ExtCreatePen (context, GETDW(DWP6), GETDW(DWP7), &lb, GETDW(DWP11), NULL); } static GpStatus ModifyWorldTransform (MetafilePlayContext *context, float eM11, float eM12, float eM21, float eM22, float eDx, float eDy, DWORD iMode) { XFORM xf; xf.eM11 = eM11; xf.eM12 = eM12; xf.eM21 = eM21; xf.eM22 = eM22; xf.eDx = eDx; xf.eDy = eDy; return gdip_metafile_ModifyWorldTransform (context, &xf, iMode); } /* * This is very similar in design to the WMF parser, the biggest changes being... * * - The EMF records are based on 32bits units (unlike WMF records which are 16bits); * - The order the size and function parameter is reversed (from WMF); * - The size parameter is represented in bytes (not in WORD like WMF); * - Minimum record size is 8 bytes (function DWORD + size DWORD); * - There are now a record types to start (1) and end (14) the metafiles; */ GpStatus gdip_metafile_play_emf (MetafilePlayContext *context) { GpStatus status = Ok; GpMetafile *metafile = context->metafile; BYTE *data = metafile->data; BYTE *end = data + metafile->length; #ifdef DEBUG_EMF int i = 1, j; #endif /* check for empty or recording metafile */ if (!data) return Ok; /* reality check - each record is, at minimum, 8 bytes long (when size == 0) */ while (data < end - EMF_MIN_RECORD_SIZE) { /* record */ DWORD func = GETDW(EMF_FUNCTION); DWORD size = GETDW(EMF_RECORDSIZE); int params = (size - EMF_MIN_RECORD_SIZE) / sizeof (DWORD); #ifdef DEBUG_EMF printf ("\n[#%d] size %d ", i++, size); #endif switch (func) { case EMR_POLYBEZIER: status = PolyBezier (context, data, size - EMF_MIN_RECORD_SIZE, FALSE); break; case EMR_POLYGON: status = Polygon (context, data, size - EMF_MIN_RECORD_SIZE, FALSE); break; case EMR_POLYPOLYGON: status = PolyPolygon (context, data, FALSE); break; case EMR_SETWINDOWEXTEX: EMF_CHECK_PARAMS(2); status = gdip_metafile_SetWindowExt (context, GETDW(DWP1), GETDW(DWP2)); break; case EMR_SETWINDOWORGEX: EMF_CHECK_PARAMS(2); status = gdip_metafile_SetWindowOrg (context, GETDW(DWP1), GETDW(DWP2)); break; case EMR_SETVIEWPORTEXTEX: EMF_CHECK_PARAMS(2); NOTIMPLEMENTED2("EMR_SETVIEWPORTEXTEX not implemented %d, %d", GETDW(DWP1), GETDW(DWP2)); break; case EMR_SETVIEWPORTORGEX: EMF_CHECK_PARAMS(2); NOTIMPLEMENTED2("EMR_SETVIEWPORTORGEX not implemented %d, %d", GETDW(DWP1), GETDW(DWP2)); break; case EMR_SETBRUSHORGEX: EMF_CHECK_PARAMS(2); NOTIMPLEMENTED2("EMR_SETBRUSHORGEX not implemented %d, %d", GETDW(DWP1), GETDW(DWP2)); break; case EMR_EOF: EMF_CHECK_PARAMS(3); #ifdef DEBUG_EMF printf ("EndOfRecord %d %d %d", GETDW(DWP1), GETDW(DWP2), GETDW(DWP3)); #endif status = Ok; /* rest of the metafile can contains other stuff than records (e.g. palette information) */ data += size; goto cleanup; case EMR_SETMAPMODE: EMF_CHECK_PARAMS(1); status = gdip_metafile_SetMapMode (context, GETDW(DWP1)); break; case EMR_SETBKMODE: EMF_CHECK_PARAMS(1); status = gdip_metafile_SetBkMode (context, GETDW(DWP1)); break; case EMR_SETPOLYFILLMODE: EMF_CHECK_PARAMS(1); status = gdip_metafile_SetPolyFillMode (context, GETDW(DWP1)); break; case EMR_SETROP2: EMF_CHECK_PARAMS(1); status = gdip_metafile_SetROP2 (context, GETDW(DWP1)); break; case EMR_SETSTRETCHBLTMODE: NOTIMPLEMENTED("EMR_SETSTRETCHBLTMODE not implemented"); break; case EMR_SETTEXTALIGN: EMF_CHECK_PARAMS(1); status = gdip_metafile_SetTextAlign (context, GETDW(DWP1)); break; case EMR_SETTEXTCOLOR: EMF_CHECK_PARAMS(1); NOTIMPLEMENTED1("EMR_SETTEXTCOLOR %d not implemented", GETDW(DWP1)); break; case EMR_MOVETOEX: EMF_CHECK_PARAMS(2); status = gdip_metafile_MoveTo (context, GETDW(DWP1), GETDW(DWP2)); break; case EMR_INTERSECTCLIPRECT: EMF_CHECK_PARAMS(4); NOTIMPLEMENTED4("EMR_INTERSECTCLIPRECT %d, %d, %d, %d not implemented", GETDW(DWP1), GETDW(DWP1), GETDW(DWP3), GETDW(DWP4)); break; case EMR_SAVEDC: EMF_CHECK_PARAMS(0); NOTIMPLEMENTED("EMR_SAVEDC not implemented"); break; case EMR_RESTOREDC: EMF_CHECK_PARAMS(1); NOTIMPLEMENTED1("EMR_RESTOREDC %d not implemented", GETDW(DWP1)); break; case EMR_SETWORLDTRANSFORM: EMF_CHECK_PARAMS(6); NOTIMPLEMENTED6("EMR_SETWORLDTRANSFORM %d not implemented", GETDW(DWP1), GETDW(DWP2), GETDW(DWP3), GETDW(DWP4), GETDW(DWP5), GETDW(DWP6)); break; case EMR_MODIFYWORLDTRANSFORM: EMF_CHECK_PARAMS(7); status = ModifyWorldTransform (context, GETFLOAT(DWP1), GETFLOAT(DWP2), GETFLOAT(DWP3), GETFLOAT(DWP4), GETFLOAT(DWP5), GETFLOAT(DWP6), GETDW(DWP7)); break; case EMR_SELECTOBJECT: EMF_CHECK_PARAMS(1); status = gdip_metafile_SelectObject (context, GETDW(DWP1)); break; case EMR_CREATEPEN: EMF_CHECK_PARAMS(5); status = gdip_metafile_CreatePenIndirect (context, GETDW(DWP2), GETDW(DWP3), GETDW(DWP4)); break; case EMR_CREATEBRUSHINDIRECT: EMF_CHECK_PARAMS(4); /* 4 parameters provided, only 3 required in LOGBRUSH structure used in CreateBrushIndirect */ status = gdip_metafile_CreateBrushIndirect (context, GETDW(DWP4), GetColor(GETDW(DWP3)), GETDW(DWP2)); break; case EMR_DELETEOBJECT: EMF_CHECK_PARAMS(1); status = gdip_metafile_DeleteObject (context, GETDW(DWP1)); break; case EMR_LINETO: EMF_CHECK_PARAMS(2); status = gdip_metafile_LineTo (context, GETDW(DWP1), GETDW(DWP2)); break; case EMR_SETMITERLIMIT: EMF_CHECK_PARAMS(1); status = gdip_metafile_SetMiterLimit (context, GETDW(DWP1), NULL); break; case EMR_BEGINPATH: EMF_CHECK_PARAMS(0); status = gdip_metafile_BeginPath (context); break; case EMR_ENDPATH: EMF_CHECK_PARAMS(0); status = gdip_metafile_EndPath (context); break; case EMR_CLOSEFIGURE: EMF_CHECK_PARAMS(0); status = gdip_metafile_CloseFigure (context); break; case EMR_FILLPATH: EMF_CHECK_PARAMS(4); /* TODO - deal with all parameters, we have what looks like a rectangle (bounds?) */ status = gdip_metafile_FillPath (context); break; case EMR_STROKEANDFILLPATH: EMF_CHECK_PARAMS(4); /* TODO - deal with all parameters, we have what looks like a rectangle (bounds?) */ status = gdip_metafile_StrokeAndFillPath (context); break; case EMR_STROKEPATH: EMF_CHECK_PARAMS(4); /* TODO - deal with all parameters, we have what looks like a rectangle (bounds?) */ status = gdip_metafile_StrokePath (context); break; case EMR_SELECTCLIPPATH: EMF_CHECK_PARAMS(1); NOTIMPLEMENTED1("EMR_SELECTCLIPPATH %d not implemented", GETDW(DWP1)); break; case EMR_GDICOMMENT: EMF_CHECK_PARAMS(1); /* record contains at least the size of the comment */ status = GdiComment (context, data, size); break; case EMR_EXTSELECTCLIPRGN: EMF_CHECK_PARAMS(2); NOTIMPLEMENTED2("EMR_EXTSELECTCLIPRGN %d, %d not implemented", GETDW(DWP1), GETDW(DWP2)); break; case EMR_EXTCREATEFONTINDIRECTW: NOTIMPLEMENTED("EMR_EXTCREATEFONTINDIRECTW"); break; case EMR_EXTTEXTOUTA: NOTIMPLEMENTED("EMR_EXTTEXTOUTA"); break; case EMR_EXTTEXTOUTW: NOTIMPLEMENTED("EMR_EXTTEXTOUTW"); break; case EMR_POLYGON16: status = Polygon (context, data, size - EMF_MIN_RECORD_SIZE, TRUE); break; case EMR_POLYBEZIERTO16: status = PolyBezier (context, data, size - EMF_MIN_RECORD_SIZE, TRUE); break; case EMR_POLYPOLYGON16: status = PolyPolygon (context, data, TRUE); break; case EMR_EXTCREATEPEN: EMF_CHECK_PARAMS(11); status = ExtCreatePen (context, data, size); break; default: /* unprocessed records, ignore the data */ #ifdef DEBUG_EMF_NOTIMPLEMENTED printf ("Unimplemented_%d (", func); for (j = 0; j < params; j++) { printf (" %d", GETDW(DWP(j))); } printf (" )"); #endif break; } if (status != Ok) { g_warning ("Parsing interupted, status %d returned from function %d.", status, func); goto cleanup; } data += size; } cleanup: return status; } GpStatus gdip_load_emf_image_from_file (FILE *fp, GpImage **image) { return gdip_get_metafile_from ((void*)fp, (GpMetafile**)image, File); } GpStatus gdip_load_emf_image_from_stream_delegate (dstream_t *loader, GpImage **image) { return gdip_get_metafile_from ((void *)loader, (GpMetafile**)image, DStream); } libgdiplus-6.0.4+dfsg/src/imageattributes-private.h0000644000175000017500000000544513542674230023135 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __IMAGEATTRIBUTES_PRIVATE_H__ #define __IMAGEATTRIBUTES_PRIVATE_H__ #include "gdiplus-private.h" typedef enum { ImageAttributeFlagsNoOp = 0x01, ImageAttributeFlagsColorMatrixEnabled = 0x02, ImageAttributeFlagsThresholdEnabled = 0x04, ImageAttributeFlagsGammaEnabled = 0x08, ImageAttributeFlagsColorKeysEnabled = 0x10, ImageAttributeFlagsColorRemapTableEnabled = 0x20, ImageAttributeFlagsOutputChannelEnabled = 0x40, ImageAttributeFlagsGrayMatrixEnabled = 0x80, ImageAttributeFlagsOutputChannelColorProfileEnabled = 0x100 } ImageAttributeFlags; typedef struct { ImageAttributeFlags flags; ColorMap *colormap; int colormap_elem; float gamma_correction; ARGB key_colorlow; ARGB key_colorhigh; ColorMatrix *colormatrix; ColorMatrix *graymatrix; ColorMatrixFlags colormatrix_flags; float threshold; // Not implemented. ColorChannelFlags outputchannel_flags; // Not implemented. char *colorprofile_filename; // Not implemented. } GpImageAttribute; typedef struct _ImageAttributes { GpImageAttribute def; GpImageAttribute bitmap; GpImageAttribute brush; GpImageAttribute pen; GpImageAttribute text; /* Globals */ WrapMode wrapmode; ARGB color; } ImageAttributes; #include "imageattributes.h" #endif libgdiplus-6.0.4+dfsg/src/stringformat.h0000644000175000017500000000762413233636545021020 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __STRINGFORMAT_H__ #define __STRINGFORMAT_H__ /* StringFormat public API (only!) */ GpStatus WINGDIPAPI GdipCreateStringFormat (INT formatAttributes, LANGID language, GpStringFormat **format); GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault (GpStringFormat **format); GpStatus WINGDIPAPI GdipStringFormatGetGenericTypographic (GpStringFormat **format); GpStatus WINGDIPAPI GdipCloneStringFormat (GDIPCONST GpStringFormat* format, GpStringFormat** newFormat); GpStatus WINGDIPAPI GdipDeleteStringFormat (GpStringFormat *format); GpStatus WINGDIPAPI GdipGetStringFormatAlign (GDIPCONST GpStringFormat *format, StringAlignment *align); GpStatus WINGDIPAPI GdipSetStringFormatAlign (GpStringFormat *format, StringAlignment align); GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution (GDIPCONST GpStringFormat *format, LANGID *language, StringDigitSubstitute *substitute); GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution (GpStringFormat *format, LANGID language, StringDigitSubstitute substitute); GpStatus WINGDIPAPI GdipGetStringFormatFlags (GDIPCONST GpStringFormat *format, INT *flags); GpStatus WINGDIPAPI GdipSetStringFormatFlags (GpStringFormat *format, INT flags); GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix (GDIPCONST GpStringFormat *format, INT *hotkeyPrefix); GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix (GpStringFormat *format, INT hotkeyPrefix); GpStatus WINGDIPAPI GdipGetStringFormatLineAlign (GDIPCONST GpStringFormat *format, StringAlignment *align); GpStatus WINGDIPAPI GdipSetStringFormatLineAlign (GpStringFormat *format, StringAlignment align); GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount (GDIPCONST GpStringFormat *format, INT *count); GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges (GpStringFormat *format, INT rangeCount, GDIPCONST CharacterRange *ranges); GpStatus WINGDIPAPI GdipGetStringFormatTabStopCount (GDIPCONST GpStringFormat *format, INT *count); GpStatus WINGDIPAPI GdipGetStringFormatTabStops (GDIPCONST GpStringFormat *format, INT count, REAL *firstTabOffset, REAL *tabStops); GpStatus WINGDIPAPI GdipSetStringFormatTabStops (GpStringFormat *format, REAL firstTabOffset, INT count, GDIPCONST REAL *tabStops); GpStatus WINGDIPAPI GdipGetStringFormatTrimming (GDIPCONST GpStringFormat *format, StringTrimming *trimming); GpStatus WINGDIPAPI GdipSetStringFormatTrimming (GpStringFormat *format, StringTrimming trimming); #endif libgdiplus-6.0.4+dfsg/src/image.c0000644000175000017500000021251613545154626017355 0ustar directhexdirecthex/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 4; -*- * * image.c * * Copyright (c) 2003 Alexandre Pigolkine * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine(pigolkine@gmx.de) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Jordi Mas (jordi@ximian.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot */ #include "gdiplus-private.h" #include "image-private.h" #include "imageattributes-private.h" #include "general-private.h" #include "graphics-private.h" #include "matrix.h" #include "metafile-private.h" #include "bmpcodec.h" #include "pngcodec.h" #include "jpegcodec.h" #include "gifcodec.h" #include "tiffcodec.h" #include "icocodec.h" #include "emfcodec.h" #include "wmfcodec.h" /* * format guids */ extern GUID gdip_bmp_image_format_guid; extern GUID gdip_jpg_image_format_guid; extern GUID gdip_png_image_format_guid; extern GUID gdip_gif_image_format_guid; extern GUID gdip_tif_image_format_guid; extern GUID gdip_wmf_image_format_guid; extern GUID gdip_emf_image_format_guid; extern GUID gdip_ico_image_format_guid; GUID gdip_exif_image_format_guid = {0xb96b3cb2U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; GUID gdip_membmp_image_format_guid = {0xb96b3caaU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; /* * encoder param guids */ GUID GdipEncoderCompression = {0x0E09D739DU, 0x0CCD4U, 0x44EEU, {0x8E, 0x0BA, 0x3F, 0x0BF, 0x8B, 0x0E4, 0x0FC, 0x58}}; GUID GdipEncoderColorDepth = {0x66087055U, 0x0AD66U, 0x4C7CU, {0x9A, 0x18, 0x38, 0x0A2, 0x31, 0x0B, 0x83, 0x37}}; GUID GdipEncoderSaveFlag = {0x292266FCU, 0x0AC40U, 0x47BFU, {0x8C, 0x0FC, 0x0A8, 0x5B, 0x89, 0x0A6, 0x55, 0x0DE}}; GUID GdipEncoderSaveAsCMYK = {0x0A219BBC9U, 0x0A9DU, 0x4005U, {0x0A3, 0x0EE, 0x3A, 0x42, 0x1B, 0x8B, 0x0B0, 0x6C}}; GUID GdipEncoderImageItems = {0x63875E13U, 0x1F1DU, 0x45ABU, {0x91, 0x95, 0x0A2, 0x9B, 0x60, 0x66, 0x0A6, 0x50}}; GUID GdipEncoderTransformation = {0x8D0EB2D1U, 0x0A58EU, 0x4EA8U, {0x0AA, 0x14, 0x10, 0x80, 0x74, 0x0B7, 0x0B6, 0x0F9}}; GUID GdipEncoderQuality = {0x1D5BE4B5U, 0x0FA4AU, 0x452DU, {0x9C, 0x0DD, 0x5D, 0x0B3, 0x51, 0x5, 0x0E7, 0x0EB}}; GUID GdipEncoderLuminanceTable = {0x0EDB33BCEU, 0x266U, 0x4A77U, {0x0B9, 0x4, 0x27, 0x21, 0x60, 0x99, 0x0E7, 0x17}}; GUID GdipEncoderChrominanceTable = {0x0F2E455DCU, 0x9B3U, 0x4316U, {0x82, 0x60, 0x67, 0x6A, 0x0DA, 0x32, 0x48, 0x1C}}; #define DECODERS_SUPPORTED 8 #define ENCODERS_SUPPORTED 5 static BYTE *g_decoder_list; static int g_decoders = 0; static BYTE *g_encoder_list; static int g_encoders = 0; static ImageFormat gdip_image_format_for_format_guid (GDIPCONST GUID *formatGUID) { if (memcmp (formatGUID, &gdip_bmp_image_format_guid, sizeof (GUID)) == 0) return BMP; if (memcmp (formatGUID, &gdip_jpg_image_format_guid, sizeof (GUID)) == 0) return JPEG; if (memcmp (formatGUID, &gdip_png_image_format_guid, sizeof (GUID)) == 0) return PNG; if (memcmp (formatGUID, &gdip_gif_image_format_guid, sizeof (GUID)) == 0) return GIF; if (memcmp (formatGUID, &gdip_tif_image_format_guid, sizeof (GUID)) == 0) return TIF; if (memcmp (formatGUID, &gdip_exif_image_format_guid, sizeof (GUID)) == 0) return EXIF; if (memcmp (formatGUID, &gdip_wmf_image_format_guid, sizeof (GUID)) == 0) return WMF; if (memcmp (formatGUID, &gdip_emf_image_format_guid, sizeof (GUID)) == 0) return EMF; if (memcmp (formatGUID, &gdip_ico_image_format_guid, sizeof (GUID)) == 0) return ICON; if (memcmp (formatGUID, &gdip_membmp_image_format_guid, sizeof (GUID)) == 0) return PNG; /* MemoryBmp is saved as PNG */ return INVALID; } /* hack #1 - nonplaceable WMF metafiles are supported by no signature match them in the codecs */ static const BYTE nonplaceable_wmf_sig_pattern[] = { 0x01, 0x00, 0x09, 0x00, 0x00, 0x03 }; static const BYTE nonplaceable_wmf_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static const int nonplaceable_wmf_sig_count = 1; static const int nonplaceable_wmf_sig_size = 6; static BOOL signature_match (char *data, size_t data_size, int size, int count, BYTE* sig_pattern, BYTE* sig_mask) { if (data_size < size) return FALSE; int sig; for (sig = 0; sig < (size * count); sig += size) { BOOL match = TRUE; int p; for (p = 0; ((p < size) && (p < data_size)); p++) { BYTE *mask = (BYTE*)(&sig_mask [sig]); BYTE *pattern = (BYTE*)(&sig_pattern [sig]); if ((data [p] & mask[p]) != pattern[p]) { match = FALSE; break; } } if (match) return TRUE; } return FALSE; } static ImageFormat get_image_format (char *sig_read, size_t size_read, ImageFormat *final) { ImageCodecInfo *decoder = (ImageCodecInfo*)g_decoder_list; int index; /* look at every decoder available, this will depends on how libgdiplus is compiled */ for (index = 0; index < g_decoders; index++, decoder++) { /* for each signature in the codec */ if (signature_match (sig_read, size_read, decoder->SigSize, decoder->SigCount, (BYTE*)&decoder->SigPattern[0], (BYTE*)&decoder->SigMask[0])) { *final = gdip_image_format_for_format_guid (&decoder->FormatID); return *final; } } /* last chance - GDI+ still detects some files even if they don't match the codec signatures */ /* [mis-]handle non-placeable metafiles are WMF but reported as EMF (see #81178 for a test case) */ if (signature_match (sig_read, size_read, nonplaceable_wmf_sig_size, nonplaceable_wmf_sig_count, (BYTE*)&nonplaceable_wmf_sig_pattern[0], (BYTE*)&nonplaceable_wmf_sig_mask[0])) { *final = EMF; return WMF; } return INVALID; } /* Converts the given interpolation value to cairo_filter_t */ static cairo_filter_t gdip_get_cairo_filter (InterpolationMode imode) { switch (imode) { case InterpolationModeHighQuality: case InterpolationModeHighQualityBilinear: case InterpolationModeHighQualityBicubic: return CAIRO_FILTER_BEST; case InterpolationModeNearestNeighbor: return CAIRO_FILTER_NEAREST; case InterpolationModeBilinear: return CAIRO_FILTER_BILINEAR; case InterpolationModeBicubic: return CAIRO_FILTER_GAUSSIAN; case InterpolationModeLowQuality: return CAIRO_FILTER_FAST; case InterpolationModeDefault: default: return CAIRO_FILTER_GOOD; } } void gdip_image_init (GpImage *image) { gdip_bitmap_init(image); } static void copy_pixel (BYTE *src, BYTE *trg, int size) { memcpy (trg, src, size); } static GpStatus gdip_flip_x (GpImage *image) { BYTE *src; BYTE *line; int stride; int width; int height; int pixel_size; int i; int j; stride = image->active_bitmap->stride; width = image->active_bitmap->width; height = image->active_bitmap->height; pixel_size = gdip_get_pixel_format_components (image->active_bitmap->pixel_format) * gdip_get_pixel_format_depth (image->active_bitmap->pixel_format) / 8; line = GdipAlloc (stride); if (!line) { return OutOfMemory; } src = (BYTE *) image->active_bitmap->scan0; for (i = 0; i < height; i++, src += stride) { memcpy (line, src, stride); /* Save original line */ for (j = 0; j < width; j++) { copy_pixel(&line[(width - j - 1) * pixel_size], &src[j * pixel_size], pixel_size); } } GdipFree (line); return Ok; } static GpStatus gdip_flip_y (GpImage *image) { BYTE *src; BYTE *trg; BYTE *line; int stride; int height; int i; stride = image->active_bitmap->stride; height = image->active_bitmap->height; line = GdipAlloc (stride); if (!line) { return OutOfMemory; } src = (BYTE *) image->active_bitmap->scan0; trg = (BYTE *) image->active_bitmap->scan0; trg += (height-1) * stride; for (i = 0; i < (height /2); i++, src += stride, trg -= stride) { memcpy (line, trg, stride); /* Save target line*/ memcpy (trg, src, stride); /* Copy src to trg*/ memcpy (src, line, stride); /* Copy trg to src*/ } GdipFree (line); return Ok; } GpStatus WINGDIPAPI GdipDisposeImage (GpImage *image) { if (!image) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: return gdip_bitmap_dispose (image); case ImageTypeMetafile: return gdip_metafile_dispose ((GpMetafile*)image); default: /* imageUndefined */ g_warning ("unknown image type couldn't be disposed, ptr = %p, type %d", (void*)image, image->type); return Ok; } } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipGetImageGraphicsContext (GpImage *image, GpGraphics **graphics) { GpGraphics *gfx; cairo_pattern_t *filter; if (!image || !graphics) return InvalidParameter; /* This function isn't allowed on metafiles - unless we're recording */ if (image->type == ImageTypeMetafile) { GpMetafile *mf = (GpMetafile*)image; if (!mf->recording) return OutOfMemory; *graphics = gdip_metafile_graphics_new (mf); return *graphics ? Ok : OutOfMemory; } if (!image->active_bitmap) return InvalidParameter; /* * Microsoft GDI+ only supports these pixel formats Format24bppRGB, Format32bppARGB, * Format32bppPARGB, Format32bppRGB, Format48bppRGB, Format64bppARGB, Format64bppPARGB * but we're limited to 24/32 inside libgdiplus */ switch (image->active_bitmap->pixel_format) { case PixelFormat24bppRGB: case PixelFormat32bppARGB: case PixelFormat32bppPARGB: case PixelFormat32bppRGB: break; default: return OutOfMemory; } if (gdip_bitmap_ensure_surface (image) == NULL) return OutOfMemory; gfx = gdip_graphics_new (image->surface); if (!gfx) return OutOfMemory; gfx->dpi_x = image->active_bitmap->dpi_horz <= 0 ? gdip_get_display_dpi () : image->active_bitmap->dpi_horz; gfx->dpi_y = image->active_bitmap->dpi_vert <= 0 ? gdip_get_display_dpi () : image->active_bitmap->dpi_vert; gfx->bounds.Width = image->active_bitmap->width; gfx->bounds.Height = image->active_bitmap->height; gfx->orig_bounds.Width = image->active_bitmap->width; gfx->orig_bounds.Height = image->active_bitmap->height; gfx->image = image; gfx->type = gtMemoryBitmap; filter = cairo_pattern_create_for_surface (image->surface); cairo_pattern_set_filter (filter, gdip_get_cairo_filter (gfx->interpolation)); cairo_pattern_destroy (filter); *graphics = gfx; return Ok; } GpStatus WINGDIPAPI GdipDrawImageI (GpGraphics *graphics, GpImage *image, INT x, INT y) { return GdipDrawImage (graphics, image, x, y); } GpStatus WINGDIPAPI GdipDrawImage (GpGraphics *graphics, GpImage *image, REAL x, REAL y) { if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!image) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: { ActiveBitmapData *data = image->active_bitmap; return GdipDrawImageRect (graphics, image, x, y, data->width, data->height); } case ImageTypeMetafile: { MetafileHeader *metaheader = &((GpMetafile*)image)->metafile_header; return GdipDrawImageRect (graphics, image, x, y, metaheader->Width, metaheader->Height); } default: return InvalidParameter; } } GpStatus WINGDIPAPI GdipDrawImageRectI (GpGraphics *graphics, GpImage *image, INT x, INT y, INT width, INT height) { return GdipDrawImageRect (graphics, image, x, y, width, height); } GpStatus WINGDIPAPI GdipDrawImageRect (GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL width, REAL height) { cairo_pattern_t *pattern; cairo_pattern_t *org_pattern; MetafilePlayContext *metacontext = NULL; BOOL need_scaling = FALSE; double scaled_width, scaled_height; cairo_matrix_t orig_matrix; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!image) return InvalidParameter; if (image->type == ImageTypeBitmap) { /* check does not apply to metafiles, and it's better be done before converting the image */ if (gdip_is_overflow(x) || gdip_is_overflow(y)) return ValueOverflow; if (gdip_is_an_indexed_pixelformat (image->active_bitmap->pixel_format)) { GpStatus status = OutOfMemory; GpBitmap *rgb_bitmap = gdip_convert_indexed_to_rgb (image); if (rgb_bitmap) { status = GdipDrawImageRect (graphics, rgb_bitmap, x, y, width, height); GdipDisposeImage (rgb_bitmap); } return status; } } if ((width == 0) || (height == 0)) return Ok; /* conversion must be done after the recursive call to GdipDrawImageRect to remove the indexed bitmap */ if (!OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); width = gdip_unitx_convgr (graphics, width); height = gdip_unity_convgr (graphics, height); } cairo_new_path (graphics->ct); /* metafile */ if (image->type == ImageTypeMetafile) { GpStatus status; metacontext = gdip_metafile_play_setup ((GpMetafile*)image, graphics, x, y, width, height); status = gdip_metafile_play (metacontext); gdip_metafile_play_cleanup (metacontext); return status; } /* Create a surface for this bitmap if one doesn't exist */ if (gdip_bitmap_ensure_surface (image) == NULL) return OutOfMemory; if (width != image->active_bitmap->width || height != image->active_bitmap->height) { scaled_width = (double) width / image->active_bitmap->width; scaled_height = (double) height / image->active_bitmap->height; need_scaling = TRUE; } /* Use the image->surface as a pattern */ pattern = cairo_pattern_create_for_surface (image->surface); cairo_pattern_set_filter (pattern, gdip_get_cairo_filter (graphics->interpolation)); cairo_get_matrix (graphics->ct, &orig_matrix); cairo_translate (graphics->ct, x, y); if (need_scaling) cairo_scale (graphics->ct, scaled_width, scaled_height); org_pattern = cairo_get_source(graphics->ct); cairo_pattern_reference(org_pattern); cairo_set_source (graphics->ct, pattern); cairo_identity_matrix (graphics->ct); cairo_paint (graphics->ct); cairo_set_source (graphics->ct, org_pattern); cairo_set_matrix (graphics->ct, &orig_matrix); cairo_pattern_destroy (org_pattern); cairo_pattern_destroy (pattern); return Ok; } /* points are upper left, upper right, lower left. fourth point is extrapolated. */ GpStatus WINGDIPAPI GdipDrawImagePoints (GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *dstPoints, INT count) { cairo_pattern_t *pattern; cairo_pattern_t *org_pattern; GpMatrix *matrix = NULL; cairo_matrix_t orig_matrix; GpRectF tRect; MetafilePlayContext *metacontext = NULL; if (!graphics || !dstPoints || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!image || (count != 3 && count != 4)) return InvalidParameter; if (count == 4) return NotImplemented; cairo_new_path (graphics->ct); if (image->type == ImageTypeBitmap) { if (gdip_is_an_indexed_pixelformat (image->active_bitmap->pixel_format)) { GpStatus status = OutOfMemory; GpBitmap *rgb_bitmap = gdip_convert_indexed_to_rgb (image); if (rgb_bitmap) { status = GdipDrawImagePoints (graphics, rgb_bitmap, dstPoints, count); GdipDisposeImage(rgb_bitmap); } return status; } tRect.Width = image->active_bitmap->width; tRect.Height = image->active_bitmap->height; } else { MetafileHeader *metaheader = &((GpMetafile*)image)->metafile_header; tRect.Width = metaheader->Width; tRect.Height = metaheader->Height; } tRect.X = 0; tRect.Y = 0; GdipCreateMatrix3 (&tRect, dstPoints, &matrix); /* metafile */ if (image->type == ImageTypeMetafile) { GpStatus status; metacontext = gdip_metafile_play_setup ((GpMetafile*)image, graphics, tRect.X, tRect.Y, tRect.Width, tRect.Height); cairo_get_matrix (graphics->ct, &orig_matrix); gdip_cairo_set_matrix (graphics, matrix); status = gdip_metafile_play (metacontext); GdipDeleteMatrix (matrix); gdip_metafile_play_cleanup (metacontext); return status; } /* Create a surface for this bitmap if one doesn't exist */ if (gdip_bitmap_ensure_surface (image) == NULL) return OutOfMemory; pattern = cairo_pattern_create_for_surface (image->surface); cairo_pattern_set_filter (pattern, gdip_get_cairo_filter (graphics->interpolation)); org_pattern = cairo_get_source(graphics->ct); cairo_pattern_reference(org_pattern); cairo_get_matrix(graphics->ct, &orig_matrix); gdip_cairo_set_matrix (graphics, matrix); cairo_set_source_surface (graphics->ct, image->surface, 0, 0); cairo_paint (graphics->ct); cairo_set_source(graphics->ct, org_pattern); cairo_set_matrix (graphics->ct, &orig_matrix); GdipDeleteMatrix (matrix); cairo_pattern_destroy (org_pattern); cairo_pattern_destroy (pattern); return Ok; } GpStatus WINGDIPAPI GdipDrawImagePointsI (GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *dstPoints, INT count) { GpStatus status; GpPointF *pointsF; if (!dstPoints || count < 0) return InvalidParameter; pointsF = convert_points (dstPoints, count); if (!pointsF) return OutOfMemory; status = GdipDrawImagePoints (graphics, image, pointsF, count); GdipFree (pointsF); return status; } GpStatus WINGDIPAPI GdipDrawImagePointRect (GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit) { return GdipDrawImageRectRect (graphics, image, x, y, srcwidth, srcheight, srcx, srcy, srcwidth, srcheight, srcUnit, NULL, NULL, NULL); } GpStatus WINGDIPAPI GdipDrawImagePointRectI (GpGraphics *graphics, GpImage *image, INT x, INT y, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit) { return GdipDrawImagePointRect (graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit); } GpStatus WINGDIPAPI GdipDrawImageRectRect (GpGraphics *graphics, GpImage *image, REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData) { GpStatus status; cairo_pattern_t *pattern; cairo_pattern_t *orig; cairo_matrix_t mat; void *dest; void *org; int org_format; cairo_surface_t *org_surface; BOOL allocated = FALSE; cairo_surface_t *original = NULL; if (!graphics) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!image) return InvalidParameter; switch (srcUnit) { case UnitPixel: break; case UnitPoint: case UnitInch: case UnitDocument: case UnitMillimeter: if (graphics->type != gtPostScript) return NotImplemented; /* GDI+ returns the same */ break; case UnitWorld: case UnitDisplay: default: return InvalidParameter; } if (image->type == ImageTypeBitmap) { if (gdip_is_an_indexed_pixelformat (image->active_bitmap->pixel_format)) { GpBitmap *rgb_bitmap = gdip_convert_indexed_to_rgb (image); if (!rgb_bitmap) return OutOfMemory; status = GdipDrawImageRectRect (graphics, rgb_bitmap, dstx, dsty, dstwidth, dstheight, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData); GdipDisposeImage (rgb_bitmap); return status; } } else { /* metafile support */ return NotImplemented; } /* see OPTIMIZE_CONVERSION in general.h */ if (srcUnit != UnitPixel && graphics->type != gtPostScript) { dstx = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_x, graphics->type, dstx); dsty = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_y, graphics->type, dsty); dstwidth = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_x, graphics->type, dstwidth); dstheight = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_y, graphics->type, dstheight); srcx = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_x, graphics->type, srcx); srcy = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_y, graphics->type, srcy); srcwidth = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_x, graphics->type, srcwidth); srcheight = gdip_unit_conversion (srcUnit, UnitCairoPoint, graphics->dpi_y, graphics->type, srcheight); } org = dest = image->active_bitmap->scan0; org_format = image->active_bitmap->pixel_format; org_surface = image->surface; status = gdip_process_bitmap_attributes (image, &dest, (GpImageAttributes *) imageAttributes, &allocated); if (status != Ok) return status; /* If allocated is true we have a newly allocated and altered Scan0 in dest */ if (allocated) { image->active_bitmap->scan0 = dest; image->surface = NULL; } cairo_matrix_init (&mat, 1, 0, 0, 1, 0, 0); if (imageAttributes && imageAttributes->wrapmode != WrapModeClamp) { float posx; float posy; BOOL flipXOn = (imageAttributes->wrapmode == WrapModeTileFlipX); BOOL flipYOn = (imageAttributes->wrapmode == WrapModeTileFlipY); BOOL flipX = FALSE; BOOL flipY = FALSE; GpBitmap *imgflipX = NULL; GpBitmap *imgflipY = NULL; GpBitmap *imgflipXY = NULL; float img_width = image->active_bitmap->width * (dstwidth / srcwidth); float img_height = image->active_bitmap->height * (dstheight / srcheight); cairo_surface_t *cur_surface; if (imageAttributes->wrapmode == WrapModeTileFlipXY) { flipXOn = flipYOn = TRUE; } if (flipXOn) { /* We're ok just cloning the bitmap, we don't need the image data * and we destroy it before we leave this function */ status = gdip_bitmap_clone (image, &imgflipX); if (status != Ok) return status; status = gdip_flip_x (imgflipX); if (status != Ok) { gdip_bitmap_dispose (imgflipX); return status; } gdip_bitmap_ensure_surface (imgflipX); } if (flipYOn) { status = gdip_bitmap_clone (image, &imgflipY); if (status != Ok) return status; status = gdip_flip_y (imgflipY); if (status != Ok) { gdip_bitmap_dispose (imgflipY); return status; } gdip_bitmap_ensure_surface (imgflipY); } if (flipXOn && flipYOn) { status = gdip_bitmap_clone (image, &imgflipXY); if (status != Ok) return status; status = gdip_flip_x (imgflipXY); if (status != Ok) { gdip_bitmap_dispose (imgflipXY); return status; } status = gdip_flip_y (imgflipXY); if (status != Ok) { gdip_bitmap_dispose (imgflipXY); return Ok; } gdip_bitmap_ensure_surface (imgflipXY); } gdip_bitmap_ensure_surface (image); for (posy = 0; posy < dstheight; posy += img_height) { for (posx = 0; posx < dstwidth; posx += img_width) { if (flipX && flipY) { cur_surface = imgflipXY->surface; } else { if (flipX) { cur_surface = imgflipX->surface; } else { if (flipY) { cur_surface = imgflipY->surface; } else { cur_surface = image->surface; } } } cairo_matrix_translate (&mat, srcx, srcy); cairo_matrix_scale (&mat, srcwidth / dstwidth, srcheight / dstheight); cairo_matrix_translate (&mat, - (dstx + posx), - (dsty + posy)); pattern = cairo_pattern_create_for_surface(cur_surface); cairo_pattern_set_matrix (pattern, &mat); orig = cairo_get_source(graphics->ct); cairo_pattern_reference(orig); cairo_set_source(graphics->ct, pattern); cairo_rectangle (graphics->ct, dstx + posx, dsty + posy, img_width, img_height); cairo_fill (graphics->ct); cairo_set_source(graphics->ct, orig); cairo_matrix_init_identity (&mat); cairo_pattern_set_matrix (pattern, &mat); cairo_pattern_destroy(orig); cairo_pattern_destroy(pattern); if (flipXOn) { flipX = !flipX; } } if (flipYOn) { flipY = !flipY; } } if (imgflipX) { GdipDisposeImage ((GpImage *) imgflipX); } if (imgflipY) { GdipDisposeImage ((GpImage *) imgflipY); } if (imgflipXY) { GdipDisposeImage ((GpImage *) imgflipXY); } } else { cairo_pattern_t *filter; gdip_bitmap_ensure_surface (image); original = image->surface; filter = cairo_pattern_create_for_surface (original); cairo_pattern_set_filter (filter, gdip_get_cairo_filter (graphics->interpolation)); cairo_matrix_translate (&mat, srcx, srcy); if (!gdip_near_zero(srcwidth - dstwidth) || !gdip_near_zero(srcheight - dstheight)) cairo_matrix_scale (&mat, srcwidth / dstwidth, srcheight / dstheight); cairo_matrix_translate (&mat, -dstx, -dsty); pattern = cairo_pattern_create_for_surface(original); cairo_pattern_set_matrix (pattern, &mat); orig = cairo_get_source(graphics->ct); cairo_pattern_reference(orig); cairo_set_source(graphics->ct, pattern); cairo_rectangle (graphics->ct, dstx, dsty, dstwidth, dstheight); cairo_fill (graphics->ct); cairo_set_source(graphics->ct, orig); cairo_pattern_destroy (orig); cairo_matrix_init_identity (&mat); cairo_pattern_set_matrix (pattern, &mat); cairo_pattern_destroy (pattern); cairo_pattern_destroy (filter); } if (allocated) { image->active_bitmap->scan0 = org; image->active_bitmap->pixel_format = org_format; image->surface = org_surface; GdipFree (dest); } return Ok; } GpStatus WINGDIPAPI GdipDrawImageRectRectI (GpGraphics *graphics, GpImage *image, INT dstx, INT dsty, INT dstwidth, INT dstheight, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData) { return GdipDrawImageRectRect (graphics, image, dstx, dsty, dstwidth, dstheight, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData); } GpStatus WINGDIPAPI GdipDrawImagePointsRect (GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData) { GpRectF rect; GpStatus status; GpMatrix *matrix = NULL; cairo_matrix_t orig_matrix; if (!graphics || !points || count <= 0) return InvalidParameter; if (graphics->state == GraphicsStateBusy) return ObjectBusy; if (!image || (count != 3 && count != 4)) return InvalidParameter; switch (srcUnit) { case UnitPixel: break; case UnitPoint: case UnitInch: case UnitDocument: case UnitMillimeter: if (graphics->type != gtPostScript) return NotImplemented; /* GDI+ returns the same */ break; case UnitWorld: case UnitDisplay: default: return InvalidParameter; } if (count == 4) return NotImplemented; rect.X = 0; rect.Y = 0; if (image->type == ImageTypeBitmap) { rect.Width = image->active_bitmap->width; rect.Height = image->active_bitmap->height; } else { MetafileHeader *metaheader = &((GpMetafile*)image)->metafile_header; rect.Width = metaheader->Width; rect.Height = metaheader->Height; } status = GdipCreateMatrix3 (&rect, points, &matrix); if (status != Ok) { GdipDeleteMatrix (matrix); return status; } cairo_get_matrix (graphics->ct, &orig_matrix); gdip_cairo_set_matrix (graphics, matrix); status = GdipDrawImageRectRect (graphics, image, rect.X, rect.Y, rect.Width, rect.Height, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData); cairo_set_matrix (graphics->ct, &orig_matrix); GdipDeleteMatrix (matrix); return status; } GpStatus WINGDIPAPI GdipDrawImagePointsRectI (GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *points, INT count, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData) { GpPointF *pointsF; if (!points || count < 0) return InvalidParameter; pointsF = convert_points (points, count); if (!pointsF) return OutOfMemory; return GdipDrawImagePointsRect (graphics, image, pointsF, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData); } /* * These two will never be implemented, as 'stream' is a COM IStream */ GpStatus WINGDIPAPI GdipLoadImageFromStream (void *stream, GpImage **image) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!stream || !image) return InvalidParameter; return NotImplemented; /* GdipLoadImageFromStream - not supported */ } GpStatus WINGDIPAPI GdipLoadImageFromStreamICM (void *stream, GpImage **image) { return GdipLoadImageFromStream (stream, image); } GpStatus WINGDIPAPI GdipSaveImageToStream (GpImage *image, void *stream, GDIPCONST CLSID *encoderCLSID, GDIPCONST EncoderParameters *params) { if (!stream || !image) return InvalidParameter; return NotImplemented; /* GdipSaveImageToStream - not supported */ } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipLoadImageFromFile (GDIPCONST WCHAR *file, GpImage **image) { FILE *fp = NULL; GpImage *result = NULL; GpStatus status = Ok; ImageFormat format, public_format; char *file_name = NULL; char format_peek[MAX_CODEC_SIG_LENGTH]; int format_peek_sz; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!image || !file) return InvalidParameter; file_name = (char *) utf16_to_utf8 ((const gunichar2 *)file, -1); if (!file_name) { *image = NULL; return InvalidParameter; } fp = fopen (file_name, "rb"); if (!fp) { GdipFree (file_name); return OutOfMemory; } format_peek_sz = fread (format_peek, 1, MAX_CODEC_SIG_LENGTH, fp); format = get_image_format (format_peek, format_peek_sz, &public_format); fseek (fp, 0, SEEK_SET); switch (format) { case BMP: status = gdip_load_bmp_image_from_file (fp, &result); break; case TIF: status = gdip_load_tiff_image_from_file (fp, &result); break; case GIF: status = gdip_load_gif_image_from_file (fp, &result); break; case PNG: status = gdip_load_png_image_from_file (fp, &result); break; case JPEG: status = gdip_load_jpeg_image_from_file (fp, file_name, &result); break; case ICON: status = gdip_load_ico_image_from_file (fp, &result); break; case WMF: status = gdip_load_wmf_image_from_file (fp, &result); break; case EMF: status = gdip_load_emf_image_from_file (fp, &result); break; case EXIF: status = NotImplemented; break; default: status = OutOfMemory; break; } if (result && (status == Ok)) result->image_format = public_format; fclose (fp); GdipFree (file_name); *image = result; if (status != Ok) { *image = NULL; } else if (result && (result->type == ImageTypeBitmap) && !result->active_bitmap) { /* If the codec didn't set the active bitmap we will */ gdip_bitmap_setactive (result, NULL, 0); } return status; } /* Note: use only for encoders (there's more decoders than encoders) */ static ImageFormat gdip_get_imageformat_from_codec_clsid (CLSID *encoderCLSID) { GpStatus status; UINT numEncoders, size, cnt; ImageCodecInfo *encoders, *encoder; status = GdipGetImageEncodersSize (&numEncoders, &size); if ((status != Ok) ||(numEncoders == 0)) return INVALID; encoders = GdipAlloc (size); status = GdipGetImageEncoders (numEncoders, size, encoders); if (status != Ok) return INVALID; for (cnt = 0, encoder = encoders; cnt < numEncoders; cnt++, encoder++) { if (memcmp (&encoder->Clsid, encoderCLSID, sizeof (GUID)) == 0) { ImageFormat ifmt = gdip_image_format_for_format_guid (&encoder->FormatID); GdipFree (encoders); return ifmt; } } GdipFree (encoders); return INVALID; } GpStatus WINGDIPAPI GdipSaveImageToFile (GpImage *image, GDIPCONST WCHAR *file, GDIPCONST CLSID *encoderCLSID, GDIPCONST EncoderParameters *params) { FILE *fp = 0; GpStatus status = 0; char *file_name; ImageFormat format; if (!image || !file || !encoderCLSID) return InvalidParameter; if (image->type != ImageTypeBitmap) return InvalidParameter; format = gdip_get_imageformat_from_codec_clsid ( (CLSID *)encoderCLSID); if (format == INVALID) return UnknownImageFormat; file_name = (char *) utf16_to_utf8 ((const gunichar2 *)file, -1); if (file_name == NULL) return InvalidParameter; gdip_bitmap_flush_surface (image); if (format == GIF) { /* gif library has to open the file itself*/ status = gdip_save_gif_image_to_file ((BYTE*)file_name, image); GdipFree (file_name); return status; } else if (format == TIF) { /* tif library has to open the file itself or seeking will fail when saving multi-page images*/ status = gdip_save_tiff_image_to_file ((BYTE*)file_name, image, params); GdipFree (file_name); return status; } if ((fp = fopen(file_name, "wb")) == NULL) { GdipFree (file_name); return GenericError; } GdipFree (file_name); switch (format) { case BMP: case ICON: status = gdip_save_bmp_image_to_file (fp, image); break; case PNG: status = gdip_save_png_image_to_file (fp, image, params); break; case JPEG: status = gdip_save_jpeg_image_to_file (fp, image, params); break; default: status = NotImplemented; break; } fclose (fp); return status; } GpStatus WINGDIPAPI GdipGetImageBounds (GpImage *image, GpRectF *rect, GpUnit *unit) { if (!image || !rect || !unit) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: rect->X = 0; rect->Y = 0; rect->Height = image->active_bitmap->height; rect->Width = image->active_bitmap->width; *unit = UnitPixel; break; case ImageTypeMetafile: { MetafileHeader *metaheader = gdip_get_metaheader(image); rect->X = metaheader->X; rect->Y = metaheader->Y; rect->Height = metaheader->Height; rect->Width = metaheader->Width; *unit = UnitPixel; break; } default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageDimension (GpImage *image, REAL *width, REAL *height) { if (!image || !width || !height) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *width = image->active_bitmap->width; *height = image->active_bitmap->height; break; case ImageTypeMetafile: { MetafileHeader *metaheader = gdip_get_metaheader(image); // The width and height values are returned in 0.01 millimeter units. *width = gdip_unit_conversion (UnitPixel, UnitMillimeter, metaheader->DpiX, gtMemoryBitmap, metaheader->Width) * 100; *height = gdip_unit_conversion (UnitPixel, UnitMillimeter, metaheader->DpiY, gtMemoryBitmap, metaheader->Height) * 100; break; } default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageType (GpImage *image, ImageType *type) { if (!image || !type) return InvalidParameter; *type = image->type; return Ok; } GpStatus WINGDIPAPI GdipGetImageWidth (GpImage *image, UINT *width) { if (!image || !width) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *width = image->active_bitmap->width; break; case ImageTypeMetafile: *width = gdip_get_metaheader(image)->Width; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageHeight (GpImage *image, UINT *height) { if (!image || !height) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *height = image->active_bitmap->height; break; case ImageTypeMetafile: *height = gdip_get_metaheader(image)->Height; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageHorizontalResolution (GpImage *image, REAL *resolution) { if (!image || !resolution) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *resolution = image->active_bitmap->dpi_horz; break; case ImageTypeMetafile: *resolution = gdip_get_metaheader(image)->DpiX; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageVerticalResolution (GpImage *image, REAL *resolution) { if (!image || !resolution) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *resolution = image->active_bitmap->dpi_vert; break; case ImageTypeMetafile: *resolution = gdip_get_metaheader(image)->DpiY; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageFlags (GpImage *image, UINT *flags) { if (!image || !flags) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *flags = image->active_bitmap->image_flags; break; case ImageTypeMetafile: *flags = ImageFlagsUndocumented | ImageFlagsReadOnly | ImageFlagsHasAlpha | ImageFlagsScalable; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImageRawFormat (GpImage *image, GUID *format) { if (!image || !format) return InvalidParameter; switch (image->image_format) { case BMP: memcpy (format, &gdip_bmp_image_format_guid, sizeof (GUID)); break; case TIF: memcpy (format, &gdip_tif_image_format_guid, sizeof (GUID)); break; case GIF: memcpy (format, &gdip_gif_image_format_guid, sizeof (GUID)); break; case PNG: memcpy (format, &gdip_png_image_format_guid, sizeof (GUID)); break; case JPEG: memcpy (format, &gdip_jpg_image_format_guid, sizeof (GUID)); break; case EXIF: memcpy (format, &gdip_exif_image_format_guid, sizeof (GUID)); break; case WMF: memcpy (format, &gdip_wmf_image_format_guid, sizeof (GUID)); break; case EMF: memcpy (format, &gdip_emf_image_format_guid, sizeof (GUID)); break; case MEMBMP: memcpy (format, &gdip_membmp_image_format_guid, sizeof (GUID)); break; case ICON: memcpy (format, &gdip_ico_image_format_guid, sizeof (GUID)); break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetImagePixelFormat (GpImage *image, PixelFormat *format) { if (!image || !format) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *format = image->active_bitmap->pixel_format; break; case ImageTypeMetafile: *format = PixelFormat32bppRGB; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount (GpImage *image, UINT *count) { if (!image || !count) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *count = image->num_of_frames; break; case ImageTypeMetafile: *count = 1; /* always one for metafiles */ break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList (GpImage *image, GUID *dimensionGUID, UINT count) { if (!image || !dimensionGUID) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: { if (count < 1 || count > image->num_of_frames) return Win32Error; int i; int countReturn = image->num_of_frames; if (countReturn > count) countReturn = count; for (i = 0; i < countReturn; i++) dimensionGUID[i] = image->frames[i].frame_dimension; break; } case ImageTypeMetafile: if (count != 1) return InvalidParameter; dimensionGUID[0] = gdip_image_frameDimension_page_guid; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipImageGetFrameCount (GpImage *image, GDIPCONST GUID *dimensionGUID, UINT* count) { if (!image) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: { if (!dimensionGUID || !count) return Win32Error; int i; for (i = 0; i < image->num_of_frames; i++){ if (memcmp (dimensionGUID, &(image->frames[i].frame_dimension), sizeof (CLSID)) == 0) { *count = image->frames[i].count; return Ok; } } return Win32Error; } case ImageTypeMetafile: if (!count) return InvalidParameter; /* note: an empty GUID also returns 1 */ *count = 1; return Ok; default: break; } return InvalidParameter; } GpStatus WINGDIPAPI GdipImageSelectActiveFrame (GpImage *image, GDIPCONST GUID *dimensionGUID, UINT index) { if (!image || !dimensionGUID) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: return gdip_bitmap_setactive (image, dimensionGUID, index); case ImageTypeMetafile: /* any index value or GUID returns Ok */ return Ok; default: return InvalidParameter; } } static GpStatus gdip_rotate_orthogonal_flip_x (GpImage *image, int angle, BOOL flip_x) { BYTE *rotated; BYTE *source; BYTE *target; int x, y; int source_stride, source_height, source_width, source_pixel_delta, source_interscan_delta; int target_stride, target_height, target_width, target_pixel_delta, target_interscan_delta; int initial_source_offset, initial_target_offset; int components; int depth; int pixel_size; components = gdip_get_pixel_format_components (image->active_bitmap->pixel_format); depth = gdip_get_pixel_format_depth (image->active_bitmap->pixel_format); pixel_size = components * depth / 8; source_stride = image->active_bitmap->stride; source_width = image->active_bitmap->width; source_height = image->active_bitmap->height; source_pixel_delta = pixel_size; source_interscan_delta = source_stride - source_width * pixel_size; initial_source_offset = 0; if (angle == 180) { target_width = source_width; target_height = source_height; } else { target_height = source_width; /* swap width & height here */ target_width = source_height; } target_stride = target_width * pixel_size; target_stride = (target_stride + 3) & ~3; switch (angle) { case 90: { target_pixel_delta = target_stride; if (flip_x) { target_interscan_delta = +pixel_size - target_stride * target_height; initial_target_offset = 0; } else { target_interscan_delta = -pixel_size - target_stride * target_height; initial_target_offset = (target_width - 1) * pixel_size; } break; } case 180: { if (flip_x) { target_pixel_delta = +pixel_size; target_interscan_delta = -target_width * pixel_size - target_stride; initial_target_offset = (target_height - 1) * target_stride; } else { target_pixel_delta = -pixel_size; target_interscan_delta = +target_width * pixel_size - target_stride; initial_target_offset = (target_height - 1) * target_stride + (target_width - 1) * pixel_size; } break; } case 270: { target_pixel_delta = -target_stride; if (flip_x) { target_interscan_delta = target_stride * target_height - pixel_size; initial_target_offset = (target_height - 1) * target_stride + (target_width - 1) * pixel_size; } else { target_interscan_delta = target_stride * target_height + pixel_size; initial_target_offset = (target_height - 1) * target_stride; } break; } default: { if (flip_x) { return gdip_flip_x (image); } else { return Ok; } } } unsigned long long int size = (unsigned long long int)target_height * target_stride; if (size > G_MAXINT32) return OutOfMemory; rotated = GdipAlloc (size); if (rotated == NULL) { return OutOfMemory; } source = initial_source_offset + (BYTE *) image->active_bitmap->scan0; target = initial_target_offset + rotated; for (y = 0; y < source_height; y++, source += source_interscan_delta, target += target_interscan_delta) { for (x = 0; x < source_width; x++, source += source_pixel_delta, target += target_pixel_delta) { copy_pixel (source, target, pixel_size); } } image->active_bitmap->stride = target_stride; image->active_bitmap->height = target_height; image->active_bitmap->width = target_width; if ((image->active_bitmap->reserved & GBD_OWN_SCAN0) != 0) { GdipFree(image->active_bitmap->scan0); } image->active_bitmap->scan0 = rotated; image->active_bitmap->reserved |= GBD_OWN_SCAN0; gdip_bitmap_invalidate_surface (image); return Ok; } static GpStatus gdip_rotate_flip_packed_indexed (GpImage *image, PixelFormat pixel_format, int angle, BOOL flip_x) { BYTE *rotated; StreamingState scan[8]; BOOL scan_valid[8]; int x; int y; int i; int bits_per_pixel; int pixels_per_byte; int source_width; int source_height; BOOL aspect_inversion; int target_width; int target_height; int target_scan_size; int target_stride; bits_per_pixel = gdip_get_pixel_format_depth (pixel_format); pixels_per_byte = 8 / bits_per_pixel; source_width = image->active_bitmap->width; source_height = image->active_bitmap->height; /* Swap the width & height if needed */ aspect_inversion = ((angle % 180) != 0); target_width = aspect_inversion ? source_height : source_width; target_height = aspect_inversion ? source_width : source_height; target_scan_size = (target_width + pixels_per_byte - 1) / pixels_per_byte; target_stride = (target_scan_size + 3) & ~3; if ((angle == 180) && flip_x) { return gdip_flip_y(image); } unsigned long long int size = (unsigned long long int)target_height * target_stride; if (size > G_MAXINT32) return OutOfMemory; rotated = GdipAlloc (size); if (rotated == NULL) { return OutOfMemory; } if (aspect_inversion == FALSE) { int x_alignment = ((source_width - 1) % pixels_per_byte) + 1 - pixels_per_byte; int x_step = pixels_per_byte; StreamingState stream; BOOL target_starts_at_bottom = (angle == 180); int target_x_offset = target_scan_size - 1; int target_y_offset = target_starts_at_bottom ? (target_height - 1) * target_stride : 0; int target_y_offset_delta = target_starts_at_bottom ? -target_stride : +target_stride; GpStatus status = gdip_init_pixel_stream (&stream, image->active_bitmap, 0, 0, image->active_bitmap->width, image->active_bitmap->height); if (status != Ok) { GdipFree (rotated); return status; } for (y = 0; y < source_height; y++, target_y_offset += target_y_offset_delta) { BYTE *target = rotated + target_x_offset + target_y_offset; for (x = x_alignment; x < source_width; x += x_step) { int byte = 0; for (i = 0; i < pixels_per_byte; i++) { int index = x + i; if ((index >= 0) && (index < source_width)) { byte |= (gdip_pixel_stream_get_next (&stream) << 8); } byte >>= bits_per_pixel; } *target = byte; target--; } } } else { int y_alignment = ((source_height - 1) % pixels_per_byte) + 1 - pixels_per_byte; int y_step = pixels_per_byte; int byte_column = 0; int target_delta; BOOL target_starts_at_bottom = (angle == 270); BOOL target_starts_at_left = (target_starts_at_bottom ^ flip_x); if (target_starts_at_left) { y_alignment = 0; } if (target_starts_at_bottom) { target_delta = -target_stride; } else { target_delta = +target_stride; } for (y = y_alignment; y < source_height; y += y_step) { BYTE *target; for (i=0; i < pixels_per_byte; i++) { int scan_index = y + i; scan_valid[i] = ((scan_index >= 0) && (scan_index < source_height)); if (scan_valid[i]) { GpStatus status = gdip_init_pixel_stream (&scan[i], image->active_bitmap, 0, scan_index, source_width, 1); if (status != Ok) { GdipFree (rotated); return status; } } } target = rotated; if (target_starts_at_left) { target += byte_column; } else { target += target_scan_size - byte_column - 1; } if (target_starts_at_bottom) { target += (target_height - 1) * target_stride; } for (x = 0; x < source_width; x++) { int byte = 0; if (target_starts_at_left) { for (i=0; i < pixels_per_byte; i++) { byte <<= bits_per_pixel; if (scan_valid[i]) byte |= gdip_pixel_stream_get_next (&scan[i]); } } else { for (i = pixels_per_byte - 1; i >= 0; i--) { byte <<= bits_per_pixel; if (scan_valid[i]) byte |= gdip_pixel_stream_get_next (&scan[i]); } } *target = byte; target += target_delta; } byte_column++; } } image->active_bitmap->stride = target_stride; image->active_bitmap->height = target_height; image->active_bitmap->width = target_width; if ((image->active_bitmap->reserved & GBD_OWN_SCAN0) != 0) { GdipFree(image->active_bitmap->scan0); } image->active_bitmap->scan0 = rotated; image->active_bitmap->reserved |= GBD_OWN_SCAN0; /* It shouldn't be possible for an indexed image to have one, * but if it does, it needs to be killed. */ gdip_bitmap_invalidate_surface (image); return Ok; } GpStatus WINGDIPAPI GdipImageRotateFlip (GpImage *image, RotateFlipType type) { int angle; BOOL flip_x; if (!image) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; angle = flip_x = 0; switch (type) { case RotateNoneFlipNone:/* equivalent to Rotate180FlipXY */ return Ok; case Rotate90FlipNone: /* equivalent to Rotate270FlipXY */ angle = 90; break; case RotateNoneFlipXY: /* equivalent to Rotate180FlipNone */ angle = 180; break; case Rotate90FlipXY: /* equivalent to Rotate270FlipNone */ angle = 270; break; case RotateNoneFlipX: /* equivalent to Rotate180FlipY */ flip_x = TRUE; break; case Rotate90FlipX: /* equivalent to Rotate270FlipY */ angle = 90; flip_x = TRUE; break; case RotateNoneFlipY: /* equivalent to Rotate180FlipX */ return gdip_flip_y (image); case Rotate90FlipY: /* equivalent to Rotate270FlipX */ angle = 270; flip_x = TRUE; break; default: return InvalidParameter; } if (gdip_is_an_indexed_pixelformat (image->active_bitmap->pixel_format) && (gdip_get_pixel_format_depth (image->active_bitmap->pixel_format) < 8)) { return gdip_rotate_flip_packed_indexed (image, image->active_bitmap->pixel_format, angle, flip_x); } else { return gdip_rotate_orthogonal_flip_x (image, angle, flip_x); } } GpStatus WINGDIPAPI GdipGetImagePalette (GpImage *image, ColorPalette *palette, INT size) { int bytes_needed; if (!image || !palette) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; if (!image->active_bitmap->palette || image->active_bitmap->palette->Count == 0) { if (size >= 0 && size < sizeof(ColorPalette)) return InvalidParameter; palette->Count = 0; if (image->active_bitmap->palette) { palette->Flags = image->active_bitmap->palette->Flags; } else { palette->Flags = 0; } return Ok; } GdipGetImagePaletteSize (image, &bytes_needed); if (bytes_needed != size) return InvalidParameter; memcpy(palette, image->active_bitmap->palette, bytes_needed); return Ok; } GpStatus WINGDIPAPI GdipSetImagePalette (GpImage *image, GDIPCONST ColorPalette *palette) { int size; ColorPalette *result; if (!image || !palette || palette->Count == 0 || palette->Count > 256) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; size = (palette->Count - 1) * sizeof(ARGB) + sizeof(ColorPalette); if (!image->active_bitmap->palette || (palette->Count != image->active_bitmap->palette->Count)) { result = (ColorPalette *) GdipAlloc (size); if (!result) return OutOfMemory; if (image->active_bitmap->palette) GdipFree (image->active_bitmap->palette); image->active_bitmap->palette = result; } memcpy (image->active_bitmap->palette, palette, size); return Ok; } GpStatus WINGDIPAPI GdipGetImagePaletteSize (GpImage *image, INT* size) { int palette_entries; if (!image || !size) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return GenericError; palette_entries = (image->active_bitmap->palette) ? image->active_bitmap->palette->Count : 0; if (palette_entries == 0) *size = sizeof(ColorPalette); else *size = (palette_entries - 1) * sizeof(ARGB) + sizeof(ColorPalette); return Ok; } GpStatus WINGDIPAPI GdipGetPropertyCount (GpImage *image, UINT *propertyNumber) { if (!image || !propertyNumber) return InvalidParameter; switch (image->type) { case ImageTypeBitmap: *propertyNumber = image->active_bitmap->property_count; break; case ImageTypeMetafile: *propertyNumber = 0; break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipGetPropertyIdList (GpImage *image, UINT propertyNumber, PROPID *list) { int i; if (!image || !list) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; if (propertyNumber != image->active_bitmap->property_count) return InvalidParameter; for (i = 0; i < propertyNumber; i++) { list[i] = image->active_bitmap->property[i].id; } return Ok; } GpStatus WINGDIPAPI GdipGetPropertyItemSize (GpImage *image, PROPID propID, UINT *size) { int index; if (!image || !size) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; if (gdip_bitmapdata_property_find_id(image->active_bitmap, propID, &index) != Ok) { return PropertyNotFound; } *size = sizeof(PropertyItem) + image->active_bitmap->property[index].length; return Ok; } GpStatus WINGDIPAPI GdipGetPropertyItem (GpImage *image, PROPID propID, UINT size, PropertyItem *buffer) { int index; if (!image || !buffer) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; if (gdip_bitmapdata_property_find_id(image->active_bitmap, propID, &index) != Ok) { return PropertyNotFound; } if (size != (sizeof(PropertyItem) + image->active_bitmap->property[index].length)) { return InvalidParameter; } memcpy(buffer, &image->active_bitmap->property[index], sizeof(PropertyItem)); buffer->value = (BYTE*)buffer + sizeof(PropertyItem); memcpy(buffer->value, image->active_bitmap->property[index].value, buffer->length); return Ok; } GpStatus WINGDIPAPI GdipGetPropertySize (GpImage *image, UINT *totalBufferSize, UINT *numProperties) { UINT size; int i; if (!image || !totalBufferSize || !numProperties) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; *numProperties = image->active_bitmap->property_count; size = image->active_bitmap->property_count * sizeof(PropertyItem); for (i = 0; i < image->active_bitmap->property_count; i++) { size += image->active_bitmap->property[i].length; } *totalBufferSize = size; return Ok; } GpStatus WINGDIPAPI GdipRemovePropertyItem (GpImage *image, PROPID propID) { if (!image) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; return gdip_bitmapdata_property_remove_id(image->active_bitmap, propID); } GpStatus WINGDIPAPI GdipSetPropertyItem(GpImage *image, GDIPCONST PropertyItem *item) { int i; if (!image || !item) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; switch(image->image_format) { case BMP: case TIF: case GIF: case JPEG: case PNG: case ICON: { break; } default: { return PropertyNotSupported; } } /* Check if it exists and we need to replace */ if (gdip_bitmapdata_property_find_id(image->active_bitmap, item->id, &i) != Ok) { /* We're adding a new item */ return gdip_bitmapdata_property_add(image->active_bitmap, item->id, item->length, item->type, item->value); } /* We're replacing an existing item */ if (item->length > image->active_bitmap->property[i].length) { /* We need to allocate more space for our value */ if (image->active_bitmap->property[i].value != NULL) { GdipFree(image->active_bitmap->property[i].value); } image->active_bitmap->property[i].value = GdipAlloc(item->length); if (image->active_bitmap->property[i].value == NULL) { /* We already freed the old value, remove the entry */ gdip_bitmapdata_property_remove_index(image->active_bitmap, i); return OutOfMemory; } } else if (item->length == 0) { /* Just drop the old value */ if (image->active_bitmap->property[i].value != NULL) { GdipFree(image->active_bitmap->property[i].value); image->active_bitmap->property[i].value = NULL; } } image->active_bitmap->property[i].id = item->id; image->active_bitmap->property[i].length = item->length; image->active_bitmap->property[i].type = item->type; if (item->length > 0) { memcpy(image->active_bitmap->property[i].value, item->value, item->length); } return Ok; } GpStatus WINGDIPAPI GdipCloneImage (GpImage *image, GpImage **cloneImage) { if (!image || !cloneImage) return InvalidParameter; switch (image->type){ case ImageTypeBitmap: gdip_bitmap_clone (image, cloneImage); gdip_bitmap_setactive(*cloneImage, NULL, 0); return Ok; case ImageTypeMetafile: return gdip_metafile_clone ((GpMetafile*)image, (GpMetafile**)cloneImage); case ImageTypeUnknown: default: return Ok; } } int gdip_get_pixel_format_bpp (PixelFormat pixfmt) { return gdip_get_pixel_format_depth (pixfmt) * gdip_get_pixel_format_components (pixfmt); } int gdip_get_pixel_format_depth(PixelFormat pixfmt) { switch (pixfmt) { case PixelFormat16bppARGB1555: case PixelFormat16bppGrayScale: case PixelFormat16bppRGB555: case PixelFormat16bppRGB565: case PixelFormat24bppRGB: case PixelFormat32bppARGB: case PixelFormat32bppPARGB: case PixelFormat32bppRGB: return 8; /* FIXME - shouldn't this be 32? - pdb */ case PixelFormat48bppRGB: case PixelFormat64bppARGB: case PixelFormat64bppPARGB: return 16; case PixelFormat8bppIndexed: return 8; case PixelFormat4bppIndexed: return 4; case PixelFormat1bppIndexed: return 1; default: break; } return 0; } int gdip_get_pixel_format_components(PixelFormat pixfmt) { switch (pixfmt) { case PixelFormat16bppARGB1555: case PixelFormat32bppARGB: case PixelFormat32bppPARGB: case PixelFormat64bppARGB: case PixelFormat64bppPARGB: case PixelFormat32bppRGB: /* Cairo uses four bytes for 32BPP*/ case PixelFormat24bppRGB: return 4; case PixelFormat16bppRGB555: case PixelFormat16bppRGB565: case PixelFormat48bppRGB: return 3; case PixelFormat16bppGrayScale: case PixelFormat8bppIndexed: case PixelFormat4bppIndexed: case PixelFormat1bppIndexed: return 1; default: break; } return 0; } GpStatus WINGDIPAPI GdipLoadImageFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage **image) { GpImage *result = 0; GpStatus status = 0; ImageFormat format, public_format; dstream_t *loader = NULL; BYTE format_peek[MAX_CODEC_SIG_LENGTH]; int format_peek_sz; format_peek_sz = getHeaderFunc (format_peek, MAX_CODEC_SIG_LENGTH); format = get_image_format ((char *)format_peek, format_peek_sz, &public_format); switch (format) { case JPEG: loader = dstream_input_new (getBytesFunc, seekFunc); status = gdip_load_jpeg_image_from_stream_delegate (loader, &result); break; case PNG: status = gdip_load_png_image_from_stream_delegate (getBytesFunc, seekFunc, &result); break; case BMP: loader = dstream_input_new (getBytesFunc, seekFunc); status = gdip_load_bmp_image_from_stream_delegate (loader, &result); break; case TIF: status = gdip_load_tiff_image_from_stream_delegate (getBytesFunc, putBytesFunc, seekFunc, closeFunc, sizeFunc, &result); break; case GIF: status = gdip_load_gif_image_from_stream_delegate (getBytesFunc, seekFunc, &result); break; case ICON: loader = dstream_input_new (getBytesFunc, seekFunc); status = gdip_load_ico_image_from_stream_delegate (loader, &result); break; case EMF: loader = dstream_input_new (getBytesFunc, seekFunc); status = gdip_load_emf_image_from_stream_delegate (loader, &result); break; case WMF: loader = dstream_input_new (getBytesFunc, seekFunc); status = gdip_load_wmf_image_from_stream_delegate (loader, &result); break; default: /* NotImplemented looks better but this matchs MS behavior */ status = InvalidParameter; break; } if (result && (status == Ok)) result->image_format = public_format; dstream_free (loader); *image = result; if (status != Ok) { *image = NULL; } else if (result && (result->type == ImageTypeBitmap) && !result->active_bitmap) { /* If the codec didn't set the active bitmap we will */ gdip_bitmap_setactive(result, NULL, 0); } return status; } GpStatus WINGDIPAPI GdipSaveImageToDelegate_linux (GpImage *image, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GDIPCONST CLSID *encoderCLSID, GDIPCONST EncoderParameters *params) { if (!image || !encoderCLSID || (image->type != ImageTypeBitmap)) return InvalidParameter; gdip_bitmap_flush_surface (image); switch (gdip_get_imageformat_from_codec_clsid ((CLSID *)encoderCLSID)) { case ICON: case BMP: return gdip_save_bmp_image_to_stream_delegate (putBytesFunc, image); case PNG: return gdip_save_png_image_to_stream_delegate (putBytesFunc, image, params); case JPEG: return gdip_save_jpeg_image_to_stream_delegate (putBytesFunc, image, params); case GIF: return gdip_save_gif_image_to_stream_delegate (putBytesFunc, image, params); case TIF: return gdip_save_tiff_image_to_stream_delegate (getBytesFunc, putBytesFunc, seekFunc, closeFunc, sizeFunc, image, params); case INVALID: return UnknownImageFormat; default: return NotImplemented; } } GpStatus initCodecList (void) { BYTE *dpos, *epos; g_decoder_list = dpos = GdipAlloc (sizeof (ImageCodecInfo) * DECODERS_SUPPORTED); if (!g_decoder_list) return OutOfMemory; g_encoder_list = epos = GdipAlloc (sizeof (ImageCodecInfo) * ENCODERS_SUPPORTED); if (!g_decoder_list) { GdipFree (g_decoder_list); g_decoder_list = NULL; return OutOfMemory; } /* BMP codec (encoder+decoder) - built-in */ memcpy (dpos, gdip_getcodecinfo_bmp (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; memcpy (epos, gdip_getcodecinfo_bmp (), sizeof (ImageCodecInfo)); epos += sizeof (ImageCodecInfo); g_encoders++; /* JPEG codec (encoder+decoder) */ if (gdip_getcodecinfo_jpeg ()) { memcpy (dpos, gdip_getcodecinfo_jpeg(), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; memcpy (epos, gdip_getcodecinfo_jpeg(), sizeof (ImageCodecInfo)); epos += sizeof (ImageCodecInfo); g_encoders++; } /* GIF codec (encoder+decoder) */ if (gdip_getcodecinfo_gif ()) { memcpy (dpos, gdip_getcodecinfo_gif (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; memcpy (epos, gdip_getcodecinfo_gif (), sizeof (ImageCodecInfo)); epos += sizeof (ImageCodecInfo); g_encoders++; } /* EMF codec (decoder-only) */ if (gdip_getcodecinfo_emf ()) { memcpy (dpos, gdip_getcodecinfo_emf (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; } /* WMF codec (decoder-only) */ if (gdip_getcodecinfo_wmf ()) { memcpy (dpos, gdip_getcodecinfo_wmf (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; } /* TIFF codec (encoder+decoder) */ if (gdip_getcodecinfo_tiff ()) { memcpy (dpos, gdip_getcodecinfo_tiff (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; memcpy (epos, gdip_getcodecinfo_tiff (), sizeof (ImageCodecInfo)); epos += sizeof (ImageCodecInfo); g_encoders++; } /* PNG codec (encoder+decoder) */ if (gdip_getcodecinfo_png ()) { memcpy (dpos, gdip_getcodecinfo_png (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; memcpy (epos, gdip_getcodecinfo_png (), sizeof (ImageCodecInfo)); epos += sizeof (ImageCodecInfo); g_encoders++; } /* ICO codec (decoder-only) - built-in */ memcpy (dpos, gdip_getcodecinfo_ico (), sizeof (ImageCodecInfo)); dpos += sizeof (ImageCodecInfo); g_decoders++; return Ok; } void releaseCodecList (void) { if (g_decoder_list) { GdipFree (g_decoder_list); g_decoder_list = NULL; g_decoders = 0; } if (g_encoder_list) { GdipFree (g_encoder_list); g_encoder_list = NULL; g_encoders = 0; } } GpStatus WINGDIPAPI GdipGetImageDecodersSize (UINT *numDecoders, UINT *size) { if (!numDecoders || !size) return InvalidParameter; *numDecoders = g_decoders; *size = sizeof (ImageCodecInfo) * g_decoders; return Ok; } GpStatus WINGDIPAPI GdipGetImageDecoders (UINT numDecoders, UINT size, ImageCodecInfo *decoders) { if (!decoders || (numDecoders != g_decoders) || (size != sizeof (ImageCodecInfo) * g_decoders)) return GenericError; memcpy (decoders, g_decoder_list, size); return Ok; } GpStatus WINGDIPAPI GdipGetImageEncodersSize (UINT *numEncoders, UINT *size) { if (!numEncoders || !size) return InvalidParameter; *numEncoders = g_encoders; *size = sizeof (ImageCodecInfo) * g_encoders; return Ok; } GpStatus WINGDIPAPI GdipGetImageEncoders (UINT numEncoders, UINT size, ImageCodecInfo *encoders) { if (!encoders || (numEncoders != g_encoders) || (size != sizeof (ImageCodecInfo) * g_encoders)) return GenericError; memcpy (encoders, g_encoder_list, size); return Ok; } GpStatus WINGDIPAPI GdipGetAllPropertyItems (GpImage *image, UINT totalBufferSize, UINT numProperties, PropertyItem *allItems) { int size; int i; BYTE *ptr; if (!image || !allItems) return InvalidParameter; /* GDI+ doesn't support this for metafiles */ if (image->type != ImageTypeBitmap) return NotImplemented; if (numProperties != image->active_bitmap->property_count) { return InvalidParameter; } size = image->active_bitmap->property_count * sizeof(PropertyItem); for (i = 0; i < numProperties; i++) { size += image->active_bitmap->property[i].length; } if (size != totalBufferSize) { return InvalidParameter; } if (numProperties == 0) { return GenericError; } ptr = (BYTE*)allItems; ptr += totalBufferSize; /* Copy the PropertyItem array */ memcpy(allItems, image->active_bitmap->property, sizeof(PropertyItem) * numProperties); /* Copy the values and fix up the value pointers in the PropertyItem array to point to them */ for (i = 0; i < numProperties; i++) { if (allItems[i].value != NULL) { ptr -= allItems[i].length; memcpy(ptr, allItems[i].value, allItems[i].length); /* Use the copied pointer, less indirection than image->active_bitmap->property[i].value */ allItems[i].value = ptr; } } return Ok; } GpStatus WINGDIPAPI GdipGetEncoderParameterListSize (GpImage *image, GDIPCONST CLSID *clsidEncoder, UINT *size) { ImageFormat fmt; if (!image || !clsidEncoder) return InvalidParameter; fmt = gdip_get_imageformat_from_codec_clsid ((CLSID *) clsidEncoder); switch (fmt) { case TIF: if (!size) return InvalidParameter; *size = sizeof (TiffEncoderParameters); return Ok; case GIF: if (!size) return InvalidParameter; *size = sizeof (GifEncoderParameters); return Ok; case PNG: if (!size) return InvalidParameter; *size = sizeof (PngEncoderParameters); return Ok; case JPEG: if (!size) return InvalidParameter; *size = sizeof (JpegEncoderParameters); return Ok; case BMP: *size = 0; return NotImplemented; default: break; } return FileNotFound; } GpStatus WINGDIPAPI GdipGetEncoderParameterList (GpImage *image, GDIPCONST CLSID *clsidEncoder, UINT size, EncoderParameters *buffer) { ImageFormat fmt; if (!image || !clsidEncoder) return InvalidParameter; fmt = gdip_get_imageformat_from_codec_clsid ((CLSID *) clsidEncoder); switch (fmt) { case TIF: return gdip_fill_encoder_parameter_list_tiff (buffer, size); case GIF: return gdip_fill_encoder_parameter_list_gif (buffer, size); case PNG: return gdip_fill_encoder_parameter_list_png (buffer, size); case JPEG: return gdip_fill_encoder_parameter_list_jpeg (buffer, size); case BMP: return NotImplemented; default: break; } return FileNotFound; } GpStatus WINGDIPAPI GdipGetImageThumbnail (GpImage *image, UINT thumbWidth, UINT thumbHeight, GpImage **thumbImage, GetThumbnailImageAbort callback, VOID *callbackData) { GpStatus status; PixelFormat format; GpImage *result; GpGraphics *graphics; if (!image || !thumbImage) return InvalidParameter; if (!thumbWidth && !thumbHeight) thumbWidth = thumbHeight = 120; else if (!thumbWidth || !thumbHeight) return OutOfMemory; switch (image->type) { case ImageTypeBitmap: format = PixelFormat32bppPARGB; break; case ImageTypeMetafile: format = PixelFormat32bppARGB; break; default: return InvalidParameter; } status = GdipCreateBitmapFromScan0 (thumbWidth, thumbHeight, 0, format, NULL, (GpBitmap **) &result); if (status != Ok) return status; status = GdipGetImageGraphicsContext (result, &graphics); if (status != Ok) { GdipDisposeImage (result); return status; } status = GdipDrawImageRectI (graphics, image, 0, 0, thumbWidth, thumbHeight); if (status != Ok) { GdipDisposeImage (result); GdipDeleteGraphics (graphics); return status; } GdipDeleteGraphics (graphics); *thumbImage = result; return Ok; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipLoadImageFromFileICM (GDIPCONST WCHAR* filename, GpImage **image) { return GdipLoadImageFromFile (filename, image); } const EncoderParameter * gdip_find_encoder_parameter (GDIPCONST EncoderParameters *eps, const GUID *guid) { int i; for (i = 0; i < eps->Count; i++) { if (memcmp (&(eps->Parameter[i].Guid), guid, sizeof(GUID)) == 0) return &(eps->Parameter[i]); } return NULL; } /* GDI+ 1.0 only supports multiple frames on an image for the tiff format */ GpStatus WINGDIPAPI GdipSaveAdd (GpImage *image, GDIPCONST EncoderParameters* encoderParams) { if (!image || !encoderParams) return InvalidParameter; return NotImplemented; } GpStatus WINGDIPAPI GdipSaveAddImage (GpImage *image, GpImage *imageNew, GDIPCONST EncoderParameters *params) { if (!image || !imageNew || !params) return InvalidParameter; return NotImplemented; } GpStatus WINGDIPAPI GdipImageForceValidation (GpImage *image) { if (!image) return InvalidParameter; return Ok; } libgdiplus-6.0.4+dfsg/src/graphics-metafile.c0000644000175000017500000002543313542674535021662 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "graphics-metafile-private.h" /* * NOTE: all parameter's validations are done inside graphics.c */ #define FIT_IN_INT16(x) (((x) >= G_MININT16) && ((x) <= G_MAXINT16)) #define EMFPLUS_FLAGS_USE_SINGLE 0x0000 #define EMFPLUS_FLAGS_FILLMODE_WINDING 0x2000 #define EMFPLUS_FLAGS_USE_INT16 0x4000 #define EMFPLUS_FLAGS_USE_ARGB 0x8000 ATTRIBUTE_USED static BOOL RectFitInInt16 (int x, int y, int width, int height) { return (FIT_IN_INT16(x) && FIT_IN_INT16(y) && FIT_IN_INT16(width) && FIT_IN_INT16(height)); } ATTRIBUTE_USED static BOOL GpRectFitInInt16 (GDIPCONST GpRect *rect) { return (FIT_IN_INT16(rect->X) && FIT_IN_INT16(rect->Y) && FIT_IN_INT16(rect->Width) && FIT_IN_INT16(rect->Height)); } ATTRIBUTE_USED static BOOL GpRectArrayFitInInt16 (GDIPCONST GpRect *rects, int count) { GpRect *r = (GpRect*) rects; int i; for (i = 0; i < count; i++, r++) { if (!GpRectFitInInt16 (r)) return FALSE; } return TRUE; } /* DrawArcs - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawArc.html */ GpStatus metafile_DrawArc (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { /* TODO */ return Ok; } /* DrawBeziers - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawBeziers.html */ GpStatus metafile_DrawBeziers (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) { /* TODO */ return Ok; } /* * DrawClosedCurve - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawClosedCurve.html */ GpStatus metafile_DrawClosedCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count, float tension) { /* TODO */ return Ok; } /* * FillClosedCurve - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillClosedCurve.html */ GpStatus metafile_FillClosedCurve2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, float tension, GpFillMode fillMode) { /* TODO */ return Ok; } /* * DrawCurve - ? */ GpStatus metafile_DrawCurve3 (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPointF *points, int count, int offset, int numOfSegments, float tension) { /* TODO */ return Ok; } /* * DrawEllipse - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawEllipse.html */ GpStatus metafile_DrawEllipse (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height) { /* TODO */ return Ok; } /* * FillEllipse - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillEllipse.html */ GpStatus metafile_FillEllipse (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height) { /* TODO */ return Ok; } /* * DrawLines - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawLines.html */ GpStatus metafile_DrawLines (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) { /* TODO */ return Ok; } /* * DrawPath - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawPath.html */ GpStatus metafile_DrawPath (GpGraphics *graphics, GpPen *pen, GpPath *path) { /* TODO */ return Ok; } /* * FillPath - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillPath.html */ GpStatus metafile_FillPath (GpGraphics *graphics, GpBrush *brush, GpPath *path) { /* TODO */ return Ok; } /* * DrawPie - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawPie.html */ GpStatus metafile_DrawPie (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { /* TODO */ return Ok; } /* * FillPie - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillPie.html */ GpStatus metafile_FillPie (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height, float startAngle, float sweepAngle) { /* TODO */ return Ok; } /* * DrawPolygon - ? */ GpStatus metafile_DrawPolygon (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) { /* TODO */ return Ok; } /* * FillPolygon - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillPolygon.html */ GpStatus metafile_FillPolygon (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, FillMode fillMode) { /* TODO */ return Ok; } /* * DrawRects - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawRects.html */ GpStatus metafile_DrawRectangles (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, int count) { /* TODO */ return Ok; } /* * FillRects - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillRects.html */ GpStatus metafile_FillRectangle (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height) { /* TODO */ return Ok; } GpStatus metafile_FillRectangles (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, int count) { /* TODO */ return Ok; } /* * FillRegion - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillRegion.html */ GpStatus metafile_FillRegion (GpGraphics *graphics, GpBrush *brush, GpRegion *region) { /* TODO */ return Ok; } /* * Clear - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/Clear.html */ GpStatus metafile_GraphicsClear (GpGraphics *graphics, ARGB color) { /* TODO */ return Ok; } /* * SetCompositingMode - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetCompositingMode.html */ GpStatus metafile_SetCompositingMode (GpGraphics *graphics, CompositingMode compositingMode) { /* TODO */ return Ok; } /* * SetCompositingQuality - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetCompositingQuality.html */ GpStatus metafile_SetCompositingQuality (GpGraphics *graphics, CompositingQuality compositingQuality) { /* TODO */ return Ok; } /* * SetInterpolationMode - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetInterpolationMode.html */ GpStatus metafile_SetInterpolationMode (GpGraphics *graphics, InterpolationMode interpolationMode) { /* TODO */ return Ok; } /* * SetPixelOffsetMode - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetPixelOffsetMode.html */ GpStatus metafile_SetPixelOffsetMode (GpGraphics *graphics, PixelOffsetMode pixelOffsetMode) { /* TODO */ return Ok; } /* * SetPageTransform (SetPageUnit+SetPageScale) - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetPageTransform.html */ GpStatus metafile_SetPageTransform (GpGraphics *graphics, GpUnit unit, float scale) { /* TODO */ return Ok; } /* * SetRenderingOrigin - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetRenderingOrigin.html */ GpStatus metafile_SetRenderingOrigin (GpGraphics *graphics, int x, int y) { /* TODO */ return Ok; } /* * SetSmoothingMode - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetAntiAliasMode.html */ GpStatus metafile_SetSmoothingMode (GpGraphics *graphics, SmoothingMode mode) { /* TODO */ return Ok; } /* * GdipSetTextContrast - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetTextContrast.html */ GpStatus metafile_SetTextContrast (GpGraphics *graphics, UINT contrast) { /* TODO */ return Ok; } /* * SetTextRenderingHint - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetTextRenderingHint.html */ GpStatus metafile_SetTextRenderingHint (GpGraphics *graphics, TextRenderingHint mode) { /* TODO */ return Ok; } /* * ResetClip - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/ResetClip.html */ GpStatus metafile_ResetClip (GpGraphics *graphics) { /* TODO */ return Ok; } /* * SetClipPath - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetClipPath.html */ GpStatus metafile_SetClipPath (GpGraphics *graphics, GpPath *path, CombineMode combineMode) { /* TODO */ return Ok; } /* * SetClipRect - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetClipRect.html */ GpStatus metafile_SetClipRect (GpGraphics *graphics, float x, float y, float width, float height, CombineMode combineMode) { /* TODO */ return Ok; } /* * SetClipRegion - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetClipRegion.html */ GpStatus metafile_SetClipRegion (GpGraphics *graphics, GpRegion *region, CombineMode combineMode) { /* TODO */ return Ok; } /* * OffsetClip - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/OffsetClip.html */ GpStatus metafile_TranslateClip (GpGraphics *graphics, float dx, float dy) { /* TODO */ return Ok; } /* * ResetWorldTransform - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/ResetWorldTransform.html */ GpStatus metafile_ResetWorldTransform (GpGraphics *graphics) { /* TODO */ return Ok; } /* * SetWorldTransform - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/SetWorldTransform.html */ GpStatus metafile_SetWorldTransform (GpGraphics *graphics, GpMatrix *matrix) { /* TODO */ return Ok; } /* * http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/MultiplyWorldTransform.html */ GpStatus metafile_MultiplyWorldTransform (GpGraphics *graphics, GpMatrix *matrix, GpMatrixOrder order) { /* TODO */ return Ok; } /* * RotateWorldTransform - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/RotateWorldTransform.html */ GpStatus metafile_RotateWorldTransform (GpGraphics *graphics, float angle, GpMatrixOrder order) { /* TODO */ return Ok; } /* * ScaleWorldTransform - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/ScaleWorldTransform.html */ GpStatus metafile_ScaleWorldTransform (GpGraphics *graphics, float sx, float sy, GpMatrixOrder order) { /* TODO */ return Ok; } /* * TranslateWorldTransform - http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/TranslateWorldTransform.html */ GpStatus metafile_TranslateWorldTransform (GpGraphics *graphics, float dx, float dy, GpMatrixOrder order) { /* TODO */ return Ok; } libgdiplus-6.0.4+dfsg/src/adjustablearrowcap-private.h0000644000175000017500000000364312377405421023616 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __ADJUSTABLEARROWCAP_PRIVATE_H__ #define __ADJUSTABLEARROWCAP_PRIVATE_H__ #include "gdiplus-private.h" #include "customlinecap-private.h" typedef struct _AdjustableArrowCap { CustomLineCap base; float width; float height; float middle_inset; BOOL fill_state; } AdjustableArrowCap; #include "adjustablearrowcap.h" #endif libgdiplus-6.0.4+dfsg/src/solidbrush.c0000644000175000017500000000776713542674535020466 0ustar directhexdirecthex/* * solidbrush.c * * Copyright (c) 2003 Alexandre Pigolkine * Copyright (C) 2007 Novell, Inc. http://www.novell.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. * * Authors: * Alexandre Pigolkine(pigolkine@gmx.de) * Ravindra (rkumar@novell.com) */ #include "solidbrush-private.h" #include "general-private.h" #include "graphics-private.h" static GpStatus gdip_solidfill_setup (GpGraphics *graphics, GpBrush *brush); static GpStatus gdip_solidfill_clone (GpBrush *brush, GpBrush **clonedBrush); static GpStatus gdip_solidfill_destroy (GpBrush *brush); /* * we have a single copy of vtable for * all instances of solidbrush. */ static BrushClass vtable = { BrushTypeSolidColor, gdip_solidfill_setup, gdip_solidfill_clone, gdip_solidfill_destroy }; static void gdip_solidfill_init (GpSolidFill *brush) { gdip_brush_init (&brush->base, &vtable); brush->color = 0x00000000; } static GpSolidFill* gdip_solidfill_new () { GpSolidFill *result = (GpSolidFill *) GdipAlloc (sizeof (GpSolidFill)); if (result) gdip_solidfill_init (result); return result; } GpStatus gdip_solidfill_setup (GpGraphics *graphics, GpBrush *brush) { GpSolidFill *solid; if (!graphics || !brush) return InvalidParameter; solid = (GpSolidFill *) brush; /* We extract the ARGB components of the color, only if the * brush is changed. */ if (solid->base.changed) { BYTE a = (solid->color & 0xFF000000) >> 24; BYTE r = (solid->color & 0x00FF0000) >> 16; BYTE g = (solid->color & 0x0000FF00) >> 8; BYTE b = (solid->color & 0x000000FF); if (a == 0) { solid->A = 0; solid->R = 0; solid->G = 0; solid->B = 0; } else { solid->A = (double) a / 255.0; solid->R = (double) r / 255.0; solid->G = (double) g / 255.0; solid->B = (double) b / 255.0; } } cairo_set_source_rgba (graphics->ct, solid->R, solid->G, solid->B, solid->A); return Ok; } GpStatus gdip_solidfill_clone (GpBrush *brush, GpBrush **clonedBrush) { GpSolidFill *result; GpSolidFill *solid; result = gdip_solidfill_new (); if (!result) return OutOfMemory; solid = (GpSolidFill *) brush; result->base = solid->base; result->color = solid->color; result->base.changed = TRUE; *clonedBrush = (GpBrush *) result; return Ok; } GpStatus gdip_solidfill_destroy (GpBrush *brush) { return Ok; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateSolidFill (ARGB color, GpSolidFill **brush) { GpSolidFill *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!brush) return InvalidParameter; result = gdip_solidfill_new (); if (!result) return OutOfMemory; result->color = color; *brush = result; return Ok; } GpStatus WINGDIPAPI GdipSetSolidFillColor (GpSolidFill *brush, ARGB color) { if (!brush) return InvalidParameter; brush->color = color; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetSolidFillColor (GpSolidFill *brush, ARGB *color) { if (!brush || !color) return InvalidParameter; *color = brush->color; return Ok; } libgdiplus-6.0.4+dfsg/src/pen-private.h0000644000175000017500000000534413542672033020523 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __PEN_PRIVATE_H__ #define __PEN_PRIVATE_H__ #include "gdiplus-private.h" #include "matrix-private.h" struct _Pen { ARGB color; GpBrush *brush; BOOL own_brush; float width; float miter_limit; GpLineJoin line_join; GpDashStyle dash_style; GpLineCap line_cap; /* Cairo supports only same kind of end caps for both the ends. */ GpLineCap end_cap; GpDashCap dash_cap; /* not supported */ int compound_count; float *compound_array; GpPenAlignment mode; float dash_offset; int dash_count; BOOL own_dash_array; /* flag to mark if pen maintains its own array or global array */ float *dash_array; GpUnit unit; /* Always set to UnitWorld. */ cairo_matrix_t matrix; BOOL changed; /* flag to mark if pen is changed and needs setup */ GpCustomLineCap *custom_start_cap; GpCustomLineCap *custom_end_cap; }; GpStatus gdip_pen_setup (GpGraphics *graphics, GpPen *pen) GDIP_INTERNAL; GpStatus gdip_pen_draw_custom_start_cap (GpGraphics *graphics, GpPen *pen, float x1, float y1, float x2, float y2); GpStatus gdip_pen_draw_custom_end_cap (GpGraphics *graphics, GpPen *pen, float x1, float y1, float x2, float y2); #include "pen.h" #endif libgdiplus-6.0.4+dfsg/src/libgdiplus.vcxproj0000644000175000017500000001175713542674535021711 0ustar directhexdirecthex Debug Win32 Release Win32 Debug x64 Release x64 15.0 {BE724C6E-BF07-4B3E-901B-7584BC7B6C8A} libgdiplus 8.1 DynamicLibrary v141 MultiByte $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true Level3 Disabled true false true Level3 MaxSpeed true true true true true true Level3 Disabled true false true Level3 MaxSpeed true true true true true HAVE_LIBGIF;HAVE_LIBJPEG;HAVE_LIBTIFF;HAVE_LIBPNG;HAVE_FCFINI;USE_PANGO_RENDERING;_WINDLL;WIN32;%(PreprocessorDefinitions) Cdecl $(ProjectDir)..\;%(AdditionalIncludeDirectories) shcore.lib;%(AdditionalDependencies) %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "(Get-Content \"$(ProjectDir)\..\winconfig.h.in\") -replace '#LIBGDIPLUS_VERSION#', (Select-String -path \"$(ProjectDir)\..\configure.ac\" -pattern 'AC_INIT\(libgdiplus, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content \"$(ProjectDir)\..\config.h\"" 2>&1 libgdiplus-6.0.4+dfsg/src/win32structs.h0000644000175000017500000004451613542674535020700 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __WIN32STRUCTS_H__ #define __WIN32STRUCTS_H__ #include /* public enums and structures that GDI+ reuse from the other Windows API */ #define LF_FACESIZE 32 #define META_SETBKCOLOR 0x0201 #define META_SETBKMODE 0x0102 #define META_SETMAPMODE 0x0103 #define META_SETROP2 0x0104 #define META_SETRELABS 0x0105 #define META_SETPOLYFILLMODE 0x0106 #define META_SETSTRETCHBLTMODE 0x0107 #define META_SETTEXTCHAREXTRA 0x0108 #define META_SETTEXTCOLOR 0x0209 #define META_SETTEXTJUSTIFICATION 0x020A #define META_SETWINDOWORG 0x020B #define META_SETWINDOWEXT 0x020C #define META_SETVIEWPORTORG 0x020D #define META_SETVIEWPORTEXT 0x020E #define META_OFFSETWINDOWORG 0x020F #define META_SCALEWINDOWEXT 0x0410 #define META_OFFSETVIEWPORTORG 0x0211 #define META_SCALEVIEWPORTEXT 0x0412 #define META_LINETO 0x0213 #define META_MOVETO 0x0214 #define META_EXCLUDECLIPRECT 0x0415 #define META_INTERSECTCLIPRECT 0x0416 #define META_ARC 0x0817 #define META_ELLIPSE 0x0418 #define META_FLOODFILL 0x0419 #define META_PIE 0x081A #define META_RECTANGLE 0x041B #define META_ROUNDRECT 0x061C #define META_PATBLT 0x061D #define META_SAVEDC 0x001E #define META_SETPIXEL 0x041F #define META_OFFSETCLIPRGN 0x0220 #define META_TEXTOUT 0x0521 #define META_BITBLT 0x0922 #define META_STRETCHBLT 0x0B23 #define META_POLYGON 0x0324 #define META_POLYLINE 0x0325 #define META_ESCAPE 0x0626 #define META_RESTOREDC 0x0127 #define META_FILLREGION 0x0228 #define META_FRAMEREGION 0x0429 #define META_INVERTREGION 0x012A #define META_PAINTREGION 0x012B #define META_SELECTCLIPREGION 0x012C #define META_SELECTOBJECT 0x012D #define META_SETTEXTALIGN 0x012E #define META_CHORD 0x0830 #define META_SETMAPPERFLAGS 0x0231 #define META_EXTTEXTOUT 0x0a32 #define META_SETDIBTODEV 0x0d33 #define META_SELECTPALETTE 0x0234 #define META_REALIZEPALETTE 0x0035 #define META_ANIMATEPALETTE 0x0436 #define META_SETPALENTRIES 0x0037 #define META_POLYPOLYGON 0x0538 #define META_RESIZEPALETTE 0x0139 #define META_DIBBITBLT 0x0940 #define META_DIBSTRETCHBLT 0x0b41 #define META_DIBCREATEPATTERNBRUSH 0x0142 #define META_STRETCHDIB 0x0f43 #define META_EXTFLOODFILL 0x0548 #define META_SETLAYOUT 0x0149 #define META_DELETEOBJECT 0x01f0 #define META_CREATEPALETTE 0x00f7 #define META_CREATEPATTERNBRUSH 0x01F9 #define META_CREATEPENINDIRECT 0x02FA #define META_CREATEFONTINDIRECT 0x02FB #define META_CREATEBRUSHINDIRECT 0x02FC #define META_CREATEREGION 0x06FF #define ENHMETA_STOCK_OBJECT 0x80000000 #define EMR_HEADER 1 #define EMR_POLYBEZIER 2 #define EMR_POLYGON 3 #define EMR_POLYLINE 4 #define EMR_POLYBEZIERTO 5 #define EMR_POLYLINETO 6 #define EMR_POLYPOLYLINE 7 #define EMR_POLYPOLYGON 8 #define EMR_SETWINDOWEXTEX 9 #define EMR_SETWINDOWORGEX 10 #define EMR_SETVIEWPORTEXTEX 11 #define EMR_SETVIEWPORTORGEX 12 #define EMR_SETBRUSHORGEX 13 #define EMR_EOF 14 #define EMR_SETPIXELV 15 #define EMR_SETMAPPERFLAGS 16 #define EMR_SETMAPMODE 17 #define EMR_SETBKMODE 18 #define EMR_SETPOLYFILLMODE 19 #define EMR_SETROP2 20 #define EMR_SETSTRETCHBLTMODE 21 #define EMR_SETTEXTALIGN 22 #define EMR_SETCOLORADJUSTMENT 23 #define EMR_SETTEXTCOLOR 24 #define EMR_SETBKCOLOR 25 #define EMR_OFFSETCLIPRGN 26 #define EMR_MOVETOEX 27 #define EMR_SETMETARGN 28 #define EMR_EXCLUDECLIPRECT 29 #define EMR_INTERSECTCLIPRECT 30 #define EMR_SCALEVIEWPORTEXTEX 31 #define EMR_SCALEWINDOWEXTEX 32 #define EMR_SAVEDC 33 #define EMR_RESTOREDC 34 #define EMR_SETWORLDTRANSFORM 35 #define EMR_MODIFYWORLDTRANSFORM 36 #define EMR_SELECTOBJECT 37 #define EMR_CREATEPEN 38 #define EMR_CREATEBRUSHINDIRECT 39 #define EMR_DELETEOBJECT 40 #define EMR_ANGLEARC 41 #define EMR_ELLIPSE 42 #define EMR_RECTANGLE 43 #define EMR_ROUNDRECT 44 #define EMR_ARC 45 #define EMR_CHORD 46 #define EMR_PIE 47 #define EMR_SELECTPALETTE 48 #define EMR_CREATEPALETTE 49 #define EMR_SETPALETTEENTRIES 50 #define EMR_RESIZEPALETTE 51 #define EMR_REALIZEPALETTE 52 #define EMR_EXTFLOODFILL 53 #define EMR_LINETO 54 #define EMR_ARCTO 55 #define EMR_POLYDRAW 56 #define EMR_SETARCDIRECTION 57 #define EMR_SETMITERLIMIT 58 #define EMR_BEGINPATH 59 #define EMR_ENDPATH 60 #define EMR_CLOSEFIGURE 61 #define EMR_FILLPATH 62 #define EMR_STROKEANDFILLPATH 63 #define EMR_STROKEPATH 64 #define EMR_FLATTENPATH 65 #define EMR_WIDENPATH 66 #define EMR_SELECTCLIPPATH 67 #define EMR_ABORTPATH 68 #define EMR_GDICOMMENT 70 #define EMR_FILLRGN 71 #define EMR_FRAMERGN 72 #define EMR_INVERTRGN 73 #define EMR_PAINTRGN 74 #define EMR_EXTSELECTCLIPRGN 75 #define EMR_BITBLT 76 #define EMR_STRETCHBLT 77 #define EMR_MASKBLT 78 #define EMR_PLGBLT 79 #define EMR_SETDIBITSTODEVICE 80 #define EMR_STRETCHDIBITS 81 #define EMR_EXTCREATEFONTINDIRECTW 82 #define EMR_EXTTEXTOUTA 83 #define EMR_EXTTEXTOUTW 84 #define EMR_POLYBEZIER16 85 #define EMR_POLYGON16 86 #define EMR_POLYLINE16 87 #define EMR_POLYBEZIERTO16 88 #define EMR_POLYLINETO16 89 #define EMR_POLYPOLYLINE16 90 #define EMR_POLYPOLYGON16 91 #define EMR_POLYDRAW16 92 #define EMR_CREATEMONOBRUSH 93 #define EMR_CREATEDIBPATTERNBRUSHPT 94 #define EMR_EXTCREATEPEN 95 #define EMR_POLYTEXTOUTA 96 #define EMR_POLYTEXTOUTW 97 #define EMR_SETICMMODE 98 #define EMR_CREATECOLORSPACE 99 #define EMR_SETCOLORSPACE 100 #define EMR_DELETECOLORSPACE 101 #define EMR_GLSRECORD 102 #define EMR_GLSBOUNDEDRECORD 103 #define EMR_PIXELFORMAT 104 #define EMR_RESERVED_105 105 #define EMR_RESERVED_106 106 #define EMR_RESERVED_107 107 #define EMR_RESERVED_108 108 #define EMR_RESERVED_109 109 #define EMR_RESERVED_110 110 #define EMR_COLORCORRECTPALETTE 111 #define EMR_SETICMPROFILEA 112 #define EMR_SETICMPROFILEW 113 #define EMR_ALPHABLEND 114 #define EMR_SETLAYOUT 115 #define EMR_TRANSPARENTBLT 116 #define EMR_RESERVED_117 117 #define EMR_GRADIENTFILL 118 #define EMR_RESERVED_119 119 #define EMR_RESERVED_120 120 #define EMR_COLORMATCHTOTARGETW 121 #define EMR_CREATECOLORSPACEW 122 #define EMR_MIN 1 #define EMR_MAX 97 #define GDICOMMENT_IDENTIFIER 0x43494447 #define GDICOMMENT_WINDOWS_METAFILE 0x80000001 #define GDICOMMENT_BEGINGROUP 0x00000002 #define GDICOMMENT_ENDGROUP 0x00000003 #define GDICOMMENT_MULTIFORMATS 0x40000004 #define EPS_SIGNATURE 0x46535045 #define GDICOMMENT_UNICODE_STRING 0x00000040 #define GDICOMMENT_UNICODE_END 0x0000008 #define WHITE_BRUSH 0 #define LTGRAY_BRUSH 1 #define GRAY_BRUSH 2 #define DKGRAY_BRUSH 3 #define BLACK_BRUSH 4 #define NULL_BRUSH 5 #define HOLLOW_BRUSH NULL_BRUSH #define WHITE_PEN 6 #define BLACK_PEN 7 #define NULL_PEN 8 #define OEM_FIXED_FONT 10 #define ANSI_FIXED_FONT 11 #define ANSI_VAR_FONT 12 #define SYSTEM_FONT 13 #define DEVICE_DEFAULT_FONT 14 #define DEFAULT_PALETTE 15 #define SYSTEM_FIXED_FONT 16 #define DEFAULT_GUI_FONT 17 #define DC_BRUSH 18 #define DC_PEN 19 #define STOCK_LAST 19 /* SetBkMode */ #define TRANSPARENT 1 #define OPAQUE 2 /* SetMapMode */ #define MM_TEXT 1 #define MM_LOMETRIC 2 #define MM_HIMETRIC 3 #define MM_LOENGLISH 4 #define MM_HIENGLISH 5 #define MM_TWIPS 6 #define MM_ISOTROPIC 7 #define MM_ANISOTROPIC 8 /* CreatePenIndirect */ #define PS_SOLID 0x00000000 #define PS_DASH 0x00000001 #define PS_DOT 0x00000002 #define PS_DASHDOT 0x00000003 #define PS_DASHDOTDOT 0x00000004 #define PS_NULL 0x00000005 #define PS_INSIDEFRAME 0x00000006 #define PS_USERSTYLE 0x00000007 #define PS_ALTERNATE 0x00000008 #define PS_STYLE_MASK 0x0000000F #define PS_ENDCAP_ROUND 0x00000000 #define PS_ENDCAP_SQUARE 0x00000100 #define PS_ENDCAP_FLAT 0x00000200 #define PS_ENDCAP_MASK 0x00000F00 #define PS_JOIN_ROUND 0x00000000 #define PS_JOIN_BEVEL 0x00001000 #define PS_JOIN_MITER 0x00002000 #define PS_JOIN_MASK 0x0000F000 #define PS_COSMETIC 0x00000000 #define PS_GEOMETRIC 0x00010000 #define PS_TYPE_MASK 0x000F0000 /* CreateBrushIndirect */ #define BS_SOLID 0 #define BS_NULL 1 #define BS_HATCHED 2 #define BS_PATTERN 3 #define BS_INDEXED 4 /* SetPolyFillMode */ #define ALTERNATE 1 #define WINDING 2 /* SetRelabs */ #define ABSOLUTE 1 #define RELATIVE 2 /* ModifyWorldTransform */ #define MWT_IDENTITY 1 #define MWT_LEFTMULTIPLY 2 #define MWT_RIGHTMULTIPLY 3 /* Compression */ #define BI_RGB 0 #define BI_RLE8 1 #define BI_RLE4 2 #define BI_BITFIELDS 3 typedef float REAL; #if defined(WIN32) #define NOGDI #include #else typedef int INT; typedef guint16 WCHAR; /* 16-bits unicode */ typedef guint32 UINT; typedef guint16 UINT16; typedef guint32 UINT32; typedef gint32 PROPID; typedef guint32 ULONG_PTR; /* not a pointer! */ typedef gpointer HBITMAP; typedef gpointer HDC; typedef gpointer HENHMETAFILE; typedef gpointer HFONT; typedef gpointer HICON; typedef gpointer HINSTANCE; typedef gpointer HMETAFILE; typedef gpointer HPALETTE; typedef gpointer HWND; /* mono/io-layer/uglify.h also has these typedefs. * To avoid a dependency on mono we have copied all * the required stuff here. We don't include our defs * if uglify.h is included somehow. */ #ifndef _WAPI_UGLIFY_H_ /* to avoid conflict with uglify.h */ typedef const gunichar2 *LPCTSTR; typedef gunichar2 *LPTSTR; typedef guint8 BYTE; typedef guint8 *LPBYTE; typedef guint16 WORD; typedef guint32 DWORD; typedef guint64 DWORDLONG; typedef gpointer PVOID; typedef gpointer LPVOID; typedef gboolean BOOL; typedef guint32 *LPDWORD; typedef gint16 SHORT; typedef guint16 USHORT; typedef gint32 LONG; typedef guint32 ULONG; typedef gint32 *PLONG; typedef guint64 LONGLONG; typedef guint64 UINT_PTR; typedef gunichar2 TCHAR; typedef size_t SIZE_T; typedef gpointer HANDLE; typedef gpointer *LPHANDLE; typedef guint32 SOCKET; typedef gpointer HMODULE; typedef gpointer HRGN; #define CONST const #define VOID void #define IN #define OUT #define WINAPI #endif /* to avoid conflict with uglify.h */ typedef WORD LANGID; typedef struct { DWORD Data1; WORD Data2; WORD Data3; BYTE Data4 [8]; } GUID, Guid, CLSID; #endif typedef struct { LONG lfHeight; LONG lfWidth; LONG lfEscapement; LONG lfOrientation; LONG lfWeight; BYTE lfItalic; BYTE lfUnderline; BYTE lfStrikeOut; BYTE lfCharSet; BYTE lfOutPrecision; BYTE lfClipPrecision; BYTE lfQuality; BYTE lfPitchAndFamily; char lfFaceName[LF_FACESIZE]; } LOGFONTA; typedef struct { LONG lfHeight; LONG lfWidth; LONG lfEscapement; LONG lfOrientation; LONG lfWeight; BYTE lfItalic; BYTE lfUnderline; BYTE lfStrikeOut; BYTE lfCharSet; BYTE lfOutPrecision; BYTE lfClipPrecision; BYTE lfQuality; BYTE lfPitchAndFamily; WCHAR lfFaceName[LF_FACESIZE]; } LOGFONTW; typedef struct { float eM11; float eM12; float eM21; float eM22; float eDx; float eDy; } XFORM; #if !defined(WIN32) typedef struct { LONG x; LONG y; } POINT; #endif typedef DWORD COLORREF; typedef struct { UINT lopnStyle; POINT lopnWidth; COLORREF lopnColor; } LOGPEN; typedef struct { UINT lbStyle; COLORREF lbColor; LONG lbHatch; } LOGBRUSH; #if !defined(WIN32) typedef struct { LONG left; LONG top; LONG right; LONG bottom; } RECT, RECTL; typedef struct { LONG cx; LONG cy; } SIZE, SIZEL; #endif typedef struct { SHORT Left; SHORT Top; SHORT Right; SHORT Bottom; } PWMFRect16; typedef struct { BYTE rgbBlue; BYTE rgbGreen; BYTE rgbRed; BYTE rgbReserved; } RGBQUAD, *LPRGBQUAD; typedef LONG FXPT2DOT30; typedef struct { FXPT2DOT30 ciexyzX; FXPT2DOT30 ciexyzY; FXPT2DOT30 ciexyzZ; } CIEXYZ; typedef struct { CIEXYZ ciexyzRed; CIEXYZ ciexyzGreen; CIEXYZ ciexyzBlue; } CIEXYZTRIPLE; typedef struct { DWORD biSize; LONG biWidth; LONG biHeight; WORD biPlanes; WORD biBitCount; DWORD biCompression; DWORD biSizeImage; LONG biXPelsPerMeter; LONG biYPelsPerMeter; DWORD biClrUsed; DWORD biClrImportant; } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; typedef struct { DWORD bV4Size; LONG bV4Width; LONG bV4Height; WORD bV4Planes; WORD bV4BitCount; DWORD bV4Compression; DWORD bV4SizeImage; LONG bV4XPelsPerMeter; LONG bV4YPelsPerMeter; DWORD bV4ClrUsed; DWORD bV4ClrImportant; DWORD bV4RedMask; DWORD bV4GreenMask; DWORD bV4BlueMask; DWORD bV4AlphaMask; DWORD bV4CSType; CIEXYZTRIPLE bV4Endpoints; DWORD bV4GammaRed; DWORD bV4GammaGreen; DWORD bV4GammaBlue; } BITMAPV4HEADER, *PBITMAPV4HEADER; typedef struct { DWORD bV5Size; LONG bV5Width; LONG bV5Height; WORD bV5Planes; WORD bV5BitCount; DWORD bV5Compression; DWORD bV5SizeImage; LONG bV5XPelsPerMeter; LONG bV5YPelsPerMeter; DWORD bV5ClrUsed; DWORD bV5ClrImportant; DWORD bV5RedMask; DWORD bV5GreenMask; DWORD bV5BlueMask; DWORD bV5AlphaMask; DWORD bV5CSType; CIEXYZTRIPLE bV5Endpoints; DWORD bV5GammaRed; DWORD bV5GammaGreen; DWORD bV5GammaBlue; DWORD bV5Intent; DWORD bV5ProfileData; DWORD bV5ProfileSize; DWORD bV5Reserved; } BITMAPV5HEADER, *PBITMAPV5HEADER; typedef struct { BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[1]; } BITMAPINFO, *PBITMAPINFO, *LPBITMAPINFO; #ifndef __GNUC__ #pragma pack(2) #endif typedef struct #ifdef __GNUC__ __attribute__ ((packed)) #endif { WORD mtType; /* 1 for memory, 2 for disk */ WORD mtHeaderSize; WORD mtVersion; DWORD mtSize; WORD mtNoObjects; DWORD mtMaxRecord; WORD mtNoParameters; } METAHEADER; typedef struct #ifdef __GNUC__ __attribute__ ((packed)) #endif { DWORD Key; SHORT Hmf; PWMFRect16 BoundingBox; SHORT Inch; DWORD Reserved; SHORT Checksum; } WmfPlaceableFileHeader; #ifndef __GNUC__ #pragma pack() #endif typedef struct { DWORD iType; DWORD nSize; RECTL rclBounds; RECTL rclFrame; DWORD dSignature; DWORD nVersion; DWORD nBytes; DWORD nRecords; WORD nHandles; WORD sReserved; DWORD nDescription; DWORD offDescription; DWORD nPalEntries; SIZEL szlDevice; SIZEL szlMillimeters; } ENHMETAHEADER3; typedef enum MetafileType { MetafileTypeInvalid, MetafileTypeWmf, MetafileTypeWmfPlaceable, MetafileTypeEmf, MetafileTypeEmfPlusOnly, MetafileTypeEmfPlusDual } MetafileType; typedef struct { MetafileType Type; UINT Size; UINT Version; UINT EmfPlusFlags; REAL DpiX; REAL DpiY; INT X; INT Y; INT Width; INT Height; union { METAHEADER Wmf; ENHMETAHEADER3 Emf; } Header; INT EmfPlusHeaderSize; INT LogicalDpiX; INT LogicalDpiY; } MetafileHeader; #endif libgdiplus-6.0.4+dfsg/src/lineargradientbrush.c0000644000175000017500000010520013545154623022313 0ustar directhexdirecthex/* * lineargradientbrush.c * * Copyright (C) 2003-2004,2007 Novell, Inc. http://www.novell.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. * * Author: * Ravindra (rkumar@novell.com) * */ #include "brush-private.h" #include "lineargradientbrush-private.h" #include "graphics-private.h" #include "matrix-private.h" static GpStatus gdip_linear_gradient_setup (GpGraphics *graphics, GpBrush *brush); static GpStatus gdip_linear_gradient_clone_brush (GpBrush *brush, GpBrush **clonedBrush); static GpStatus gdip_linear_gradient_destroy (GpBrush *brush); /* * we have a single copy of vtable for * all instances of lineargradient brush. */ static BrushClass vtable = { BrushTypeLinearGradient, gdip_linear_gradient_setup, gdip_linear_gradient_clone_brush, gdip_linear_gradient_destroy }; static GpStatus gdip_linear_gradient_init (GpLineGradient *linear) { gdip_brush_init (&linear->base, &vtable); linear->wrapMode = WrapModeTile; cairo_matrix_init_identity (&linear->matrix); linear->rectangle.X = linear->rectangle.Y = linear->rectangle.Width = linear->rectangle.Height = 0.0f; linear->gammaCorrection = FALSE; linear->angle = 0.0; linear->isAngleScalable = FALSE; linear->presetColors = (InterpolationColors *) GdipAlloc (sizeof (InterpolationColors)); if (!linear->presetColors) { return OutOfMemory; } linear->presetColors->count = 0; linear->blend = (Blend *) GdipAlloc (sizeof (Blend)); if (!linear->blend) { GdipFree (linear->presetColors); return OutOfMemory; } linear->blend->count = 1; linear->blend->factors = (float *) GdipAlloc (sizeof (float)); if (!linear->blend->factors) { GdipFree (linear->presetColors); GdipFree (linear->blend); return OutOfMemory; } linear->blend->positions = (float *) GdipAlloc (sizeof (float)); if (!linear->blend->positions) { GdipFree (linear->presetColors); GdipFree (linear->blend->factors); GdipFree (linear->blend); return OutOfMemory; } linear->blend->factors [0] = 1.0; linear->blend->positions[0] = 0.0; linear->pattern = NULL; return Ok; } static GpLineGradient* gdip_linear_gradient_new (void) { GpLineGradient *result = (GpLineGradient *) GdipAlloc (sizeof (GpLineGradient)); if (result) { if (gdip_linear_gradient_init (result) == Ok) return result; GdipFree (result); } return NULL; } GpStatus gdip_linear_gradient_clone_brush (GpBrush *brush, GpBrush **clonedBrush) { GpLineGradient *linear; GpLineGradient *newbrush; if (!brush || !clonedBrush) return InvalidParameter; newbrush = gdip_linear_gradient_new (); if (!newbrush) return OutOfMemory; linear = (GpLineGradient *) brush; newbrush->base = linear->base; newbrush->wrapMode = linear->wrapMode; gdip_cairo_matrix_copy (&newbrush->matrix, &linear->matrix); memcpy (&newbrush->rectangle, &linear->rectangle, sizeof (GpRectF)); newbrush->gammaCorrection = linear->gammaCorrection; newbrush->angle = linear->angle; newbrush->isAngleScalable = linear->isAngleScalable; /* cloned brush needs to have its own pattern */ newbrush->base.changed = TRUE; newbrush->pattern = NULL; newbrush->lineColors [0] = linear->lineColors [0]; newbrush->lineColors [1] = linear->lineColors [1]; newbrush->points [0].X = linear->points [0].X; newbrush->points [0].Y = linear->points [0].Y; newbrush->points [1].X = linear->points [1].X; newbrush->points [1].Y = linear->points [1].Y; newbrush->presetColors = (InterpolationColors *) GdipAlloc (sizeof (InterpolationColors)); if (newbrush->presetColors == NULL) goto failure; newbrush->presetColors->count = linear->presetColors->count; if (linear->presetColors->count > 0) { newbrush->presetColors->colors = (ARGB *) GdipAlloc (linear->presetColors->count * sizeof (ARGB)); if (newbrush->presetColors->colors == NULL) goto failure; memcpy (newbrush->presetColors->colors, linear->presetColors->colors, linear->presetColors->count * sizeof (ARGB)); newbrush->presetColors->positions = (float *) GdipAlloc (linear->presetColors->count * sizeof (float)); if (!newbrush->presetColors->positions) goto failure; memcpy (newbrush->presetColors->positions, linear->presetColors->positions, linear->presetColors->count * sizeof (float)); } else { memcpy (newbrush->presetColors, linear->presetColors, sizeof (InterpolationColors)); } newbrush->blend = (Blend *) GdipAlloc (sizeof (Blend)); if (!newbrush->blend) goto failure; newbrush->blend->count = linear->blend->count; if (linear->blend->count > 0) { newbrush->blend->factors = (float *) GdipAlloc (linear->blend->count * sizeof (float)); if (!newbrush->blend->factors) goto failure; memcpy (newbrush->blend->factors, linear->blend->factors, linear->blend->count * sizeof (ARGB)); newbrush->blend->positions = (float *) GdipAlloc (linear->blend->count * sizeof (float)); if (!newbrush->blend->positions) goto failure; memcpy (newbrush->blend->positions, linear->blend->positions, linear->blend->count * sizeof (float)); } else { memcpy (newbrush->blend, linear->blend, sizeof (Blend)); } *clonedBrush = (GpBrush *) newbrush; return Ok; failure: GdipDeleteBrush ((GpBrush *) newbrush); *clonedBrush = NULL; return OutOfMemory; } GpStatus gdip_linear_gradient_destroy (GpBrush *brush) { /* a. the NULL check for brush is done by the caller, GdipDeleteBrush */ /* b. brush itself is freed by the caller */ GpLineGradient *linear = (GpLineGradient *) brush; if (linear->blend) { if (linear->blend->count > 0) { GdipFree (linear->blend->factors); GdipFree (linear->blend->positions); } GdipFree (linear->blend); linear->blend = NULL; } if (linear->presetColors) { if (linear->presetColors->count > 0) { GdipFree (linear->presetColors->colors); GdipFree (linear->presetColors->positions); } GdipFree (linear->presetColors); linear->presetColors = NULL; } if (linear->pattern) { cairo_pattern_destroy (linear->pattern); linear->pattern = NULL; } return Ok; } static void add_color_stops_from_blend (cairo_pattern_t *pattern, Blend *blend, ARGB *colors) { int index; double sr, sg, sb, sa; double er, eg, eb, ea; double offset, factor; sa = (colors[0] >> 24) & 0xFF; sr = (colors[0] >> 16) & 0xFF; sg = (colors[0] >> 8) & 0xFF; sb = colors[0] & 0xFF; ea = (colors[1] >> 24) & 0xFF; er = (colors[1] >> 16) & 0xFF; eg = (colors[1] >> 8) & 0xFF; eb = colors[1] & 0xFF; for (index = 0; index < blend->count; index++) { factor = blend->factors [index]; offset = blend->positions [index]; cairo_pattern_add_color_stop_rgba (pattern, offset, ((sr * (1 - factor)) + (er * factor)) / 255, ((sg * (1 - factor)) + (eg * factor)) / 255, ((sb * (1 - factor)) + (eb * factor)) / 255, ((sa * (1 - factor)) + (ea * factor)) / 255); } } static void add_color_stops_from_interpolation_colors (cairo_pattern_t *pattern, InterpolationColors *presetColors) { int index; double r, g, b, a; double offset; ARGB color; /* MS accecpts positions above 1.0 also. Cairo assumes the values above 1.0 as 1.0 * and values below 0 are assumed as 0. So we get different results if any of the * offset values is out of [0.0, 1.0]. */ for (index = 0; index < presetColors->count; index++) { color = presetColors->colors [index]; a = (color >> 24) & 0xFF; r = (color >> 16) & 0xFF; g = (color >> 8) & 0xFF; b = color & 0xFF; offset = presetColors->positions [index]; cairo_pattern_add_color_stop_rgba (pattern, offset, r / 255, g / 255, b / 255, a / 255); } } static void add_color_stops (cairo_pattern_t *pattern, ARGB *colors) { double r, g, b, a; a = (colors[0] >> 24) & 0xFF; r = (colors[0] >> 16) & 0xFF; g = (colors[0] >> 8) & 0xFF; b = colors[0] & 0xFF; /* set start color */ cairo_pattern_add_color_stop_rgba (pattern, 0.0, r / 255, g / 255, b / 255, a / 255); a = (colors[1] >> 24) & 0xFF; r = (colors[1] >> 16) & 0xFF; g = (colors[1] >> 8) & 0xFF; b = colors[1] & 0xFF; /* set end color */ cairo_pattern_add_color_stop_rgba (pattern, 1.0, r / 255, g / 255, b / 255, a / 255); } static GpStatus create_tile_linear (GpGraphics *graphics, cairo_t *ct, GpLineGradient *linear) { GpStatus status; cairo_pattern_t *pat; cairo_matrix_t matrix; if (!graphics || !ct || !linear) return InvalidParameter; gdip_cairo_matrix_copy (&matrix, &linear->matrix); status = GdipInvertMatrix (&matrix); if (status != Ok) return status; pat = cairo_pattern_create_linear (linear->points [0].X, linear->points [0].Y, linear->points [1].X, linear->points [1].Y); status = gdip_get_pattern_status (pat); if (status != Ok) return status; cairo_pattern_set_matrix (pat, &matrix); if (linear->blend->count > 1) add_color_stops_from_blend (pat, linear->blend, linear->lineColors); else if (linear->presetColors->count > 1) add_color_stops_from_interpolation_colors (pat, linear->presetColors); else add_color_stops (pat, linear->lineColors); linear->pattern = pat; return Ok; } GpStatus gdip_linear_gradient_setup (GpGraphics *graphics, GpBrush *brush) { cairo_t *ct; GpLineGradient *linear; GpStatus status = Ok; if (!graphics || !brush) return InvalidParameter; ct = graphics->ct; if (!ct) return InvalidParameter; linear = (GpLineGradient *) brush; /* We create the new pattern for brush, if the brush is changed * or if pattern has not been created yet. */ if (linear->base.changed || !linear->pattern) { /* destroy the existing pattern */ if (linear->pattern) { cairo_pattern_destroy (linear->pattern); linear->pattern = NULL; } if (linear->wrapMode == WrapModeClamp) return InvalidParameter; status = create_tile_linear (graphics, ct, linear); if ((status == Ok) && linear->pattern) { switch (linear->wrapMode) { case WrapModeTile: case WrapModeTileFlipY: cairo_pattern_set_extend (linear->pattern, CAIRO_EXTEND_REPEAT); break; case WrapModeTileFlipX: case WrapModeTileFlipXY: cairo_pattern_set_extend (linear->pattern, CAIRO_EXTEND_REFLECT); break; default : return InvalidParameter; // we will never get here but I hate warnings! } cairo_set_source (ct, linear->pattern); return gdip_get_status (cairo_status (ct)); } } if ((status == Ok) && linear->pattern) { cairo_set_source (ct, linear->pattern); return gdip_get_status (cairo_status (ct)); } return status; } static void gdip_linear_gradient_setup_initial_matrix (GpLineGradient *linear) { float cosAngle, sinAngle, absCosAngle, absSinAngle; float transX, transY, wRatio, hRatio, slope, rectRight, rectBottom; GpPointF pts[3]; GpRectF *rectf = &linear->rectangle; cosAngle = cos (linear->angle); sinAngle = sin (linear->angle); absCosAngle = fabs (cosAngle); absSinAngle = fabs (sinAngle); cairo_matrix_init_identity (&linear->matrix); transX = rectf->X + (rectf->Width / 2.0f); transY = rectf->Y + (rectf->Height / 2.0f); wRatio = (absCosAngle * rectf->Width + absSinAngle * rectf->Height) / rectf->Width; hRatio = (absSinAngle * rectf->Width + absCosAngle * rectf->Height) / rectf->Height; cairo_matrix_translate (&linear->matrix, transX, transY); cairo_matrix_rotate (&linear->matrix, linear->angle); cairo_matrix_scale (&linear->matrix, wRatio, hRatio); cairo_matrix_translate (&linear->matrix, -transX, -transY); if (linear->isAngleScalable && !gdip_near_zero (cosAngle) && !gdip_near_zero (sinAngle)) { rectRight = rectf->X + rectf->Width; rectBottom = rectf->Y + rectf->Height; pts[0].X = rectf->X; pts[0].Y = rectf->Y; pts[1].X = rectRight; pts[1].Y = rectf->Y; pts[2].X = rectf->X; pts[2].Y = rectBottom; GdipTransformMatrixPoints (&linear->matrix, pts, 3); if (sinAngle > 0 && cosAngle > 0) { slope = -1.0f / ((rectf->Width / rectf->Height) * tan (linear->angle)); pts[0].Y = (slope * (pts[0].X - rectf->X)) + rectf->Y; pts[1].X = ((pts[1].Y - rectBottom) / slope) + rectRight; pts[2].X = ((pts[2].Y - rectf->Y) / slope) + rectf->X; } else if (sinAngle > 0 && cosAngle < 0) { slope = -1.0f / ((rectf->Width / rectf->Height) * tan (linear->angle - PI / 2)); pts[0].X = ((pts[0].Y - rectBottom) / slope) + rectRight; pts[1].Y = (slope * (pts[1].X - rectRight)) + rectBottom; pts[2].Y = (slope * (pts[2].X - rectf->X)) + rectf->Y; } else if (sinAngle < 0 && cosAngle < 0) { slope = -1.0f / (((rectf->Width / rectf->Height) * tan (linear->angle))); pts[0].Y = (slope * (pts[0].X - rectRight)) + rectBottom; pts[1].X = ((pts[1].Y - rectf->Y) / slope) + rectf->X; pts[2].X = ((pts[2].Y - rectBottom) / slope) + rectRight; } else { slope = -1.0f / ((rectf->Width / rectf->Height) * tan (linear->angle - 3 * PI / 2)); pts[0].X = ((pts[0].Y - rectf->Y) / slope) + rectf->X; pts[1].Y = (slope * (pts[1].X - rectf->X)) + rectf->Y; pts[2].Y = (slope * (pts[2].X - rectRight)) + rectBottom; } gdip_matrix_init_from_rect_3points (&linear->matrix, rectf, (GpPointF*)&pts); } } // coverity[+alloc : arg-*5] GpStatus WINGDIPAPI GdipCreateLineBrushI (GDIPCONST GpPoint *point1, GDIPCONST GpPoint *point2, ARGB color1, ARGB color2, GpWrapMode wrapMode, GpLineGradient **lineGradient) { GpPointF p1, p2; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!point1 || !point2 || !lineGradient || wrapMode == WrapModeClamp) return InvalidParameter; p1.X = point1->X; p1.Y = point1->Y; p2.X = point2->X; p2.Y = point2->Y; return GdipCreateLineBrush (&p1, &p2, color1, color2, wrapMode, lineGradient); } // coverity[+alloc : arg-*5] GpStatus WINGDIPAPI GdipCreateLineBrush (GDIPCONST GpPointF *point1, GDIPCONST GpPointF *point2, ARGB color1, ARGB color2, GpWrapMode wrapMode, GpLineGradient **lineGradient) { GpLineGradient *linear; BOOL xFlipped = FALSE; BOOL yFlipped = FALSE; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!point1 || !point2 || !lineGradient || wrapMode == WrapModeClamp) return InvalidParameter; // For GDI+ compat. A zero-length gradient isn't well-defined. if (point1->X == point2->X && point1->Y == point2->Y) return OutOfMemory; linear = gdip_linear_gradient_new (); if (!linear) return OutOfMemory; linear->wrapMode = wrapMode; linear->lineColors [0] = color1; linear->lineColors [1] = color2; linear->isAngleScalable = FALSE; linear->rectangle.Width = point2->X - point1->X; linear->rectangle.Height = point2->Y - point1->Y; linear->rectangle.X = linear->rectangle.Width < 0 ? point2->X : point1->X; linear->rectangle.Y = linear->rectangle.Height < 0 ? point2->Y : point1->Y; if (linear->rectangle.Width < 0) { linear->rectangle.Width = -linear->rectangle.Width; xFlipped = TRUE; } if (linear->rectangle.Height < 0) { linear->rectangle.Height = -linear->rectangle.Height; yFlipped = TRUE; } if (linear->rectangle.Height == 0) { linear->rectangle.Height = linear->rectangle.Width; linear->rectangle.Y = linear->rectangle.Y - (linear->rectangle.Height / 2.0f); linear->angle = xFlipped ? 180 : 0; } else if (linear->rectangle.Width == 0) { linear->rectangle.Width = linear->rectangle.Height; linear->rectangle.X = linear->rectangle.X - (linear->rectangle.Width / 2.0f); linear->angle = yFlipped ? 270 : 90; } else { float slope = linear->rectangle.Height / linear->rectangle.Width; float newAngleRad = atan (slope); float newAngle = (newAngleRad / (DEGTORAD)); if (xFlipped) newAngle = 180 - newAngle; if (yFlipped) newAngle = 360 - newAngle; linear->angle = newAngle; } linear->points [0].X = linear->rectangle.X; linear->points [0].Y = linear->rectangle.Y; linear->points [1].X = linear->rectangle.X + linear->rectangle.Width; linear->points [1].Y = linear->rectangle.Y; linear->angle = linear->angle * DEGTORAD; gdip_linear_gradient_setup_initial_matrix (linear); *lineGradient = linear; return Ok; } static float get_angle_from_linear_gradient_mode (LinearGradientMode mode) { switch (mode) { case LinearGradientModeVertical: return 90.0; case LinearGradientModeForwardDiagonal: return 45.0; case LinearGradientModeBackwardDiagonal: return 135.0; case LinearGradientModeHorizontal: default: return 0; } } // coverity[+alloc : arg-*5] GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI (GDIPCONST GpRect *rect, ARGB color1, ARGB color2, LinearGradientMode mode, GpWrapMode wrapMode, GpLineGradient **lineGradient) { GpRectF rectf; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!rect || !lineGradient) return InvalidParameter; if (mode < LinearGradientModeHorizontal || mode > LinearGradientModeBackwardDiagonal) { *lineGradient = NULL; return OutOfMemory; } gdip_RectF_from_Rect (rect, &rectf); return GdipCreateLineBrushFromRect (&rectf, color1, color2, mode, wrapMode, lineGradient); } // coverity[+alloc : arg-*5] GpStatus WINGDIPAPI GdipCreateLineBrushFromRect (GDIPCONST GpRectF *rect, ARGB color1, ARGB color2, LinearGradientMode mode, GpWrapMode wrapMode, GpLineGradient **lineGradient) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!rect || !lineGradient) return InvalidParameter; if (mode < LinearGradientModeHorizontal || mode > LinearGradientModeBackwardDiagonal) { *lineGradient = NULL; return OutOfMemory; } return GdipCreateLineBrushFromRectWithAngle (rect, color1, color2, get_angle_from_linear_gradient_mode (mode), TRUE, wrapMode, lineGradient); } // coverity[+alloc : arg-*6] GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI (GDIPCONST GpRect *rect, ARGB color1, ARGB color2, REAL angle, BOOL isAngleScalable, GpWrapMode wrapMode, GpLineGradient **lineGradient) { GpRectF rectf; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!rect || !lineGradient) return InvalidParameter; gdip_RectF_from_Rect (rect, &rectf); return GdipCreateLineBrushFromRectWithAngle (&rectf, color1, color2, angle, isAngleScalable, wrapMode, lineGradient); } // coverity[+alloc : arg-*6] GpStatus GdipCreateLineBrushFromRectWithAngle (GDIPCONST GpRectF *rect, ARGB color1, ARGB color2, REAL angle, BOOL isAngleScalable, GpWrapMode wrapMode, GpLineGradient **lineGradient) { GpLineGradient *linear; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!rect || !lineGradient || wrapMode == WrapModeClamp) return InvalidParameter; if (rect->Width == 0.0 || rect->Height == 0.0) { *lineGradient = NULL; return OutOfMemory; } linear = gdip_linear_gradient_new (); if (!linear) return OutOfMemory; linear->wrapMode = wrapMode; linear->lineColors [0] = color1; linear->lineColors [1] = color2; linear->angle = fmod (angle, 360) * DEGTORAD; linear->isAngleScalable = isAngleScalable; linear->points [0].X = rect->X; linear->points [0].Y = rect->Y; linear->points [1].X = rect->X + rect->Width + 1; linear->points [1].Y = rect->Y; memcpy (&linear->rectangle, rect, sizeof (GpRectF)); gdip_linear_gradient_setup_initial_matrix (linear); *lineGradient = linear; return Ok; } GpStatus WINGDIPAPI GdipGetLineBlendCount (GpLineGradient *brush, INT *count) { if (!brush || !count) return InvalidParameter; *count = brush->blend->count; return Ok; } GpStatus WINGDIPAPI GdipSetLineBlend (GpLineGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *positions, INT count) { float *blendFactors; float *blendPositions; if (!brush || !blend || !positions || count <= 0) return InvalidParameter; if (count >= 2 && (positions[0] != 0.0f || positions[count - 1] != 1.0f)) return InvalidParameter; if (brush->blend->count != count) { blendFactors = (float *) GdipAlloc (count * sizeof (float)); if (!blendFactors) return OutOfMemory; blendPositions = (float *) GdipAlloc (count * sizeof (float)); if (!blendPositions) { GdipFree (blendFactors); return OutOfMemory; } /* free the existing values */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); } brush->blend->factors = blendFactors; brush->blend->positions = blendPositions; } for (int index = 0; index < count; index++) { brush->blend->factors [index] = blend [index]; brush->blend->positions [index] = positions [index]; } brush->blend->count = count; /* we clear the preset colors when setting the blend */ if (brush->presetColors->count != 0) { GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); brush->presetColors->count = 0; } brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetLineBlend (GpLineGradient *brush, REAL *blend, REAL *positions, INT count) { if (!brush || !blend || !positions || count <= 0) return InvalidParameter; if (count < brush->blend->count) return InsufficientBuffer; /* If count is less than 1, we are not in a proper state * to return blend property. By default, we have one blend * set. Therefore, count of 1 is acceptible. */ if (brush->blend->count < 1) return WrongState; memcpy (blend, brush->blend->factors, brush->blend->count * sizeof (float)); // Don't copy anything to positions if the count is one, as positions requires at least 2 values in the array. if (brush->blend->count > 1) memcpy (positions, brush->blend->positions, brush->blend->count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipSetLineGammaCorrection (GpLineGradient *brush, BOOL useGammaCorrection) { if (!brush) return InvalidParameter; brush->gammaCorrection = useGammaCorrection; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetLineGammaCorrection (GpLineGradient *brush, BOOL *useGammaCorrection) { if (!brush || !useGammaCorrection) return InvalidParameter; *useGammaCorrection = brush->gammaCorrection; return Ok; } GpStatus WINGDIPAPI GdipGetLinePresetBlendCount (GpLineGradient *brush, INT *count) { if (!brush || !count) return InvalidParameter; *count = brush->presetColors->count; return Ok; } GpStatus WINGDIPAPI GdipSetLinePresetBlend (GpLineGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *positions, INT count) { ARGB *blendColors; float *blendPositions; if (!brush || !blend || !positions || count < 2 || positions[0] != 0.0f || positions[count - 1] != 1.0f) return InvalidParameter; if (brush->presetColors->count != count) { blendColors = (ARGB *) GdipAlloc (count * sizeof (ARGB)); if (!blendColors) return OutOfMemory; blendPositions = (float *) GdipAlloc (count * sizeof (float)); if (!blendPositions) { GdipFree (blendColors); return OutOfMemory; } /* free the existing values */ if (brush->presetColors->count != 0) { GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); } brush->presetColors->colors = blendColors; brush->presetColors->positions = blendPositions; } for (int index = 0; index < count; index++) { brush->presetColors->colors [index] = blend [index]; brush->presetColors->positions [index] = positions [index]; } brush->presetColors->count = count; /* we clear the blend when setting preset colors */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); brush->blend->count = 0; } brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetLinePresetBlend (GpLineGradient *brush, ARGB *blend, REAL *positions, INT count) { if (!brush || !blend || !positions || count < 2) return InvalidParameter; if (brush->presetColors->count == 0) return GenericError; /* If count is less than 2, we are not in a proper state * to return presetblend property. */ if (brush->presetColors->count < 2) return WrongState; memcpy (blend, brush->presetColors->colors, count * sizeof (ARGB)); memcpy (positions, brush->presetColors->positions, count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipSetLineColors (GpLineGradient *brush, ARGB color1, ARGB color2) { if (!brush) return InvalidParameter; brush->lineColors[0] = color1; brush->lineColors[1] = color2; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetLineColors (GpLineGradient *brush, ARGB *colors) { if (!brush || !colors) return InvalidParameter; colors [0] = brush->lineColors[0]; colors [1] = brush->lineColors[1]; return Ok; } GpStatus WINGDIPAPI GdipGetLineRectI (GpLineGradient *brush, GpRect *rect) { if (!brush || !rect) return InvalidParameter; gdip_Rect_from_RectF (&brush->rectangle, rect); return Ok; } GpStatus WINGDIPAPI GdipGetLineRect (GpLineGradient *brush, GpRectF *rect) { if (!brush || !rect) return InvalidParameter; memcpy (rect, &brush->rectangle, sizeof (GpRectF)); return Ok; } GpStatus WINGDIPAPI GdipGetLineTransform (GpLineGradient *brush, GpMatrix *matrix) { if (!brush || !matrix) return InvalidParameter; gdip_cairo_matrix_copy (matrix, &brush->matrix); return Ok; } GpStatus WINGDIPAPI GdipSetLineTransform (GpLineGradient *brush, GDIPCONST GpMatrix *matrix) { BOOL invertible; if (!brush || !matrix) return InvalidParameter; /* the matrix MUST be invertible to be used */ GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; gdip_cairo_matrix_copy (&brush->matrix, matrix); brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetLineWrapMode (GpLineGradient *brush, GpWrapMode *wrapMode) { if (!brush || !wrapMode) return InvalidParameter; *wrapMode = brush->wrapMode; return Ok; } GpStatus WINGDIPAPI GdipSetLineWrapMode (GpLineGradient *brush, GpWrapMode wrapMode) { if (!brush || (wrapMode == WrapModeClamp)) return InvalidParameter; if (wrapMode > WrapModeClamp) return Ok; brush->wrapMode = wrapMode; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetLineLinearBlend (GpLineGradient *brush, REAL focus, REAL scale) { float *blends; float *positions; int count = 3; if (!brush || focus < 0 || focus > 1 || scale < 0 || scale > 1) return InvalidParameter; if (focus == 0 || focus == 1) { count = 2; } if (brush->blend->count != count) { blends = (float *) GdipAlloc (count * sizeof (float)); if (!blends) return OutOfMemory; positions = (float *) GdipAlloc (count * sizeof (float)); if (!positions) { GdipFree (blends); return OutOfMemory; } /* free the existing values */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); } brush->blend->factors = blends; brush->blend->positions = positions; } /* we clear the preset colors when setting the blend */ if (brush->presetColors->count != 0) { GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); brush->presetColors->count = 0; } /* set the blend colors */ if (focus == 0) { brush->blend->positions [0] = focus; brush->blend->factors [0] = scale; brush->blend->positions [1] = 1; brush->blend->factors [1] = 0; } else if (focus == 1) { brush->blend->positions [0] = 0; brush->blend->factors [0] = 0; brush->blend->positions [1] = focus; brush->blend->factors [1] = scale; } else { brush->blend->positions [0] = 0; brush->blend->factors [0] = 0; brush->blend->positions [1] = focus; brush->blend->factors [1] = scale; brush->blend->positions [2] = 1; brush->blend->factors [2] = 0; } brush->blend->count = count; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetLineSigmaBlend (GpLineGradient *brush, REAL focus, REAL scale) { float *blends; float *positions; float pos = 0.0; int count = 511; /* total no of samples */ int index; float sigma; float mean; float fall_off_len = 2.0; /* curve fall off length in terms of SIGMA */ float delta; /* distance between two samples */ /* we get a curve not starting from 0 and not ending at 1. * so we subtract the starting value and divide by the curve * height to make it fit in the 0 to scale range */ float curve_bottom; float curve_top; float curve_height; if (!brush || focus < 0 || focus > 1 || scale < 0 || scale > 1) return InvalidParameter; if (focus == 0 || focus == 1) { count = 256; } if (brush->blend->count != count) { blends = (float *) GdipAlloc (count * sizeof (float)); if (!blends) return OutOfMemory; positions = (float *) GdipAlloc (count * sizeof (float)); if (!positions) { GdipFree (blends); return OutOfMemory; } /* free the existing values */ if (brush->blend->count != 0) { GdipFree (brush->blend->factors); GdipFree (brush->blend->positions); } brush->blend->factors = blends; brush->blend->positions = positions; } /* we clear the preset colors when setting the blend */ if (brush->presetColors->count != 0) { GdipFree (brush->presetColors->colors); GdipFree (brush->presetColors->positions); brush->presetColors->count = 0; } /* Set the blend colors. We use integral of the Normal Distribution, * i.e. Cumulative Distribution Function (CFD). * * Normal distribution: * * y (x) = (1 / sqrt (2 * PI * sq (sigma))) * exp (-sq (x - mu)/ (2 * sq (sigma))) * * where, y = height of normal curve, * sigma = standard deviation * mu = mean * OR * y (x) = peak * exp ( - z * z / 2) * where, z = (x - mu) / sigma * * In this curve, peak would occur at mean i.e. for x = mu. This results in * a peak value of peak = (1 / sqrt (2 * PI * sq (sigma))). * * Cumulative distribution function: * Ref: http://mathworld.wolfram.com/NormalDistribution.html * * D (x) = (1 / 2) [1 + erf (z)] * where, z = (x - mu) / (sigma * sqrt (2)) * */ if (focus == 0) { /* right part of the curve with a complete fall in fall_off_len * SIGMAs */ sigma = 1.0 / fall_off_len; mean = 0.5; delta = 1.0 / 255.0; curve_bottom = 0.5 * (1.0 - gdip_erf (1.0, sigma, mean)); curve_top = 0.5 * (1.0 - gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; /* set the start */ brush->blend->positions [0] = focus; brush->blend->factors [0] = scale; for (index = 1, pos = delta; index < 255; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 - gdip_erf (pos, sigma, mean)) - curve_bottom); } /* set the end */ brush->blend->positions [count - 1] = 1.0; brush->blend->factors [count - 1] = 0.0; } else if (focus == 1) { /* left part of the curve with a complete rise in fall_off_len * SIGMAs */ sigma = 1.0 / fall_off_len; mean = 0.5; delta = 1.0 / 255.0; curve_bottom = 0.5 * (1.0 + gdip_erf (0.0, sigma, mean)); curve_top = 0.5 * (1.0 + gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; /* set the start */ brush->blend->positions [0] = 0.0; brush->blend->factors [0] = 0.0; for (index = 1, pos = delta; index < 255; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 + gdip_erf (pos, sigma, mean)) - curve_bottom); } /* set the end */ brush->blend->positions [count - 1] = focus; brush->blend->factors [count - 1] = scale; } else { /* left part of the curve with a complete fall in fall_off_len * SIGMAs */ sigma = focus / (2 * fall_off_len); mean = focus / 2.0; delta = focus / 255.0; /* set the start */ brush->blend->positions [0] = 0.0; brush->blend->factors [0] = 0.0; curve_bottom = 0.5 * (1.0 + gdip_erf (0.0, sigma, mean)); curve_top = 0.5 * (1.0 + gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; for (index = 1, pos = delta; index < 255; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 + gdip_erf (pos, sigma, mean)) - curve_bottom); } brush->blend->positions [index] = focus; brush->blend->factors [index] = scale; /* right part of the curve with a complete fall in fall_off_len * SIGMAs */ sigma = (1.0 - focus) / (2 * fall_off_len); mean = (1.0 + focus) / 2.0; delta = (1.0 - focus) / 255.0; curve_bottom = 0.5 * (1.0 - gdip_erf (1.0, sigma, mean)); curve_top = 0.5 * (1.0 - gdip_erf (focus, sigma, mean)); curve_height = curve_top - curve_bottom; index ++; pos = focus + delta; for (; index < 510; index++, pos += delta) { brush->blend->positions [index] = pos; brush->blend->factors [index] = (scale / curve_height) * (0.5 * (1.0 - gdip_erf (pos, sigma, mean)) - curve_bottom); } /* set the end */ brush->blend->positions [count - 1] = 1.0; brush->blend->factors [count - 1] = 0.0; } brush->blend->count = count; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipMultiplyLineTransform (GpLineGradient *brush, GpMatrix *matrix, GpMatrixOrder order) { BOOL invertible; if (!brush) return InvalidParameter; if (!matrix) return Ok; /* the matrix MUST be invertible to be used */ GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; if (order == MatrixOrderPrepend) cairo_matrix_multiply (&brush->matrix, matrix, &brush->matrix); else cairo_matrix_multiply (&brush->matrix, &brush->matrix, matrix); brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipResetLineTransform (GpLineGradient *brush) { if (!brush) return InvalidParameter; cairo_matrix_init_identity (&brush->matrix); brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipRotateLineTransform (GpLineGradient *brush, REAL angle, GpMatrixOrder order) { GpStatus status; if (!brush) return InvalidParameter; status = GdipRotateMatrix (&brush->matrix, angle, order); if (status != Ok) return status; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipScaleLineTransform (GpLineGradient *brush, REAL sx, REAL sy, GpMatrixOrder order) { GpStatus status; if (!brush) return InvalidParameter; status = GdipScaleMatrix (&brush->matrix, sx, sy, order); if (status != Ok) return status; brush->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipTranslateLineTransform (GpLineGradient *brush, REAL dx, REAL dy, GpMatrixOrder order) { GpStatus status; if (!brush) return InvalidParameter; status = GdipTranslateMatrix (&brush->matrix, dx, dy, order); if (status != Ok) return status; brush->base.changed = TRUE; return Ok; } libgdiplus-6.0.4+dfsg/src/wmfcodec.h0000644000175000017500000000402713542674535020066 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __WMFCODEC_H__ #define __WMFCODEC_H__ #include "gdiplus-private.h" #include "graphics-private.h" #include "metafile-private.h" #define WMF_MIN_RECORD_SIZE 6 #define WMF_CHECK_PARAMS(x) do { \ if (params < (x)) goto cleanup; \ } while (0) #define RECORDSIZE 0 #define FUNCTION 4 #define WP1 6 #define WP2 8 #define WP3 10 #define WP4 12 #define WP5 14 #define WP6 16 #define WP7 18 #define WP8 20 #define WP9 22 #define WP10 24 #define WP11 26 #define WP12 28 #define WP(y) (4 + ((y) << 1)) #define gdip_read_wmf_data gdip_read_bmp_data GpStatus gdip_load_wmf_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_wmf_image_from_stream_delegate (dstream_t *loader, GpImage **image) GDIP_INTERNAL; /* no save functions as the WMF "codec" is a decoder only */ ImageCodecInfo* gdip_getcodecinfo_wmf () GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/region-path-tree.c0000644000175000017500000002105113542674535021440 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "region-path-tree.h" #include "graphics-path-private.h" /* * gdip_region_clear_tree: * @tree: a GpPathTree to clear * * Recursively clear (delete path and free memory) the specified path tree. */ void gdip_region_clear_tree (GpPathTree *tree) { if (!tree) return; if (tree->path) { GdipDeletePath (tree->path); tree->path = NULL; } else { gdip_region_clear_tree (tree->branch1); GdipFree (tree->branch1); gdip_region_clear_tree (tree->branch2); GdipFree (tree->branch2); } } /* * gdip_region_copy_tree: * @source: the GpPathTree to copy * @dest: the GpPathTree copy * * Recursively copy (and allocate) the @source path tree into @dest. * If @source is present then we must have a valid @dest. */ GpStatus gdip_region_copy_tree (GpPathTree *source, GpPathTree *dest) { GpStatus status; if (!source) return Ok; g_assert (dest); if (source->path) { status = GdipClonePath (source->path, &dest->path); if (status != Ok) return status; dest->branch1 = NULL; dest->branch2 = NULL; } else { dest->path = NULL; dest->mode = source->mode; dest->branch1 = (GpPathTree *) GdipAlloc (sizeof (GpPathTree)); if (!dest->branch1) return OutOfMemory; status = gdip_region_copy_tree (source->branch1, dest->branch1); if (status != Ok) return status; dest->branch2 = (GpPathTree *) GdipAlloc (sizeof (GpPathTree)); if (!dest->branch2) return OutOfMemory; status = gdip_region_copy_tree (source->branch2, dest->branch2); if (status != Ok) return status; } return Ok; } /* * gdip_region_get_tree_size: * @tree: a GpPathTree * * Recursively calculate the size (in bytes) required to serialized @tree. */ UINT gdip_region_get_tree_size (GpPathTree *tree) { UINT result; if (tree->path) { /* tag, count, fillmode, types and points */ result = 3 * sizeof (UINT) + (tree->path->count * sizeof (BYTE)) + (tree->path->count * sizeof (GpPointF)); } else { /* tag, operation, size (branch1), branch1, size (branch2), branch2 */ result = 4 * sizeof (guint32); result += gdip_region_get_tree_size (tree->branch1); result += gdip_region_get_tree_size (tree->branch2); } return result; } /* * gdip_region_deserialize_tree: * @data: a byte array * @size: the length of the byte array * @tree: a GpPathTree * * Recursively deserialize the @tree from the supplied buffer @data. Returns * TRUE if the deserialization was possible, or FALSE if a problem was found * (e.g. @size mismatch, bad data...) */ BOOL gdip_region_deserialize_tree (BYTE *data, int size, GpPathTree *tree) { int len = sizeof (guint32); guint32 tag; memcpy (&tag, data, len); data += len; size -= len; switch (tag) { case REGION_TAG_PATH: { /* deserialize a path from the memory blob */ guint32 count; FillMode mode; tree->mode = CombineModeReplace; tree->branch1 = NULL; tree->branch2 = NULL; /* count */ memcpy (&count, data, len); data += len; size -= len; /* mode (FillMode, not CombineMode) */ memcpy (&mode, data, len); data += len; size -= len; /* check that the size match the length of the type (byte) and GpPointF for the specified count */ if (size == count + count * sizeof (GpPointF)) { BYTE* types = data; GpPointF *points = (GpPointF*) (data + count); return (GdipCreatePath2 (points, types, count, mode, &tree->path) == Ok); } return FALSE; } break; case REGION_TAG_TREE: { guint branch_size; tree->path = NULL; /* operation */ memcpy (&tree->mode, data, len); data += len; size -= len; /* size (branch1) */ memcpy (&branch_size, data, len); data += len; size -= len; /* deserialize a tree from the memory blob */ tree->branch1 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!tree->branch1) return FALSE; if (!gdip_region_deserialize_tree (data, branch_size, tree->branch1)) return FALSE; data += branch_size; size -= branch_size; /* size (branch2) */ memcpy (&branch_size, data, len); data += len; size -= len; tree->branch2 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!tree->branch2) return FALSE; if (!gdip_region_deserialize_tree (data, branch_size, tree->branch2)) return FALSE; } break; default: g_warning ("Invalid tag %d", tag); return FALSE; } return TRUE; } /* * gdip_region_serialize_tree: * @tree: a GpPathTree * @buffer: a byte array * @bufferSize: the length of the byte array * @sizeFilled: a pointer to a integer * * Recursively serialize the @tree data in the supplied @buffer. Returns TRUE * if the serialization was possible, or FALSE if a problem was found (e.g. * @bufferSize too small). If successful @sizeFilled will contains the actual * number of bytes that were required to serialize @tree. */ BOOL gdip_region_serialize_tree (GpPathTree *tree, BYTE *buffer, UINT bufferSize, UINT *sizeFilled) { if (tree->path) { /* tag */ guint32 temp = REGION_TAG_PATH; int len = sizeof (guint32); memcpy (buffer, &temp, len); buffer += len; *sizeFilled += len; /* count */ memcpy (buffer, &tree->path->count, len); buffer += len; *sizeFilled += len; /* fill_mode */ temp = tree->path->fill_mode; memcpy (buffer, &temp, len); buffer += len; *sizeFilled += len; /* types */ len = tree->path->count; memcpy (buffer, tree->path->types, len); buffer += len; *sizeFilled += len; /* points */ len = tree->path->count * sizeof (GpPointF); memcpy (buffer, tree->path->points, len); buffer += len; *sizeFilled += len; } else { /* tag */ BYTE *original = buffer; guint32 temp = REGION_TAG_TREE; int len = sizeof (guint32); memcpy (buffer, &temp, len); buffer += len; *sizeFilled += len; /* operation */ temp = tree->mode; memcpy (buffer, &temp, len); buffer += len; *sizeFilled += len; /* serialize branch 1 (size + branch) */ temp = gdip_region_get_tree_size (tree->branch1); memcpy (buffer, &temp, len); buffer += len; *sizeFilled += len; if (!gdip_region_serialize_tree (tree->branch1, buffer, bufferSize - (buffer - original), sizeFilled)) return FALSE; buffer += temp; /* serialize branch 2 (size + branch) */ temp = gdip_region_get_tree_size (tree->branch2); memcpy (buffer, &temp, len); buffer += len; *sizeFilled += len; if (!gdip_region_serialize_tree (tree->branch2, buffer, bufferSize - (buffer - original), sizeFilled)) return FALSE; } return TRUE; } /* * gdip_region_transform_tree: * @tree: a GpPathTree * @matrix: the GpMatrix to apply to the tree * * Recursively apply the @matrix to the @tree. */ GpStatus gdip_region_transform_tree (GpPathTree *tree, GpMatrix *matrix) { if (tree->path) { return GdipTransformPath (tree->path, matrix); } else { GpStatus status; status = gdip_region_transform_tree (tree->branch1, matrix); if (status == Ok) status = gdip_region_transform_tree (tree->branch2, matrix); return status; } } /* * gdip_region_translate_tree: * @tree: a GpPathTree * @dx: the delta x to apply to each point * @dy: the delta y to apply to each point * * Recursively apply the @dx, @dy translation to each point, of each path, * in the @tree. */ void gdip_region_translate_tree (GpPathTree *tree, float dx, float dy) { if (tree->path) { int i; for (i = 0; i < tree->path->count; i++) { GpPointF *point = tree->path->points + i; point->X += dx; point->Y += dy; } } else { gdip_region_translate_tree (tree->branch1, dx, dy); gdip_region_translate_tree (tree->branch2, dx, dy); } } libgdiplus-6.0.4+dfsg/src/fontfamily.h0000644000175000017500000000540413542674535020447 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __FONTFAMILY_H__ #define __FONTFAMILY_H__ /* FontFamily public API (only!) */ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName (GDIPCONST WCHAR *name, GpFontCollection *fontCollection, GpFontFamily **fontFamily); GpStatus WINGDIPAPI GdipCloneFontFamily (GpFontFamily *fontFamily, GpFontFamily **clonedFontFamily); GpStatus WINGDIPAPI GdipDeleteFontFamily (GpFontFamily *fontFamily); GpStatus WINGDIPAPI GdipGetCellAscent (GDIPCONST GpFontFamily *family, INT style, UINT16 *CellAscent); GpStatus WINGDIPAPI GdipGetCellDescent (GDIPCONST GpFontFamily *family, INT style, UINT16 *CellDescent); GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif (GpFontFamily **nativeFamily); GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif (GpFontFamily **nativeFamily); GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace (GpFontFamily **nativeFamily); GpStatus WINGDIPAPI GdipGetEmHeight (GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight); GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *family, WCHAR name[LF_FACESIZE], LANGID language); GpStatus WINGDIPAPI GdipGetLineSpacing (GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing); GpStatus WINGDIPAPI GdipIsStyleAvailable (GDIPCONST GpFontFamily *family, INT style, BOOL *IsStyleAvailable); #endif libgdiplus-6.0.4+dfsg/src/lineargradientbrush-private.h0000644000175000017500000000423212377405421023770 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __LINEARGRADIENT_PRIVATE_H__ #define __LINEARGRADIENT_PRIVATE_H__ #include "gdiplus-private.h" #include "brush-private.h" #include "matrix-private.h" #define DEFAULT_GRADIENT_ANGLE 45.0f typedef struct _LineGradient { GpBrush base; ARGB lineColors [2]; GpPointF points [2]; GpRectF rectangle; GpMatrix matrix; GpWrapMode wrapMode; float angle; Blend *blend; InterpolationColors *presetColors; cairo_pattern_t *pattern; BOOL isAngleScalable; BOOL gammaCorrection; /* FIXME: Not used */ } LineGradient; #include "lineargradientbrush.h" #endif libgdiplus-6.0.4+dfsg/src/region.c0000644000175000017500000017327013545154623017556 0ustar directhexdirecthex/* * Copyright (c) 2004-2005 Ximian * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Jordi Mas i Hernandez , 2004-2005 * Sebastien Pouliot * */ #include "region-private.h" #include "general-private.h" #include "graphics-path-private.h" /* Helper functions */ void gdip_region_init (GpRegion *result) { result->type = RegionTypeInfinite; result->cnt = 0; result->rects = NULL; result->tree = NULL; result->bitmap = NULL; } GpRegion * gdip_region_new () { GpRegion *result; result = (GpRegion *) GdipAlloc (sizeof (GpRegion)); if (result) gdip_region_init (result); return result; } static int gdip_compare_rectf (const void *a, const void *b) { const GpRectF *r1 = (GpRectF*)a; const GpRectF *r2 = (GpRectF*)b; if (r1->Y == r2->Y && r1->X == r2->X) return 0; if (r1->Y > r2->Y || (r1->Y == r2->Y && r1->X > r2->X)) return 1; return -1; } static void gdip_sort_rect_array (GpRectF* array, int length) { qsort (array, length, sizeof (GpRectF), gdip_compare_rectf); } // Not a mistake in the name, it is for re-sorting nearly-sorted data. // Insertion sort. static void gdip_sort_rect_array_sorted (GpRectF* array, int length) { GpRectF rect; GpRectF *i, *j; for (i = array + 1; i < array + length; i++) { rect = *i; for (j = i - 1; j >= array && gdip_compare_rectf (j, &rect) > 0; j--) { *(j + 1) = *j; } *(j + 1) = rect; } } static GpStatus gdip_extend_rect_array (GpRectF** srcarray, int* elements, int* capacity) { GpRectF *array; int newCapacity = -1; if (capacity) { if (*srcarray == NULL) { if (*capacity < 1) *capacity = 5; // starting capacity if we're given a size of zero newCapacity = *capacity; } else if (*elements == *capacity) { newCapacity = *elements * 2; } } else { newCapacity = *elements + 1; } if (newCapacity > 0) { array = GdipAlloc (sizeof (GpRectF) * newCapacity); if (!array) return OutOfMemory; memcpy (array, *srcarray, sizeof (GpRectF) * (*elements)); if (*srcarray) GdipFree (*srcarray); *srcarray = array; if (capacity) *capacity = newCapacity; } return Ok; } static GpStatus gdip_trim_rect_array (GpRectF** srcarray, int elements) { GpRectF *array; array = GdipAlloc (sizeof (GpRectF) * elements); if (!array) return OutOfMemory; memcpy (array, *srcarray, sizeof (GpRectF) * elements); if (*srcarray) GdipFree (*srcarray); *srcarray = array; return Ok; } static GpStatus gdip_add_rect_to_array (GpRectF** srcarray, int* elements, int* capacity, const GpRectF* rect) { GpRectF *next; GpStatus status; status = gdip_extend_rect_array (srcarray, elements, capacity); if (status != Ok) return status; next = *srcarray; next += (*elements); memcpy (next, rect, sizeof (GpRectF)); *elements = *elements + 1; return Ok; } static GpRectF* gdip_binsearch_rect_array (GpRectF* array, int elements, const GpRectF* search, int* index) { GpRectF *next; int upper = elements, lower = 0, mid; while (upper > lower) { mid = (upper + lower) / 2; next = array + mid; if (gdip_compare_rectf (search, next) > 0) { lower = mid + 1; } else { upper = mid; } } next = array + lower; if (index) *index = lower; return next; } static GpStatus gdip_add_rect_to_array_sorted (GpRectF** srcarray, int* elements, int* capacity, const GpRectF* rect) { GpRectF *next; GpStatus status; int insertAt; status = gdip_extend_rect_array (srcarray, elements, capacity); if (status != Ok) return status; next = gdip_binsearch_rect_array (*srcarray, *elements, rect, &insertAt); memmove (next + 1, next, sizeof (GpRectF) * (*elements - insertAt)); memcpy (next, rect, sizeof (GpRectF)); *elements = *elements + 1; return Ok; } static BOOL gdip_is_Point_in_RectF_Visible (float x, float y, GpRectF* rect) { if ((x >= rect->X && x < (rect->X + rect->Width)) && (y >= rect->Y && y < (rect->Y + rect->Height))) return TRUE; else return FALSE; } static BOOL gdip_is_Point_in_RectFs_Visible (float x, float y, GpRectF* r, int cnt) { GpRectF* rect = r; int i; for (i = 0; i < cnt; i++, rect++) { if (gdip_is_Point_in_RectF_Visible (x, y, rect)) { return TRUE; } } return FALSE; } static BOOL gdip_is_Rect_in_RectF_Visible (float x, float y, float width, float height, GpRectF* rect) { if (rect->Width == 0 || rect->Height == 0) return FALSE; return x < rect->X + rect->Width && x + width > rect->X && y < rect->Y + rect->Height && y + height > rect->Y; } static BOOL gdip_is_Rect_in_RectFs_Visible (float x, float y, float width, float height, GpRectF* r, int cnt) { GpRectF* rect = r; int i; for (i = 0; i < cnt; i++, rect++) { if (gdip_is_Rect_in_RectF_Visible (x, y, width, height, rect)) return TRUE; } return FALSE; } static void gdip_get_bounds (GpRectF *allrects, int allcnt, GpRectF *bound) { float nx, ny, fx, fy; int i; GpRectF *rect; if (allrects == NULL || allcnt == 0) { bound->X = bound->Y = bound->Width = bound->Height = 0; return; } /* Build a rect that contains all the rects inside. Smallest x,y and biggest x,y*/ nx = allrects->X; ny = allrects->Y; fx = allrects->X + allrects->Width; fy = allrects->Y + allrects->Height; for (i = 0, rect = allrects; i < allcnt; i++, rect++) { if (rect->X < nx) nx = rect->X; if (rect->Y < ny) ny = rect->Y; if (rect->X + rect->Width > fx) fx = rect->X + rect->Width; if (rect->Y + rect->Height > fy) fy = rect->Y + rect->Height; } bound->X = nx; bound->Y = ny; bound->Width = fx - nx; bound->Height = fy - ny; } static BOOL gdip_is_region_empty (const GpRegion *region, BOOL allowNegative) { GpRectF rect; if (!region) return FALSE; switch (region->type) { case RegionTypeRect: if (!region->rects || (region->cnt == 0)) return TRUE; gdip_get_bounds (region->rects, region->cnt, &rect); return gdip_is_rectF_empty (&rect, allowNegative); case RegionTypeInfinite: return FALSE; case RegionTypePath: if (!region->tree) return TRUE; if (region->tree->path) { if (region->tree->path->count == 0) return TRUE; // Open paths are empty. if (!gdip_path_closed (region->tree->path)) return TRUE; } if (region->bitmap && (region->bitmap->Width == 0 || region->bitmap->Height == 0)) return TRUE; return FALSE; default: g_warning ("unknown type 0x%08X", region->type); return FALSE; } } static BOOL gdip_is_rect_infinite (const GpRectF *rect) { if (!rect) return FALSE; if (gdip_is_rectF_empty (rect, /* allowNegative */ TRUE)) return FALSE; if (rect->Width >= REGION_INFINITE_LENGTH || rect->Height >= REGION_INFINITE_LENGTH) return TRUE; return FALSE; } BOOL gdip_is_InfiniteRegion (const GpRegion *region) { switch (region->type) { case RegionTypeRect: if (region->cnt != 1) return FALSE; return gdip_is_rect_infinite (region->rects); case RegionTypePath: /* FIXME: incomplete and not 100% accurate (curves) - but cover the most common case */ if (!region->tree || !region->tree->path) return FALSE; if (gdip_path_closed (region->tree->path) && region->tree->path->count == 4) { GpRectF bounds; if (GdipGetPathWorldBounds (region->tree->path, &bounds, NULL, NULL) == Ok) return gdip_is_rect_infinite (&bounds); } break; case RegionTypeInfinite: return TRUE; default: g_warning ("unknown type 0x%08X", region->type); break; } return FALSE; } static BOOL gdip_intersects (const GpRectF *rect1, const GpRectF *rect2) { return (rect1->X < rect2->X + rect2->Width && rect1->X + rect1->Width > rect2->X && rect1->Y < rect2->Y + rect2->Height && rect1->Y + rect1->Height > rect2->Y); } static BOOL gdip_intersects_or_touches (GpRectF *rect1, GpRectF *rect2) { return (rect1->X <= rect2->X + rect2->Width && rect1->X + rect1->Width >= rect2->X && rect1->Y <= rect2->Y + rect2->Height && rect1->Y + rect1->Height >= rect2->Y); } /* Is source contained in target ? */ static BOOL gdip_contains (GpRectF *rect1, GpRectF *rect2) { return (rect1->X >= rect2->X && rect1->X + rect1->Width <= rect2->X + rect2->Width && rect1->Y >= rect2->Y && rect1->Y + rect1->Height <= rect2->Y + rect2->Height); } static BOOL gdip_add_rect_to_array_notcontained (GpRectF** srcarray, int* elements, int* capacity, GpRectF* rect) { int i; GpRectF* rectarray = *srcarray; if (rect->Height <= 0 || rect->Width <= 0) return FALSE; for (i = 0; i < *elements; i++, rectarray++) { if (gdip_contains (rect, rectarray) == TRUE) { return FALSE; } } gdip_add_rect_to_array (srcarray, elements, capacity, rect); return TRUE; } static BOOL gdip_equals (GpRectF *rect1, GpRectF *rect2) { if (!rect1) return (rect2 == NULL); return (rect1->X == rect2->X && rect1->Width == rect2->Width && rect1->Y == rect2->Y && rect1->Height == rect2->Height); } BOOL gdip_is_Point_in_RectF_inclusive (float x, float y, GpRectF* rect) { if ((x >= rect->X && x <= (rect->X + rect->Width)) && (y >= rect->Y && y <= (rect->Y + rect->Height))) return TRUE; else return FALSE; } /* Finds a rect that has the lowest x and y after the src rect provided */ static BOOL gdip_getlowestrect (GpRectF *rects, int cnt, GpRectF* src, GpRectF* rslt) { int i; GpRectF *current; GpRectF *lowest = NULL; for (i = 0, current = rects; i < cnt; i++, current++) { if (current->Width <= 0 || current->Height <= 0) continue; if (current->Y > src->Y || (current->Y == src->Y && current->X > src->X)) { if (lowest == NULL) { lowest = current; } else { if (current->Y < lowest->Y || (current->Y == lowest->Y && current->X < lowest->X)) { lowest = current; } } } } if (lowest == NULL) { return FALSE; } rslt->X = lowest->X; rslt->Y = lowest->Y; rslt->Width = lowest->Width; rslt->Height = lowest->Height; return TRUE; } void gdip_clear_region (GpRegion *region) { region->type = RegionTypeInfinite; if (region->rects) { GdipFree (region->rects); region->rects = NULL; } if (region->tree) { gdip_region_clear_tree (region->tree); GdipFree (region->tree); region->tree = NULL; } if (region->bitmap) { gdip_region_bitmap_free (region->bitmap); region->bitmap = NULL; } region->cnt = 0; } GpStatus gdip_copy_region (GpRegion *source, GpRegion *dest) { GpStatus status; dest->type = source->type; if (source->rects) { dest->cnt = source->cnt; dest->rects = (GpRectF *) GdipAlloc (sizeof (GpRectF) * source->cnt); if (!dest->rects) return OutOfMemory; memcpy (dest->rects, source->rects, sizeof (GpRectF) * source->cnt); } else { dest->cnt = 0; dest->rects = NULL; } if (source->tree) { dest->tree = (GpPathTree *) GdipAlloc (sizeof (GpPathTree)); if (!dest->tree) return OutOfMemory; status = gdip_region_copy_tree (source->tree, dest->tree); if (status != Ok) return status; } else { dest->tree = NULL; } if (source->bitmap) { dest->bitmap = gdip_region_bitmap_clone (source->bitmap); } else { dest->bitmap = NULL; } return Ok; } /* convert a rectangle-based region to a path based region */ static GpStatus gdip_region_convert_to_path (GpRegion *region) { GpStatus status; /* no conversion is required for complex regions */ if (!region || (region->type == RegionTypePath)) return Ok; region->tree = (GpPathTree *) GdipAlloc (sizeof (GpPathTree)); if (!region->tree) return OutOfMemory; status = GdipCreatePath (FillModeAlternate, ®ion->tree->path); if (status != Ok) return status; switch (region->type) { case RegionTypeRect: case RegionTypeInfinite: { /* all rectangles are converted into a single path */ for (int i = 0; i < region->cnt; i++) { RectF normalized; gdip_normalize_rectangle (®ion->rects[i], &normalized); GdipAddPathRectangle (region->tree->path, normalized.X, normalized.Y, normalized.Width, normalized.Height); } break; } default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } if (region->rects) { GdipFree (region->rects); region->cnt = 0; region->rects = NULL; } region->type = RegionTypePath; return Ok; } /* * Create a region (path-tree) from a path. */ static GpStatus gdip_region_create_from_path (GpRegion *region, GpPath *path) { region->type = RegionTypePath; region->tree = (GpPathTree *) GdipAlloc (sizeof (GpPathTree)); if (!region->tree) return OutOfMemory; return GdipClonePath (path, ®ion->tree->path); } /* API implementation */ // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipCreateRegion (GpRegion **region) { GpRegion *result; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!region) return InvalidParameter; result = gdip_region_new (); if (!result) return OutOfMemory; /* GdipSetInfinite handles setting region->type. */ status = GdipSetInfinite (result); if (status != Ok) { GdipDeleteRegion (result); return status; } *region = result; return Ok; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateRegionRect (GDIPCONST GpRectF *rect, GpRegion **region) { GpRegion *result; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!region || !rect) return InvalidParameter; result = gdip_region_new (); if (!result) return OutOfMemory; result->type = RegionTypeRect; status = gdip_add_rect_to_array (&result->rects, &result->cnt, NULL, rect); if (status != Ok) { GdipDeleteRegion (result); return status; } *region = result; return Ok; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateRegionRectI (GDIPCONST GpRect *rect, GpRegion **region) { GpRectF rectF; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!region || !rect) return InvalidParameter; gdip_RectF_from_Rect (rect, &rectF); return GdipCreateRegionRect (&rectF, region); } // coverity[+alloc : arg-*2] GpStatus WINGDIPAPI GdipCreateRegionRgnData (GDIPCONST BYTE *regionData, INT size, GpRegion **region) { GpRegion *result; RegionHeader header; DWORD type; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!region || !regionData || size < 0) return InvalidParameter; /* Read and validate the region data header. */ if (size < sizeof (RegionHeader)) return GenericError; memcpy (&header, regionData, sizeof (RegionHeader)); if (header.size < 8 || header.checksum != gdip_crc32 (regionData + 8, size - 8) || (header.magic & 0xfffff000) != 0xdbc01000) { return GenericError; } regionData += sizeof (RegionHeader); size -= sizeof (RegionHeader); /* Now read the rest of the data. */ result = gdip_region_new (); if (!result) return OutOfMemory; result->cnt = 0; result->rects = NULL; result->tree = NULL; result->bitmap = NULL; // Read the type. memcpy (&type, regionData, sizeof (DWORD)); regionData += sizeof (DWORD); size -= sizeof (DWORD); switch (type) { case RegionDataRect: result->type = RegionTypeRect; if (header.size < sizeof (DWORD) * 3 + sizeof (GpRectF)) { GdipFree (result); return GenericError; } GpRectF rect; memcpy (&rect, regionData, sizeof (GpRectF)); gdip_add_rect_to_array (&result->rects, &result->cnt, NULL, &rect); break; case RegionDataPath: result->type = RegionTypePath; if (size < 16) { GdipFree (result); return InvalidParameter; } result->tree = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!result->tree) { GdipFree (result); return OutOfMemory; } if (!gdip_region_deserialize_tree ((BYTE *) regionData, size, result->tree)) { GdipFree (result); return InvalidParameter; } break; case RegionDataEmptyRect: { result->type = RegionTypeRect; break; } case RegionDataInfiniteRect: { result->type = RegionTypeInfinite; GpRectF rect = {REGION_INFINITE_POSITION, REGION_INFINITE_POSITION, REGION_INFINITE_LENGTH, REGION_INFINITE_LENGTH}; gdip_add_rect_to_array (&result->rects, &result->cnt, NULL, &rect); break; } default: g_warning ("unknown type 0x%08X", result->type); GdipFree (result); return NotImplemented; } *region = result; return Ok; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCloneRegion (GpRegion *region, GpRegion **cloneRegion) { GpRegion *result; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!region || !cloneRegion) return InvalidParameter; result = (GpRegion *) GdipAlloc (sizeof (GpRegion)); if (!result) return OutOfMemory; status = gdip_copy_region (region, result); if (status != Ok) { GdipFree (result); return status; } *cloneRegion = result; return Ok; } GpStatus WINGDIPAPI GdipDeleteRegion (GpRegion *region) { if (!region) return InvalidParameter; gdip_clear_region (region); GdipFree (region); return Ok; } GpStatus WINGDIPAPI GdipSetInfinite (GpRegion *region) { GpRectF rect; if (!region) return InvalidParameter; gdip_clear_region (region); region->type = RegionTypeInfinite; rect.X = rect.Y = REGION_INFINITE_POSITION; rect.Width = rect.Height = REGION_INFINITE_LENGTH; return gdip_add_rect_to_array (®ion->rects, ®ion->cnt, NULL, &rect); } GpStatus WINGDIPAPI GdipSetEmpty (GpRegion *region) { if (!region) return InvalidParameter; gdip_clear_region (region); region->type = RegionTypeRect; return Ok; } /* Exclude */ static GpStatus gdip_combine_exclude (GpRegion *region, GpRectF *rtrg, int cntt) { GpRectF *allsrcrects = NULL, *rects = NULL; GpRectF *alltrgrects = NULL, *rect, *rectop, *recttrg; int allsrccnt = 0, allsrccap, cnt = 0, cap, i, n, alltrgcnt = 0, alltrgcap; GpRectF current, rslt, newrect; BOOL storecomplete; GpStatus status; /* Create the list of source rectangles to process, it will contain splitted ones later */ allsrccap = region->cnt * 2; cap = allsrccap; for (i = 0, rect = region->rects; i < region->cnt; i++, rect++) { status = gdip_add_rect_to_array (&allsrcrects, &allsrccnt, &allsrccap, rect); if (status != Ok) { if (allsrcrects) { GdipFree (allsrcrects); } return status; } } /* Create the list of target rectangles to process, it will contain splitted ones later */ alltrgcap = cntt; for (i = 0, rect = rtrg; i < cntt; i++, rect++) { /* normalize */ GpRectF normal; gdip_normalize_rectangle (rect, &normal); status = gdip_add_rect_to_array (&alltrgrects, &alltrgcnt, &alltrgcap, &normal); if (status != Ok) { if (alltrgrects) { GdipFree (alltrgrects); } return status; } } /* Init current with the first element in the array */ current.X = REGION_INFINITE_POSITION - 1; current.Y = REGION_INFINITE_POSITION - 1; current.Width = 0; current.Height = 0; while (gdip_getlowestrect (allsrcrects, allsrccnt, ¤t, &rslt)) { current.X = rslt.X; current.Y = rslt.Y; current.Width = rslt.Width; current.Height = rslt.Height; storecomplete = TRUE; /* Current rect with lowest y and X against the target ones */ for (i = 0, recttrg = alltrgrects; i < alltrgcnt; i++, recttrg++) { if (gdip_intersects (¤t, recttrg) == FALSE || gdip_equals (¤t, recttrg) == TRUE || recttrg->Height < 0 || recttrg->Width < 0) { continue; } /* Once a rect is splitted, we do not want to take into account anymore */ for (rectop = allsrcrects, n = 0; n < allsrccnt; n++, rectop++) { if (gdip_equals (¤t, rectop)) { rectop->X = 0; rectop->Y = 0; rectop->Width = 0; rectop->Height = 0; break; } } /* Result rect */ newrect.Y = current.Y; if (current.Y >= recttrg->Y) { /* Our rect intersects in the upper part with another rect */ newrect.Height = MIN (recttrg->Y + recttrg->Height - current.Y, current.Height); if (newrect.Height < 0) newrect.Height = current.Height; if (current.X >= recttrg->X) { /* Hit from behind */ newrect.X = recttrg->X + recttrg->Width; newrect.Width = MAX (current.X + current.Width - newrect.X, 0); } else { newrect.X = current.X; newrect.Width = MAX (recttrg->X - current.X, 0); } } else { newrect.Height = MIN (recttrg->Y - current.Y, current.Height); newrect.X = current.X; newrect.Width = current.Width; } gdip_add_rect_to_array_notcontained (&rects, &cnt, &cap, &newrect); /* What's left to process from the source region */ if (current.Y >= recttrg->Y) { /* Our rect intersects in the upper part with another rect */ /* A whole part from the top has been taken*/ if (recttrg->X <= current.X && recttrg->X + recttrg->Width >= current.X + current.Width) rslt.Y = recttrg->Y + recttrg->Height; else rslt.Y = newrect.Y + newrect.Height; rslt.Height = current.Y + current.Height - rslt.Y; } else { rslt.Y = recttrg->Y; rslt.Height = current.Y + current.Height - recttrg->Y; } rslt.X = current.X; rslt.Width = current.Width; if (rslt.Height > 0 && rslt.Width > 0) { status = gdip_add_rect_to_array (&allsrcrects, &allsrccnt, &allsrccap, &rslt); if (status != Ok) { GdipFree (allsrcrects); GdipFree (alltrgrects); return status; } } /* Special case where our rect is hit and split in two parts IIIUIII */ if (recttrg->X >= current.X && recttrg->X + recttrg->Width <= current.X + current.Width) { /* Generate extra right rect, keep previous values of Y and Height */ newrect.Width = current.X + current.Width - (recttrg->X + recttrg->Width); newrect.X = recttrg->X + recttrg->Width; gdip_add_rect_to_array_notcontained (&rects, &cnt, &cap, &newrect); } storecomplete = FALSE; break; } /* don't include a rectangle identical to the excluded one! */ if (storecomplete && !gdip_equals (rtrg, ¤t)) { gdip_add_rect_to_array_notcontained (&rects, &cnt, &cap, ¤t); } } gdip_trim_rect_array (&rects, cnt); GdipFree (allsrcrects); GdipFree (alltrgrects); if (region->rects) GdipFree (region->rects); region->rects = rects; region->cnt = cnt; return Ok; } /* Complement: the part of the second region not shared with the first region. Scans the region to be combined and store the rects not present in the region */ static GpStatus gdip_combine_complement (GpRegion *region, GpRectF *rtrg, int cntt) { GpRegion regsrc; GpRectF* trg, *rect; GpRectF* allsrcrects = NULL; int allsrccnt = 0, i, trgcnt, allsrccap; GpStatus status; /* Create the list of source rectangles to process */ allsrccap = cntt; for (i = 0, rect = rtrg; i < cntt; i++, rect++) { /* normalize */ GpRectF normal; gdip_normalize_rectangle (rect, &normal); status = gdip_add_rect_to_array (&allsrcrects, &allsrccnt, &allsrccap, &normal); if (status != Ok) { goto error; } } regsrc.rects = allsrcrects; regsrc.cnt = allsrccnt; trg = region->rects; trgcnt = region->cnt; status = gdip_combine_exclude (®src, trg, trgcnt); if (status != Ok) { goto error; } if ((regsrc.rects != allsrcrects) || (regsrc.cnt != allsrccnt)) { if (region->rects) GdipFree (region->rects); region->rects = regsrc.rects; region->cnt = regsrc.cnt; } return Ok; error: if (allsrcrects) GdipFree (allsrcrects); return status; } /* Union */ static GpStatus gdip_combine_union (GpRegion *region, GpRectF *rtrg, int cnttrg) { GpRectF *allrects = NULL, *rects = NULL; GpRectF *recttrg, *rect, *rectop, *current; int allcnt = 0, allcap, cnt = 0, cap = 0, currentIndex = -1, i, n; GpRectF rslt, newrect; BOOL storecomplete, contained, needsort; GpStatus status; /* All the src and trg rects in a single array*/ allcap = (region->cnt + cnttrg) * 2; cap = allcap; for (i = 0, rect = region->rects; i < region->cnt; i++, rect++) { status = gdip_add_rect_to_array (&allrects, &allcnt, &allcap, rect); if (status != Ok) { if (allrects) GdipFree (allrects); return status; } } for (i = 0, rect = rtrg; i < cnttrg; i++, rect++) { /* normalize */ GpRectF normal; gdip_normalize_rectangle (rect, &normal); gdip_add_rect_to_array (&allrects, &allcnt, &allcap, &normal); } if (allcnt == 0) { GdipFree (allrects); return Ok; } gdip_sort_rect_array(allrects, allcnt); for (currentIndex = 0; currentIndex < allcnt; currentIndex++) { current = allrects + currentIndex; if (current->Width <= 0 || current->Height <= 0) { continue; } storecomplete = TRUE; /* Current rect with lowest y and X againt the stored ones */ for (i = currentIndex + 1; i < allcnt; i++) { recttrg = allrects + i; needsort = FALSE; // If it is positioned after the bottom-right corner of current, no useful rectangles can be found (due to sorting). if (recttrg->Y > current->Y + current->Height || (recttrg->Y == current->Y + current->Height && recttrg->X > current->X + current->Width)) { break; } /* If it has lower coordinates or negative / zero size it has been already processed */ if (recttrg->Height <= 0 || recttrg->Width <= 0 || current->Y > recttrg->Y || (current->Y == recttrg->Y && current->X > recttrg->X)) { continue; } if (gdip_intersects_or_touches (current, recttrg) == FALSE || gdip_equals (current, recttrg) == TRUE) { continue; } if (gdip_contains (recttrg, current) == TRUE) { continue; } /* Our rect intersects in the lower part with another rect */ newrect.Y = current->Y; newrect.X = current->X; if (current->Y == recttrg->Y) { newrect.Width = MAX (current->X + current->Width, recttrg->X + recttrg->Width) - newrect.X; newrect.Height = MIN (current->Height, recttrg->Height); } else { newrect.Width = current->Width; newrect.Height = recttrg->Y - current->Y; } /* If it's contained inside, get the > height */ if (recttrg->X == current->X && (recttrg->Width == current->Width || (recttrg->Y == current->Y && recttrg->Width > current->Width))) { newrect.Height = recttrg->Y + recttrg->Height - current->Y; } else if (recttrg->X >= current->X && recttrg->X + recttrg->Width <= current->X + current->Width) { newrect.Height = current->Height; } gdip_add_rect_to_array_notcontained (&rects, &cnt, &cap, &newrect); /* Push what's left from the current the rect in the list of rects to process if it's already not contained in other rects except the current (we just split from there) */ rslt.X = current->X; rslt.Y = newrect.Y + newrect.Height; rslt.Width = current->Width; rslt.Height = current->Height - newrect.Height; if (rslt.Height > 0 && rslt.Width > 0) { contained = FALSE; for (rectop = allrects + currentIndex + 1, n = currentIndex + 1; n < allcnt; n++, rectop++) { // Rectangles before currentIndex have been processed and will be empty. They cannot contain anything. if (gdip_contains (&rslt, rectop)) { contained = TRUE; break; } else if (gdip_compare_rectf (rectop, &rslt) > 0) { break; // Not going to find one containing it after this. } } if (contained == FALSE) { status = gdip_add_rect_to_array_sorted (&allrects, &allcnt, &allcap, &rslt); if (status != Ok) { GdipFree (allrects); return status; } // Must get recttrg in the new array in case adding rslt above had to increase the array capacity. recttrg = allrects + i; } } /* If both we at the same Y when take into account the X also to process the following that exceeds the X also */ if (recttrg->Y == current->Y) { recttrg->Height -= newrect.Height; if (recttrg->Height > 0) { recttrg->Y += newrect.Height; needsort = TRUE; // Modified Y, re-sort. } } else if (recttrg->X >= current->X && recttrg->X + recttrg->Width <= current->X + current->Width) { /* If it's contained inside, get the > height */ recttrg->Height = recttrg->Y + recttrg->Height - (newrect.Y + newrect.Height); if (recttrg->Height > 0) { recttrg->Y = newrect.Y + newrect.Height; needsort = TRUE; // Modified Y, re-sort. } } if (needsort == TRUE) gdip_sort_rect_array_sorted (allrects, allcnt); storecomplete = FALSE; break; } if (storecomplete) { gdip_add_rect_to_array_notcontained (&rects, &cnt, &cap, current); } } GdipFree (allrects); if (region->rects) GdipFree (region->rects); gdip_trim_rect_array (&rects, cnt); region->rects = rects; region->cnt = cnt; return Ok; } /* Intersect */ static GpStatus gdip_combine_intersect (GpRegion *region, GpRectF *rtrg, int cnttrg) { GpRectF *rectsrc; int src, trg; GpRectF rectcur; GpRegion regunion; GpRectF *recttrg; GpStatus status; regunion.rects = NULL; regunion.cnt = 0; for (rectsrc = region->rects, src = 0; src < region->cnt; src++, rectsrc++) { for (recttrg = rtrg, trg = 0; trg < cnttrg; trg++, recttrg++) { /* normalize */ GpRectF normal; gdip_normalize_rectangle (recttrg, &normal); /* Intersects With */ if ((rectsrc->X >= normal.X + normal.Width) || (rectsrc->X + rectsrc->Width <= normal.X) || (rectsrc->Y >= normal.Y + normal.Height) || (rectsrc->Y + rectsrc->Height <= normal.Y)) { continue; } /* Area that intersects */ rectcur.X = rectsrc->X > normal.X ? rectsrc->X : normal.X; rectcur.Y = rectsrc->Y > normal.Y ? rectsrc->Y : normal.Y; rectcur.Width = rectsrc->X + rectsrc->Width < normal.X + normal.Width ? rectsrc->X + rectsrc->Width - rectcur.X : normal.X + normal.Width - rectcur.X; rectcur.Height = rectsrc->Y + rectsrc->Height < normal.Y + normal.Height ? rectsrc->Y + rectsrc->Height - rectcur.Y : normal.Y + normal.Height - rectcur.Y; /* Combine with previous areas that intersect with rect */ status = gdip_combine_union (®union, &rectcur, 1); if (status != Ok) return status; } } if (region->rects) GdipFree (region->rects); region->rects = regunion.rects; region->cnt = regunion.cnt; return Ok; } /* Xor */ static GpStatus gdip_combine_xor (GpRegion *region, GpRectF *recttrg, int cnttrg) { GpRegion *rgnsrc = NULL; /* All rectangles of both regions*/ GpRegion *rgntrg = NULL; /* Only the ones that intersect*/ GpRectF *allrects = NULL, *rect; int allcnt = 0, allcap, i; GpStatus status; /* All the src and trg rects in a single array*/ allcap = region->cnt + cnttrg; for (i = 0, rect = region->rects; i < region->cnt; i++, rect++) { status = gdip_add_rect_to_array (&allrects, &allcnt, &allcap, rect); if (status != Ok) goto error; } for (i = 0, rect = recttrg; i < cnttrg; i++, rect++) { /* normalize */ GpRectF normal; gdip_normalize_rectangle (rect, &normal); gdip_add_rect_to_array (&allrects, &allcnt, &allcap, &normal); } rgnsrc = (GpRegion *) GdipAlloc (sizeof (GpRegion)); if (!rgnsrc) { status = OutOfMemory; goto error; } rgnsrc->type = RegionTypeRect; rgnsrc->cnt = allcnt; rgnsrc->rects = allrects; status = GdipCloneRegion (region, &rgntrg); if (status != Ok) goto error; status = gdip_combine_intersect (rgntrg, recttrg, cnttrg); if (status != Ok) goto error; /* exclude the intersecting rectangles (if any) */ if (rgntrg->cnt > 0) { status = gdip_combine_exclude (rgnsrc, rgntrg->rects, rgntrg->cnt); if (status != Ok) goto error; } if (region->rects) GdipFree (region->rects); region->rects = rgnsrc->rects; region->cnt = rgnsrc->cnt; GdipFree (rgnsrc); GdipDeleteRegion (rgntrg); return Ok; error: if (allrects) GdipFree (allrects); GdipFree (rgnsrc); GdipDeleteRegion (rgntrg); return status; } GpStatus WINGDIPAPI GdipCombineRegionRect (GpRegion *region, GDIPCONST GpRectF *rect, CombineMode combineMode) { if (!region || !rect) return InvalidParameter; if (combineMode == CombineModeReplace) { GdipSetEmpty (region); return gdip_add_rect_to_array (®ion->rects, ®ion->cnt, NULL, (GpRectF *)rect); } GpRectF normalized; gdip_normalize_rectangle (rect, &normalized); BOOL infinite = gdip_is_InfiniteRegion (region); BOOL empty = gdip_is_region_empty (region, /* allowNegative */ TRUE); BOOL rectEmpty = gdip_is_rectF_empty (&normalized, /* allowNegative */ FALSE); if (rectEmpty) { switch (combineMode) { case CombineModeUnion: case CombineModeXor: case CombineModeExclude: /* The union of the empty region and X is X */ /* The xor of the empty region and X is X */ /* Everything is outside the empty region */ if (empty) return GdipSetEmpty (region); if (infinite) return GdipSetInfinite (region); return Ok; case CombineModeIntersect: case CombineModeComplement: /* The empty region does not intersect with anything */ /* Nothing is inside the empty region */ return GdipSetEmpty (region); default: break; } } if (infinite) { switch (combineMode) { case CombineModeIntersect: { /* The intersection of the infinite region with X is X */ GdipSetEmpty (region); return gdip_add_rect_to_array (®ion->rects, ®ion->cnt, NULL, &normalized); } case CombineModeUnion: /* The union of the infinite region and X is the infinite region */ return GdipSetInfinite (region); case CombineModeComplement: /* Nothing is outside the infinite region */ return GdipSetEmpty (region); default: break; } } else if (empty) { switch (combineMode) { case CombineModeIntersect: case CombineModeExclude: /* The empty region does not intersect with anything */ /* Nothing to exclude */ return GdipSetEmpty (region); case CombineModeUnion: case CombineModeXor: case CombineModeComplement: /* The union of the empty region and X is X */ /* The XOR of the empty region and X is X */ /* Everything is outside the empty region */ GdipSetEmpty (region); return gdip_add_rect_to_array (®ion->rects, ®ion->cnt, NULL, &normalized); default: break; } } switch (region->type) { case RegionTypeRect: case RegionTypeInfinite: { region->type = RegionTypeRect; switch (combineMode) { case CombineModeExclude: return gdip_combine_exclude (region, &normalized, 1); case CombineModeComplement: return gdip_combine_complement (region, &normalized, 1); case CombineModeIntersect: return gdip_combine_intersect (region, &normalized, 1); case CombineModeUnion: return gdip_combine_union (region, &normalized, 1); case CombineModeXor: return gdip_combine_xor (region, &normalized, 1); case CombineModeReplace: /* Used by Graphics clipping */ return gdip_add_rect_to_array (®ion->rects, ®ion->cnt, NULL, &normalized); default: return NotImplemented; } } case RegionTypePath: { /* Convert GpRectF to GpPath and use GdipCombineRegionPath */ GpPath *path; GpStatus status = GdipCreatePath (FillModeAlternate, &path); if (status != Ok) return status; status = GdipAddPathRectangle (path, normalized.X, normalized.Y, normalized.Width, normalized.Height); if (status != Ok) { GdipDeletePath (path); return status; } status = GdipCombineRegionPath (region, path, combineMode); GdipDeletePath (path); return status; } default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } } GpStatus WINGDIPAPI GdipCombineRegionRectI (GpRegion *region, GDIPCONST GpRect *recti, CombineMode combineMode) { GpRectF rect; if (!region || !recti) return InvalidParameter; gdip_RectF_from_Rect ((GpRect *) recti, &rect); return GdipCombineRegionRect (region, (GDIPCONST GpRectF *) &rect, combineMode); } /* Exclude path from infinite region */ static BOOL gdip_combine_exclude_from_infinite (GpRegion *region, GpPath *path) { /* * We combine the path with the infinite region's, then reverse it. */ GpPath *region_path; GpStatus status; if (path->count == 0) return TRUE; if (region->type != RegionTypePath) { status = gdip_region_convert_to_path (region); if (status != Ok) return FALSE; } g_assert (region->tree->path); region_path = region->tree->path; status = GdipClonePath (path, ®ion->tree->path); if (status != Ok) { region->tree->path = region_path; return FALSE; } status = GdipAddPathPath (region->tree->path, region_path, FALSE); if (status != Ok) { GdipDeletePath (region->tree->path); region->tree->path = region_path; return FALSE; } status = GdipReversePath (region->tree->path); if (status != Ok) { GdipDeletePath (region->tree->path); region->tree->path = region_path; return FALSE; } return TRUE; } GpStatus WINGDIPAPI GdipCombineRegionPath (GpRegion *region, GpPath *path, CombineMode combineMode) { GpRegionBitmap *path_bitmap, *result; GpStatus status; if (!region || !path) return InvalidParameter; if (combineMode == CombineModeReplace) { gdip_clear_region (region); return gdip_region_create_from_path (region, path); } BOOL infinite = gdip_is_InfiniteRegion (region); BOOL empty = gdip_is_region_empty (region, /* allowNegative */ TRUE); BOOL pathEmpty = path->count == 0; if (pathEmpty) { switch (combineMode) { case CombineModeUnion: case CombineModeXor: case CombineModeExclude: /* The union of the empty region and X is X */ /* The xor of the empty region and X is X */ /* Everything is outside the empty region */ if (empty) return GdipSetEmpty (region); return Ok; case CombineModeIntersect: case CombineModeComplement: /* The empty region does not intersect with anything */ /* Nothing is inside the empty region */ return GdipSetEmpty (region); default: break; } } if (infinite) { switch (combineMode) { case CombineModeIntersect: /* The intersection of the infinite region with X is X */ GdipSetEmpty (region); return gdip_region_create_from_path (region, path); case CombineModeUnion: /* The union of the infinite region and X is the infinite region */ return GdipSetInfinite (region); case CombineModeComplement: /* Nothing is outside the infinite region */ return GdipSetEmpty (region); case CombineModeExclude: if (gdip_combine_exclude_from_infinite (region, path)) return Ok; break; default: break; } } else if (empty) { switch (combineMode) { case CombineModeIntersect: case CombineModeExclude: /* The empty region does not intersect with anything */ /* Nothing to exclude */ return GdipSetEmpty (region); case CombineModeUnion: case CombineModeXor: case CombineModeComplement: /* The union of the empty region and X is X */ /* The XOR of the empty region and X is X */ /* Everything is outside the empty region */ GdipSetEmpty (region); return gdip_region_create_from_path (region, path); default: break; } } if (region->type != RegionTypePath) { status = gdip_region_convert_to_path (region); if (status != Ok) return status; } /* make sure the region's bitmap is available */ gdip_region_bitmap_ensure (region); if (!region->bitmap) return OutOfMemory; /* create a bitmap for the path to combine into the region */ path_bitmap = gdip_region_bitmap_from_path (path); result = gdip_region_bitmap_combine (region->bitmap, path_bitmap, combineMode); gdip_region_bitmap_free (path_bitmap); if (!result) return NotImplemented; gdip_region_bitmap_free (region->bitmap); region->bitmap = result; /* add a copy of path into region1 tree */ if (region->tree->path) { /* move the existing path into a new tree (branch1) ... */ region->tree->branch1 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!region->tree->branch1) return OutOfMemory; region->tree->branch1->path = region->tree->path; region->tree->branch2 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!region->tree->branch2) return OutOfMemory; } else { /* move the current base tree into branch1 of a new tree ... */ GpPathTree* tmp = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!tmp) return OutOfMemory; tmp->branch1 = region->tree; tmp->branch2 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!tmp->branch2) { GdipFree (tmp); return OutOfMemory; } region->tree = tmp; } /* ... and clone the specified path into branch2 */ region->tree->mode = combineMode; region->tree->path = NULL; return GdipClonePath (path, ®ion->tree->branch2->path); } static GpStatus gdip_combine_pathbased_region (GpRegion *region1, GpRegion *region2, CombineMode combineMode) { GpRegionBitmap *result; /* if not available, construct the bitmaps for both regions */ gdip_region_bitmap_ensure (region1); gdip_region_bitmap_ensure (region2); if (!region1->bitmap || !region2->bitmap) return OutOfMemory; result = gdip_region_bitmap_combine (region1->bitmap, region2->bitmap, combineMode); if (!result) return NotImplemented; gdip_region_bitmap_free (region1->bitmap); region1->bitmap = result; /* re-structure region1 to allow adding a copy of region2 inside it */ if (region1->tree->path) { region1->tree->branch1 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!region1->tree->branch1) return OutOfMemory; region1->tree->branch1->path = region1->tree->path; region1->tree->branch2 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!region1->tree->branch2) return OutOfMemory; } else { /* move the current base tree into branch1 of a new tree ... */ GpPathTree* tmp = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!tmp) return OutOfMemory; tmp->branch1 = region1->tree; tmp->branch2 = (GpPathTree*) GdipAlloc (sizeof (GpPathTree)); if (!tmp->branch2) { GdipFree (tmp); return OutOfMemory; } region1->tree = tmp; } region1->tree->mode = combineMode; region1->tree->path = NULL; /* add a copy of region2 tree into region1 tree */ if (region2->tree->path) { return GdipClonePath (region2->tree->path, ®ion1->tree->branch2->path); } else { return gdip_region_copy_tree (region2->tree, region1->tree->branch2); } } GpStatus WINGDIPAPI GdipCombineRegionRegion (GpRegion *region, GpRegion *region2, CombineMode combineMode) { GpStatus status; if (!region || !region2) return InvalidParameter; if (combineMode == CombineModeReplace) { GdipSetEmpty (region); return gdip_copy_region (region2, region); } BOOL region1Empty = gdip_is_region_empty (region, /* allowNegative */ TRUE); BOOL region1Infinite = gdip_is_InfiniteRegion (region); BOOL region2Empty = gdip_is_region_empty (region2, /* allowNegative */ combineMode != CombineModeIntersect || region->type != RegionTypeInfinite); BOOL region2Infinite = gdip_is_InfiniteRegion (region2); switch (combineMode) { case CombineModeUnion: if (region1Infinite || region2Infinite) { /* The union of X with the infinite region is infinite */ return GdipSetInfinite (region); } if (region1Empty) { /* The union of the empty region and X is X */ GdipSetEmpty (region); if (!region2Empty) return gdip_copy_region (region2, region); return Ok; } if (region2Empty) { /* The union of the empty region and X is X */ return Ok; } break; case CombineModeIntersect: if (region1Empty || region2Empty) { /* Nothing intersects with the empty region */ return GdipSetEmpty (region); } if (region1Infinite) { /* Everything intersects with the infinite region */ GdipSetEmpty (region); return gdip_copy_region (region2, region); } if (region2Infinite) { /* Everything intersects with the infinite region */ return Ok; } break; case CombineModeExclude: if (region1Empty) { /* Nothing is outside the empty region */ return GdipSetEmpty (region); } if (region2Empty) { /* Everything is outside the empty region */ return Ok; } if (region1Infinite) { if ((region2->type == RegionTypePath) && region2->tree && region2->tree->path && gdip_combine_exclude_from_infinite (region, region2->tree->path)) return Ok; } break; case CombineModeXor: if (region2Empty) { /* The XOR of the empty region and X is X */ if (region1Empty) { return GdipSetEmpty (region); } return Ok; } if (region1Empty) { /* The XOR of the empty region and X is X */ GdipSetEmpty (region); return gdip_copy_region (region2, region); } if (region1Infinite && region2Infinite) { /* The XOR of the infinite region and the infinite region is X */ return GdipSetEmpty (region); } break; case CombineModeComplement: if (region1Infinite || region2Empty) { /* Nothing is outside the infinite region */ /* Nothing is inside the empty region */ return GdipSetEmpty (region); } if (region1Empty) { /* Anything is outside of the empty region */ if (region2Infinite) { return GdipSetInfinite (region); } GdipSetEmpty (region); return gdip_copy_region (region2, region); } break; default: break; } if (region->type == RegionTypePath) { status = gdip_region_convert_to_path (region2); if (status != Ok) return status; return gdip_combine_pathbased_region (region, region2, combineMode); } else if (region2->type == RegionTypePath) { status = gdip_region_convert_to_path (region); if (status != Ok) return status; return gdip_combine_pathbased_region (region, region2, combineMode); } /* at this stage we are sure that BOTH region and region2 are rectangle * based, so we can use the old rectangle-based code to combine regions */ region->type = RegionTypeRect; switch (combineMode) { case CombineModeExclude: return gdip_combine_exclude (region, region2->rects, region2->cnt); case CombineModeComplement: return gdip_combine_complement (region, region2->rects, region2->cnt); case CombineModeIntersect: return gdip_combine_intersect (region, region2->rects, region2->cnt); case CombineModeUnion: return gdip_combine_union (region, region2->rects, region2->cnt); case CombineModeXor: return gdip_combine_xor (region, region2->rects, region2->cnt); default: return NotImplemented; } } GpStatus WINGDIPAPI GdipGetRegionBounds (GpRegion *region, GpGraphics *graphics, GpRectF *rect) { if (!region || !graphics || !rect) return InvalidParameter; switch (region->type) { case RegionTypeRect: case RegionTypeInfinite: gdip_get_bounds (region->rects , region->cnt, rect); break; case RegionTypePath: { GpRect bounds; /* optimisation for simple path */ if (region->tree->path) return GdipGetPathWorldBounds (region->tree->path, rect, NULL, NULL); gdip_region_bitmap_ensure (region); if (!region->bitmap) return OutOfMemory; /* base the bounds on the reduced bitmap of the paths */ gdip_region_bitmap_get_smallest_rect (region->bitmap, &bounds); /* small loss of precision when converting the bitmap coord to float */ rect->X = bounds.X; rect->Y = bounds.Y; rect->Width = bounds.Width; rect->Height = bounds.Height; break; } default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } return Ok; } GpStatus WINGDIPAPI GdipIsEmptyRegion (GpRegion *region, GpGraphics *graphics, BOOL *result) { if (!region || !graphics || !result) return InvalidParameter; *result = gdip_is_region_empty (region, /* allowNegative */ TRUE); return Ok; } GpStatus WINGDIPAPI GdipIsInfiniteRegion (GpRegion *region, GpGraphics *graphics, BOOL *result) { if (!region || !graphics || !result) return InvalidParameter; *result = gdip_is_InfiniteRegion (region); return Ok; } GpStatus WINGDIPAPI GdipIsVisibleRegionPoint (GpRegion *region, float x, float y, GpGraphics *graphics, BOOL *result) { if (!region || !result) return InvalidParameter; switch (region->type) { case RegionTypeRect: case RegionTypeInfinite: *result = gdip_is_Point_in_RectFs_Visible (x, y, region->rects, region->cnt); break; case RegionTypePath: gdip_region_bitmap_ensure (region); g_assert (region->bitmap); *result = gdip_region_bitmap_is_point_visible (region->bitmap, x, y); break; default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } return Ok; } GpStatus WINGDIPAPI GdipIsVisibleRegionPointI (GpRegion *region, int x, int y, GpGraphics *graphics, BOOL *result) { return GdipIsVisibleRegionPoint (region, x, y, graphics, result); } GpStatus WINGDIPAPI GdipIsVisibleRegionRect (GpRegion *region, float x, float y, float width, float height, GpGraphics *graphics, BOOL *result) { if (!region || !result) return InvalidParameter; if (width == 0 || height == 0) { *result = FALSE; return Ok; } switch (region->type) { case RegionTypeRect: case RegionTypeInfinite: *result = gdip_is_Rect_in_RectFs_Visible (x, y, width, height, region->rects, region->cnt); break; case RegionTypePath: { GpRect rect = {x, y, width, height}; gdip_region_bitmap_ensure (region); g_assert (region->bitmap); *result = gdip_region_bitmap_is_rect_visible (region->bitmap, &rect); break; } default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } return Ok; } GpStatus WINGDIPAPI GdipIsVisibleRegionRectI (GpRegion *region, int x, int y, int width, int height, GpGraphics *graphics, BOOL *result) { return GdipIsVisibleRegionRect (region, x, y, width, height, graphics, result); } static GpStatus get_transformed_region (GpRegion *region, GpMatrix *matrix, GpRegion **result) { GpStatus status; GpRegion *work; if (gdip_is_matrix_empty (matrix)) { *result = region; return Ok; } /* The matrix doesn't affect the original region - only the result */ status = GdipCloneRegion (region, &work); if (status != Ok) return status; /* If required convert into a path-based region */ if (work->type != RegionTypePath) { status = gdip_region_convert_to_path (work); if (status != Ok) { GdipDeleteRegion (work); return status; } } /* Transform all the paths */ status = gdip_region_transform_tree (work->tree, matrix); if (status != Ok) { GdipDeleteRegion (work); return status; } /* Any existing bitmap has been invalidated */ gdip_region_bitmap_invalidate (work); *result = work; return Ok; } GpStatus WINGDIPAPI GdipGetRegionScansCount (GpRegion *region, UINT *count, GpMatrix *matrix) { GpStatus status; INT countResult; if (!region || !matrix || !count) return InvalidParameter; status = GdipGetRegionScans (region, NULL, &countResult, matrix); if (status != Ok) return status; *count = countResult; return Ok; } GpStatus WINGDIPAPI GdipGetRegionScans (GpRegion *region, GpRectF* rects, INT* count, GpMatrix* matrix) { GpStatus status; GpRegion *work; if (!region || !matrix || !count) return InvalidParameter; status = get_transformed_region (region, matrix, &work); if (status != Ok) return status; if (gdip_is_region_empty (work, /* allowNegative */ TRUE)) { *count = 0; } else if (gdip_is_InfiniteRegion (work)) { if (rects) { rects->X = REGION_INFINITE_POSITION; rects->Y = REGION_INFINITE_POSITION; rects->Width = REGION_INFINITE_LENGTH; rects->Height = REGION_INFINITE_LENGTH; } *count = 1; } else { switch (work->type) { case RegionTypeRect: if (rects) { for (int i = 0; i < work->cnt; i++) { GpRectF rect = work->rects[i]; INT origX = iround ((rect.X * 16.0f)); INT origY = iround ((rect.Y * 16.0f)); INT origMaxX = iround (((rect.Width + rect.X) * 16.0f)); INT origMaxY = iround (((rect.Height + rect.Y) * 16.0f)); INT x = (origX + 15) >> 4; INT y = (origY + 15) >> 4; INT maxX = (origMaxX + 15) >> 4; INT maxY = (origMaxY + 15) >> 4; rects[i].X = x; rects[i].Y = y; rects[i].Width = maxX - x; rects[i].Height = maxY - y; } } *count = work->cnt; break; case RegionTypePath: /* ensure the bitmap is usable */ gdip_region_bitmap_ensure (work); *count = gdip_region_bitmap_get_scans (work->bitmap, rects); break; default: g_warning ("unknown type 0x%08X", region->type); if (work != region) GdipDeleteRegion (work); return NotImplemented; } } /* Delete the clone */ if (work != region) GdipDeleteRegion (work); return Ok; } GpStatus WINGDIPAPI GdipGetRegionScansI (GpRegion *region, GpRect *rects, INT *count, GpMatrix *matrix) { GpStatus status; GpRectF *rectsF; UINT scansCount; if (!region || !count || !matrix) return InvalidParameter; if (rects) { status = GdipGetRegionScansCount (region, &scansCount, matrix); if (status != Ok) return status; rectsF = malloc (scansCount * sizeof (GpRectF)); if (!rectsF) return OutOfMemory; } else { rectsF = NULL; } status = GdipGetRegionScans (region, rectsF, count, matrix); if (status != Ok) return status; if (rects) { for (int i = 0; i < scansCount; i++) gdip_Rect_from_RectF (&rectsF[i], &rects[i]); } return Ok; } GpStatus WINGDIPAPI GdipIsEqualRegion (GpRegion *region, GpRegion *region2, GpGraphics *graphics, BOOL *result) { int i; GpRectF *rectsrc, *recttrg; GpStatus status; if (!region || !region2 || !graphics || !result) return InvalidParameter; /* quick case: same pointer == same region == equals */ if (region == region2) { *result = TRUE; return Ok; } BOOL region1Infinite = gdip_is_InfiniteRegion (region); BOOL region1Empty = gdip_is_region_empty (region, /* allowNegative */ TRUE); BOOL region2Infinite = gdip_is_InfiniteRegion (region2); BOOL region2Empty = gdip_is_region_empty (region2, /* allowNegative */ TRUE); if (region1Infinite || region2Infinite) { *result = region1Infinite == region2Infinite; return Ok; } if (region1Empty || region2Empty) { *result = region1Empty == region2Empty; return Ok; } if ((region->type == RegionTypePath) || (region2->type == RegionTypePath)) { /* if required convert one region to a path based region */ if (region->type != RegionTypePath) { status = gdip_region_convert_to_path (region); if (status != Ok) return status; } gdip_region_bitmap_ensure (region); g_assert (region->bitmap); if (region2->type != RegionTypePath) { status = gdip_region_convert_to_path (region2); if (status != Ok) return status; } gdip_region_bitmap_ensure (region2); g_assert (region2->bitmap); *result = gdip_region_bitmap_compare (region->bitmap, region2->bitmap); return Ok; } /* rectangular-based region quality test */ if (region->cnt != region2->cnt) { *result = FALSE; return Ok; } for (i = 0, rectsrc = region->rects, recttrg = region2->rects; i < region->cnt; i++, rectsrc++, recttrg++) { if (rectsrc->X != recttrg->X || rectsrc->Y != recttrg->Y || rectsrc->Width != recttrg->Width || rectsrc->Height != recttrg->Height) { *result = FALSE; return Ok; } } *result = TRUE; return Ok; } GpStatus WINGDIPAPI GdipTranslateRegion (GpRegion *region, float dx, float dy) { if (!region) return InvalidParameter; // Infinite regions cannot be transformed. if (region->type == RegionTypeInfinite) return Ok; switch (region->type) { case RegionTypeRect: { int i; GpRectF *rect; for (i = 0, rect = region->rects ; i < region->cnt; i++, rect++) { rect->X += dx; rect->Y += dy; } break; } case RegionTypePath: gdip_region_translate_tree (region->tree, dx, dy); if (region->bitmap) { region->bitmap->X += dx; region->bitmap->Y += dy; } break; default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } return Ok; } GpStatus WINGDIPAPI GdipTranslateRegionI (GpRegion *region, int dx, int dy) { return GdipTranslateRegion (region, dx, dy); } /* this call doesn't exists in GDI+ */ static GpStatus ScaleRegion (GpRegion *region, float sx, float sy) { g_assert (region); g_assert (region->type == RegionTypeRect && region->rects); for (int i = 0; i < region->cnt; i++) { region->rects[i].X *= sx; region->rects[i].Y *= sy; region->rects[i].Width *= sx; region->rects[i].Height *= sy; } return Ok; } GpStatus WINGDIPAPI GdipTransformRegion (GpRegion *region, GpMatrix *matrix) { GpStatus status = Ok; if (!region || !matrix) return InvalidParameter; // Infinite and empty regions cannot be transformed. if (region->type == RegionTypeInfinite || ((region->cnt == 0) && (region->type == RegionTypeRect))) return Ok; // Nothing to do. if (gdip_is_matrix_empty (matrix)) return Ok; BOOL isSimpleMatrix = (matrix->xy == 0) && (matrix->yx == 0); BOOL matrixHasTranslate = (matrix->x0 != 0) || (matrix->y0 != 0); BOOL matrixHasScale = (matrix->xx != 1) || (matrix->yy != 1); /* try to avoid heavy stuff (e.g. conversion to path, invalidating * bitmap...) if the transform is: * - a translation + scale operations (for rectangle ebased region) * - only to do a scale operation (for a rectangle based region) * - only to do a simple translation (for both rectangular and bitmap based regions) */ if (region->type == RegionTypeRect) { if (isSimpleMatrix) { if (matrixHasScale) ScaleRegion (region, matrix->xx, matrix->yy); if (matrixHasTranslate) GdipTranslateRegion (region, matrix->x0, matrix->y0); return Ok; } } else if (isSimpleMatrix && !matrixHasScale) { GdipTranslateRegion (region, matrix->x0, matrix->y0); return Ok; } /* most matrix operations would change the rectangles into path so we always preempt this */ if (region->type != RegionTypePath) { status = gdip_region_convert_to_path (region); if (status != Ok) { gdip_region_bitmap_invalidate (region); return status; } } /* apply the same transformation matrix to all paths */ status = gdip_region_transform_tree (region->tree, matrix); /* invalidate the bitmap so it will get re-created on the next gdip_region_bitmap_ensure call */ gdip_region_bitmap_invalidate (region); return status; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateRegionPath (GpPath *path, GpRegion **region) { GpRegion *result; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!region || !path) return InvalidParameter; result = gdip_region_new (); if (!result) return OutOfMemory; status = gdip_region_create_from_path (result, path); if (status != Ok) { GdipDeleteRegion (result); return status; } *region = result; return Ok; } /* * The internal data representation for RegionData depends on the type of region. * * Type 1 (RegionTypeRect), variable size * guint32 RegionType Always 0x10000000 * guint32 Count 0-2^32 * GpRectF[Count] Points * * Type 2 (RegionTypePath), variable size * guint32 RegionType Always 0x10000001 * GpPathTree tree * * Type 3 (RegionTypeInfinite) * guint32 RegionType Always 0x10000003. * * where GpPathTree is * guint32 Tag 1 = Path, 2 = Tree * data[n] * * where data is for tag 1 (Path) * guint32 Count 0-2^32 * GpFillMode FillMode * guint8[Count] Types * GpPointF[Count] Points * or * where data is for tag 2 (Tree) * guint32 Operation see CombineMode * guint32 Size1 0-2^32 * byte[Size1] branch #1 * guint32 Size2 0-2^32 * byte[Size2] branch #2 */ GpStatus WINGDIPAPI GdipGetRegionDataSize (GpRegion *region, UINT *bufferSize) { if (!region || !bufferSize) return InvalidParameter; *bufferSize = sizeof (RegionHeader); switch (region->type) { case RegionTypeRect: *bufferSize += sizeof (DWORD) + region->cnt * sizeof (GpRectF); break; case RegionTypePath: /* regiontype, tree */ *bufferSize += sizeof (DWORD) + gdip_region_get_tree_size (region->tree); break; case RegionTypeInfinite: // Only one DWORD. *bufferSize += sizeof (DWORD); break; default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } return Ok; } GpStatus WINGDIPAPI GdipGetRegionData (GpRegion *region, BYTE *buffer, UINT bufferSize, UINT *sizeFilled) { GpStatus status; UINT size; UINT filled = 0; RegionHeader header; header.combiningOps = 0; if (!region || !buffer || !bufferSize) return InvalidParameter; status = GdipGetRegionDataSize (region, &size); if (status != Ok) return status; if (size > bufferSize) return InsufficientBuffer; /* Write the region header at the end, as we need to calculate a checksum based off all the data. */ filled += sizeof (RegionHeader); switch (region->type) { case RegionTypeRect: { DWORD type; if (region->cnt) { type = RegionDataRect; memcpy (buffer + filled, &type, sizeof (DWORD)); filled += sizeof (DWORD); memcpy (buffer + filled, region->rects, region->cnt * sizeof (GpRectF)); filled += region->cnt * sizeof (GpRectF); } else { type = RegionDataEmptyRect; memcpy (buffer + filled, &type, sizeof (DWORD)); filled += sizeof (DWORD); } break; } case RegionTypePath: { DWORD type = RegionDataPath; memcpy (buffer + filled, &type, sizeof (DWORD)); filled += sizeof (DWORD); if (!gdip_region_serialize_tree (region->tree, buffer + filled, bufferSize - filled, &filled)) return InsufficientBuffer; break; } case RegionTypeInfinite: { DWORD type = RegionDataInfiniteRect; memcpy (buffer + filled, &type, sizeof (DWORD)); filled += sizeof (DWORD); break; } default: g_warning ("unknown type 0x%08X", region->type); return NotImplemented; } /* Write the header at the start of the buffer. */ header.size = filled - 8; header.magic = 0xdbc01002; header.combiningOps = 0; memcpy (buffer, &header, sizeof (RegionHeader)); /* Finally, write the checksum. */ header.checksum = gdip_crc32 (buffer + 8, filled - 8); memcpy (buffer + 4, &header.checksum, sizeof (DWORD)); if (sizeFilled) *sizeFilled = filled; return Ok; } GpStatus WINGDIPAPI GdipGetRegionHRgn (GpRegion *region, GpGraphics *graphics, HRGN *hRgn) { if (!region || !graphics || !hRgn) return InvalidParameter; /* infinite region returns NULL */ if (gdip_is_InfiniteRegion (region)) { *hRgn = NULL; return Ok; } /* calling GdipGetRegionHRgn multiple times returns a different HRNG value (i.e. each to be freed separately) */ return GdipCloneRegion (region, (GpRegion**)hRgn); } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateRegionHrgn (HRGN hRgn, GpRegion **region) { if (!hRgn || !region) return InvalidParameter; return GdipCloneRegion ((GpRegion*) hRgn, region); } libgdiplus-6.0.4+dfsg/src/brush.c0000644000175000017500000000540213542672033017402 0ustar directhexdirecthex/* * brush.c * * Copyright (c) 2003 Alexandre Pigolkine * Copyright (C) 2007 Novell, Inc. http://www.novell.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. * * Authors: * Alexandre Pigolkine(pigolkine@gmx.de) * Ravindra (rkumar@novell.com) */ #include "brush-private.h" #include "graphics-private.h" void gdip_brush_init (GpBrush *brush, BrushClass* vtable) { brush->vtable = vtable; /* Set the changed state to true, so that we don't miss the * first setup of the brush. */ brush->changed = TRUE; } GpStatus gdip_brush_setup (GpGraphics *graphics, GpBrush *brush) { /* Don't need to setup, if brush is the same as the cached brush and * it is not changed. Just comparing pointers may not be sufficient * to say that the brushes are same. It is possible to have different * brush on the same memory, but probability is very low. We would * need a function to check the equality of the brushes in that case. */ if (brush == graphics->last_brush && !brush->changed) return Ok; else { GpStatus status = brush->vtable->setup (graphics, brush); if (status == Ok) { brush->changed = FALSE; graphics->last_brush = brush; } return status; } } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipCloneBrush (GpBrush *brush, GpBrush **clonedBrush) { if (!brush || !clonedBrush) return InvalidParameter; return brush->vtable->clone_brush (brush, clonedBrush); } GpStatus WINGDIPAPI GdipDeleteBrush (GpBrush *brush) { GpStatus status; if (!brush) return InvalidParameter; status = brush->vtable->destroy (brush); GdipFree (brush); return status; } GpStatus WINGDIPAPI GdipGetBrushType (GpBrush *brush, GpBrushType *type) { if (!brush || !type) return InvalidParameter; *type = brush->vtable->type; return Ok; } libgdiplus-6.0.4+dfsg/src/graphics.h0000644000175000017500000004476213542674535020111 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __GRAPHICS_H__ #define __GRAPHICS_H__ /* Graphics public API (only!) */ GpStatus WINGDIPAPI GdipBeginContainer (GpGraphics *graphics, GDIPCONST GpRectF *dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state); GpStatus WINGDIPAPI GdipBeginContainer2 (GpGraphics *graphics, GraphicsContainer *state); GpStatus WINGDIPAPI GdipBeginContainerI (GpGraphics *graphics, GDIPCONST GpRect *dstrect, GDIPCONST GpRect *srcrect, GpUnit unit, GraphicsContainer *state); GpStatus WINGDIPAPI GdipEndContainer (GpGraphics *graphics, GraphicsContainer state); GpStatus WINGDIPAPI GdipFlush (GpGraphics *graphics, GpFlushIntention intention); GpStatus WINGDIPAPI GdipCreateFromHDC (HDC hdc, GpGraphics **graphics); GpStatus WINGDIPAPI GdipCreateFromHDC2 (HDC hdc, HANDLE hDevice, GpGraphics **graphics); GpStatus WINGDIPAPI GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics); GpStatus WINGDIPAPI GdipCreateFromHWNDICM(HWND hwnd, GpGraphics **graphics); GpStatus WINGDIPAPI GdipDeleteGraphics (GpGraphics *graphics); GpStatus WINGDIPAPI GdipGetDC (GpGraphics *graphics, HDC *hdc); GpStatus WINGDIPAPI GdipReleaseDC (GpGraphics *graphics, HDC hdc); GpStatus WINGDIPAPI GdipRestoreGraphics (GpGraphics *graphics, GraphicsState state); GpStatus WINGDIPAPI GdipSaveGraphics (GpGraphics *graphics, GraphicsState *state); GpStatus WINGDIPAPI GdipGetWorldTransform (GpGraphics *graphics, GpMatrix *matrix); GpStatus WINGDIPAPI GdipSetWorldTransform (GpGraphics *graphics, GpMatrix *matrix); GpStatus WINGDIPAPI GdipMultiplyWorldTransform (GpGraphics *graphics, GpMatrix *matrix, GpMatrixOrder order); GpStatus WINGDIPAPI GdipResetWorldTransform (GpGraphics *graphics); GpStatus WINGDIPAPI GdipScaleWorldTransform (GpGraphics *graphics, REAL sx, REAL sy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipRotateWorldTransform (GpGraphics *graphics, REAL angle, GpMatrixOrder order); GpStatus WINGDIPAPI GdipTranslateWorldTransform (GpGraphics *graphics, REAL dx, REAL dy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipDrawArc (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipDrawArcI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipDrawBezier (GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4); GpStatus WINGDIPAPI GdipDrawBezierI (GpGraphics *graphics, GpPen *pen, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4); GpStatus WINGDIPAPI GdipDrawBeziers (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipDrawBeziersI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipDrawCurve (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipDrawCurveI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipDrawCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipDrawCurve2I (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipDrawCurve3 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, INT offset, INT numOfSegments, REAL tension); GpStatus WINGDIPAPI GdipDrawCurve3I (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, INT offset, INT numOfSegments, REAL tension); GpStatus WINGDIPAPI GdipDrawClosedCurve (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipDrawClosedCurveI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipDrawClosedCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipDrawClosedCurve2I (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipDrawEllipse (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipDrawEllipseI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipDrawImage (GpGraphics *graphics, GpImage *image, REAL x, REAL y); GpStatus WINGDIPAPI GdipDrawImageI (GpGraphics *graphics, GpImage *image, INT x, INT y); GpStatus WINGDIPAPI GdipDrawImageRect (GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipDrawImageRectI (GpGraphics *graphics, GpImage *image, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipDrawImagePoints (GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *dstPoints, INT count); GpStatus WINGDIPAPI GdipDrawImagePointsI (GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *dstPoints, INT count); GpStatus WINGDIPAPI GdipDrawImagePointRect (GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit); GpStatus WINGDIPAPI GdipDrawImagePointRectI (GpGraphics *graphics, GpImage *image, INT x, INT y, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit); GpStatus WINGDIPAPI GdipDrawImageRectRect (GpGraphics *graphics, GpImage *image, REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData); GpStatus WINGDIPAPI GdipDrawImageRectRectI (GpGraphics *graphics, GpImage *image, INT dstx, INT dsty, INT dstwidth, INT dstheight, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData); GpStatus WINGDIPAPI GdipDrawImagePointsRect (GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData); GpStatus WINGDIPAPI GdipDrawImagePointsRectI (GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *points, INT count, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, void *callbackData); GpStatus WINGDIPAPI GdipDrawLine (GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2); GpStatus WINGDIPAPI GdipDrawLineI (GpGraphics *graphics, GpPen *pen, INT x1, INT y1, INT x2, INT y2); GpStatus WINGDIPAPI GdipDrawLines (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipDrawLinesI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipDrawPath (GpGraphics *graphics, GpPen *pen, GpPath *path); GpStatus WINGDIPAPI GdipDrawPie (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipDrawPieI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipDrawPolygon (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipDrawPolygonI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipDrawRectangle (GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipDrawRectangleI (GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipDrawRectangles (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, INT count); GpStatus WINGDIPAPI GdipDrawRectanglesI (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRect *rects, INT count); GpStatus WINGDIPAPI GdipFillClosedCurve (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipFillClosedCurveI (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipFillClosedCurve2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fillMode); GpStatus WINGDIPAPI GdipFillClosedCurve2I (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, REAL tension, GpFillMode fillMode); GpStatus WINGDIPAPI GdipFillEllipse (GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipFillEllipseI (GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipFillRectangle (GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipFillRectangleI (GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipFillRectangles (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, INT count); GpStatus WINGDIPAPI GdipFillRectanglesI (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRect *rects, INT count); GpStatus WINGDIPAPI GdipFillPolygon (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, GpFillMode fillMode); GpStatus WINGDIPAPI GdipFillPolygonI (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, GpFillMode fillMode); GpStatus WINGDIPAPI GdipFillPolygon2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipFillPolygon2I (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipFillPath (GpGraphics *graphics, GpBrush *brush, GpPath *path); GpStatus WINGDIPAPI GdipFillPie (GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipFillPieI( GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipFillRegion (GpGraphics *graphics, GpBrush *brush, GpRegion *region); GpStatus WINGDIPAPI GdipGraphicsClear (GpGraphics *graphics, ARGB color); GpStatus WINGDIPAPI GdipGetDpiX( GpGraphics *graphics, REAL *dpi); GpStatus WINGDIPAPI GdipGetDpiY (GpGraphics *graphics, REAL *dpi); GpStatus WINGDIPAPI GdipGetNearestColor (GpGraphics *graphics, ARGB *argb); GpStatus WINGDIPAPI GdipSetCompositingMode (GpGraphics *graphics, CompositingMode compositingMode); GpStatus WINGDIPAPI GdipGetCompositingMode (GpGraphics *graphics, CompositingMode *compositingMode); GpStatus WINGDIPAPI GdipSetCompositingQuality (GpGraphics *graphics, CompositingQuality compositingQuality); GpStatus WINGDIPAPI GdipGetCompositingQuality (GpGraphics *graphics, CompositingQuality *compositingQuality); GpStatus WINGDIPAPI GdipSetInterpolationMode (GpGraphics *graphics, InterpolationMode interpolationMode); GpStatus WINGDIPAPI GdipGetInterpolationMode (GpGraphics *graphics, InterpolationMode *interpolationMode); GpStatus WINGDIPAPI GdipResetPageTransform (GpGraphics *graphics);; GpStatus WINGDIPAPI GdipSetPageScale (GpGraphics *graphics, REAL scale); GpStatus WINGDIPAPI GdipGetPageScale (GpGraphics *graphics, REAL *scale); GpStatus WINGDIPAPI GdipSetPageUnit (GpGraphics *graphics, GpUnit unit); GpStatus WINGDIPAPI GdipGetPageUnit (GpGraphics *graphics, GpUnit *unit); GpStatus WINGDIPAPI GdipSetPixelOffsetMode (GpGraphics *graphics, PixelOffsetMode pixelOffsetMode); GpStatus WINGDIPAPI GdipGetPixelOffsetMode (GpGraphics *graphics, PixelOffsetMode *pixelOffsetMode); GpStatus WINGDIPAPI GdipSetRenderingOrigin (GpGraphics *graphics, INT x, INT y); GpStatus WINGDIPAPI GdipGetRenderingOrigin (GpGraphics *graphics, INT *x, INT *y); GpStatus WINGDIPAPI GdipSetSmoothingMode (GpGraphics *graphics, SmoothingMode smoothingMode); GpStatus WINGDIPAPI GdipGetSmoothingMode (GpGraphics *graphics, SmoothingMode *smoothingMode); GpStatus WINGDIPAPI GdipSetTextContrast (GpGraphics *graphics, UINT contrast); GpStatus WINGDIPAPI GdipGetTextContrast (GpGraphics *graphics, UINT *contrast); GpStatus WINGDIPAPI GdipSetTextRenderingHint (GpGraphics *graphics, TextRenderingHint mode); GpStatus WINGDIPAPI GdipGetTextRenderingHint (GpGraphics *graphics, TextRenderingHint *mode); GpStatus WINGDIPAPI GdipIsVisiblePoint (GpGraphics *graphics, REAL x, REAL y, BOOL *result); GpStatus WINGDIPAPI GdipIsVisiblePointI (GpGraphics *graphics, INT x, INT y, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleRect (GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleRectI (GpGraphics *graphics, INT x, INT y, INT width, INT height, BOOL *result); GpStatus WINGDIPAPI GdipTransformPoints (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPointF *points, INT count); GpStatus WINGDIPAPI GdipTransformPointsI (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPoint *points, INT count); GpStatus WINGDIPAPI GdipResetClip (GpGraphics *graphics); GpStatus WINGDIPAPI GdipGetClip (GpGraphics *graphics, GpRegion *region); GpStatus WINGDIPAPI GdipGetClipBounds (GpGraphics *graphics, GpRectF *rect); GpStatus WINGDIPAPI GdipGetClipBoundsI (GpGraphics *graphics, GpRect *rect); GpStatus WINGDIPAPI GdipGetVisibleClipBounds (GpGraphics *graphics, GpRectF *rect); GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI (GpGraphics *graphics, GpRect *rect); GpStatus WINGDIPAPI GdipIsClipEmpty (GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleClipEmpty (GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipSetClipGraphics (GpGraphics *graphics, GpGraphics *srcgraphics, CombineMode combineMode); GpStatus WINGDIPAPI GdipSetClipHrgn (GpGraphics *graphics, void *hRgn, CombineMode combineMode); GpStatus WINGDIPAPI GdipSetClipPath (GpGraphics *graphics, GpPath *path, CombineMode combineMode); GpStatus WINGDIPAPI GdipSetClipRect (GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, CombineMode combineMode); GpStatus WINGDIPAPI GdipSetClipRectI (GpGraphics *graphics, INT x, INT y, INT width, INT height, CombineMode combineMode); GpStatus WINGDIPAPI GdipSetClipRegion (GpGraphics *graphics, GpRegion *region, CombineMode combineMode); GpStatus WINGDIPAPI GdipSetVisibleClip_linux (GpGraphics *graphics, GpRect *rect); GpStatus WINGDIPAPI GdipTranslateClip (GpGraphics *graphics, REAL dx, REAL dy); GpStatus WINGDIPAPI GdipTranslateClipI (GpGraphics *graphics, INT dx, INT dy); GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST PointF *destPoint, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoint, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST RectF *destRect, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileDestRectI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Rect *destRect, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes ); GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoints (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST PointF *destPoints, INT count, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointsI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoints, INT count, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes ); GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoint (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST PointF *destPoint, GDIPCONST RectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes * imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoint, GDIPCONST Rect *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRect (GpGraphics * graphics, GDIPCONST GpMetafile *metafile, GDIPCONST RectF *destRect, GDIPCONST RectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRectI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Rect *destRect, GDIPCONST Rect *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints (GpGraphics *graphics, GDIPCONST GpMetafile * metafile, GDIPCONST PointF *destPoints, INT count, GDIPCONST RectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointsI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST Point *destPoints, INT count, GDIPCONST Rect *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes); HPALETTE WINGDIPAPI GdipCreateHalftonePalette(); #endif libgdiplus-6.0.4+dfsg/src/bitmap.c0000644000175000017500000021511213545371046017537 0ustar directhexdirecthex/* * bitmap.c * * Copyright (c) 2003 Alexandre Pigolkine * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Vladimir Vukicevic (vladimir@pobox.com) * Jordi Mas (jordi@ximian.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot */ #include "gdiplus-private.h" #include "bitmap-private.h" #include "bmpcodec.h" #include "general-private.h" #include "graphics-private.h" #include "metafile-private.h" static GpStatus gdip_bitmap_clone_data_rect (ActiveBitmapData *srcData, Rect *srcRect, ActiveBitmapData *destData, Rect *destRect); /* The default indexed palettes. This code was generated by a tiny C# program. */ static const unsigned int default_Format1bppIndexed_palette[2] = { 0xFF000000, 0xFFFFFFFF }; static const unsigned int default_Format4bppIndexed_palette[16] = { 0xFF000000, 0xFF800000, 0xFF008000, 0xFF808000, 0xFF000080, 0xFF800080, 0xFF008080, 0xFF808080, 0xFFC0C0C0, 0xFFFF0000, 0xFF00FF00, 0xFFFFFF00, 0xFF0000FF, 0xFFFF00FF, 0xFF00FFFF, 0xFFFFFFFF }; static const unsigned int default_Format8bppIndexed_palette[256] = { 0xFF000000, 0xFF800000, 0xFF008000, 0xFF808000, 0xFF000080, 0xFF800080, 0xFF008080, 0xFF808080, 0xFFC0C0C0, 0xFFFF0000, 0xFF00FF00, 0xFFFFFF00, 0xFF0000FF, 0xFFFF00FF, 0xFF00FFFF, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000033, 0xFF000066, 0xFF000099, 0xFF0000CC, 0xFF0000FF, 0xFF003300, 0xFF003333, 0xFF003366, 0xFF003399, 0xFF0033CC, 0xFF0033FF, 0xFF006600, 0xFF006633, 0xFF006666, 0xFF006699, 0xFF0066CC, 0xFF0066FF, 0xFF009900, 0xFF009933, 0xFF009966, 0xFF009999, 0xFF0099CC, 0xFF0099FF, 0xFF00CC00, 0xFF00CC33, 0xFF00CC66, 0xFF00CC99, 0xFF00CCCC, 0xFF00CCFF, 0xFF00FF00, 0xFF00FF33, 0xFF00FF66, 0xFF00FF99, 0xFF00FFCC, 0xFF00FFFF, 0xFF330000, 0xFF330033, 0xFF330066, 0xFF330099, 0xFF3300CC, 0xFF3300FF, 0xFF333300, 0xFF333333, 0xFF333366, 0xFF333399, 0xFF3333CC, 0xFF3333FF, 0xFF336600, 0xFF336633, 0xFF336666, 0xFF336699, 0xFF3366CC, 0xFF3366FF, 0xFF339900, 0xFF339933, 0xFF339966, 0xFF339999, 0xFF3399CC, 0xFF3399FF, 0xFF33CC00, 0xFF33CC33, 0xFF33CC66, 0xFF33CC99, 0xFF33CCCC, 0xFF33CCFF, 0xFF33FF00, 0xFF33FF33, 0xFF33FF66, 0xFF33FF99, 0xFF33FFCC, 0xFF33FFFF, 0xFF660000, 0xFF660033, 0xFF660066, 0xFF660099, 0xFF6600CC, 0xFF6600FF, 0xFF663300, 0xFF663333, 0xFF663366, 0xFF663399, 0xFF6633CC, 0xFF6633FF, 0xFF666600, 0xFF666633, 0xFF666666, 0xFF666699, 0xFF6666CC, 0xFF6666FF, 0xFF669900, 0xFF669933, 0xFF669966, 0xFF669999, 0xFF6699CC, 0xFF6699FF, 0xFF66CC00, 0xFF66CC33, 0xFF66CC66, 0xFF66CC99, 0xFF66CCCC, 0xFF66CCFF, 0xFF66FF00, 0xFF66FF33, 0xFF66FF66, 0xFF66FF99, 0xFF66FFCC, 0xFF66FFFF, 0xFF990000, 0xFF990033, 0xFF990066, 0xFF990099, 0xFF9900CC, 0xFF9900FF, 0xFF993300, 0xFF993333, 0xFF993366, 0xFF993399, 0xFF9933CC, 0xFF9933FF, 0xFF996600, 0xFF996633, 0xFF996666, 0xFF996699, 0xFF9966CC, 0xFF9966FF, 0xFF999900, 0xFF999933, 0xFF999966, 0xFF999999, 0xFF9999CC, 0xFF9999FF, 0xFF99CC00, 0xFF99CC33, 0xFF99CC66, 0xFF99CC99, 0xFF99CCCC, 0xFF99CCFF, 0xFF99FF00, 0xFF99FF33, 0xFF99FF66, 0xFF99FF99, 0xFF99FFCC, 0xFF99FFFF, 0xFFCC0000, 0xFFCC0033, 0xFFCC0066, 0xFFCC0099, 0xFFCC00CC, 0xFFCC00FF, 0xFFCC3300, 0xFFCC3333, 0xFFCC3366, 0xFFCC3399, 0xFFCC33CC, 0xFFCC33FF, 0xFFCC6600, 0xFFCC6633, 0xFFCC6666, 0xFFCC6699, 0xFFCC66CC, 0xFFCC66FF, 0xFFCC9900, 0xFFCC9933, 0xFFCC9966, 0xFFCC9999, 0xFFCC99CC, 0xFFCC99FF, 0xFFCCCC00, 0xFFCCCC33, 0xFFCCCC66, 0xFFCCCC99, 0xFFCCCCCC, 0xFFCCCCFF, 0xFFCCFF00, 0xFFCCFF33, 0xFFCCFF66, 0xFFCCFF99, 0xFFCCFFCC, 0xFFCCFFFF, 0xFFFF0000, 0xFFFF0033, 0xFFFF0066, 0xFFFF0099, 0xFFFF00CC, 0xFFFF00FF, 0xFFFF3300, 0xFFFF3333, 0xFFFF3366, 0xFFFF3399, 0xFFFF33CC, 0xFFFF33FF, 0xFFFF6600, 0xFFFF6633, 0xFFFF6666, 0xFFFF6699, 0xFFFF66CC, 0xFFFF66FF, 0xFFFF9900, 0xFFFF9933, 0xFFFF9966, 0xFFFF9999, 0xFFFF99CC, 0xFFFF99FF, 0xFFFFCC00, 0xFFFFCC33, 0xFFFFCC66, 0xFFFFCC99, 0xFFFFCCCC, 0xFFFFCCFF, 0xFFFFFF00, 0xFFFFFF33, 0xFFFFFF66, 0xFFFFFF99, 0xFFFFFFCC, 0xFFFFFFFF }; /* Those are the only pixel formats that we really support */ static BOOL gdip_is_a_supported_pixelformat (PixelFormat fmt) { switch (fmt) { case PixelFormat1bppIndexed: case PixelFormat4bppIndexed: case PixelFormat8bppIndexed: case PixelFormat24bppRGB: case PixelFormat32bppARGB: case PixelFormat32bppPARGB: case PixelFormat32bppRGB: return TRUE; default: return FALSE; } } static BOOL gdip_is_an_alpha_pixelformat (PixelFormat format) { return ((format & PixelFormatAlpha) != 0); } /* Returns TRUE if the Bitmap contains indexed (palettized) data. */ BOOL gdip_is_an_indexed_pixelformat (PixelFormat fmt) { return ((fmt & PixelFormatIndexed) != 0); } void gdip_bitmap_init (GpBitmap *bitmap) { if (bitmap == NULL) return; memset (bitmap, 0, sizeof (GpBitmap)); bitmap->type = ImageTypeBitmap; bitmap->image_format = INVALID; } static GpStatus gdip_propertyitems_clone(PropertyItem *src, PropertyItem **dest, int count) { PropertyItem *result; int i; int j; if (dest == NULL) { return InvalidParameter; } if (src == NULL) { *dest = NULL; return Ok; } result = GdipAlloc(sizeof(PropertyItem) * count); if (result == NULL) { return OutOfMemory; } for (i = 0; i < count; i++) { result[i].id = src[i].id; result[i].length = src[i].length; result[i].type = src[i].type; if ((src[i].value != NULL) && (src[i].length > 0)) { result[i].value = GdipAlloc(src[i].length); if (result[i].value == NULL) { for (j = 0; j < i; j++) { if (result[j].value != NULL) { GdipFree(result[j].value); } } GdipFree (result); return OutOfMemory; } memcpy(result[i].value, src[i].value, src[i].length); } else { result[i].value = NULL; } } *dest = result; return Ok; } static GpStatus gdip_propertyitems_dispose(PropertyItem *property, int count) { int i; if (property == NULL) { return Ok; } for (i = 0; i < count; i++) { if (property[i].value != NULL) { GdipFree(property[i].value); property[i].value = NULL; } } GdipFree(property); return Ok; } static GpStatus gdip_bitmapdata_init (ActiveBitmapData *data) { if (data != NULL) { memset(data, 0, sizeof (ActiveBitmapData)); return Ok; } return InvalidParameter; } GpStatus gdip_property_get_short(int offset, void *value, unsigned short *result) { BYTE *ptr = (BYTE*)value; *result = ptr[offset] + (ptr[offset + 1] << 8); return Ok; } GpStatus gdip_property_get_long(int offset, void *value, guint32 *result) { BYTE *ptr = (BYTE*)value; *result = ptr[offset] + (ptr[offset + 1] << 8) + (ptr[offset + 2] << 16) + ((guint32)ptr[offset + 3] << 24); return Ok; } GpStatus gdip_property_get_srational(int offset, void *value, unsigned short *numerator, unsigned short *denominator) { BYTE *ptr = (BYTE*)value; *numerator = ptr[offset] + (ptr[offset + 1] << 8); *denominator = ptr[offset + 2] + (ptr[offset + 3] << 8); return Ok; } GpStatus gdip_property_get_rational(int offset, void *value, guint32 *numerator, guint32 *denominator) { BYTE *ptr = (BYTE*)value; *numerator = ptr[offset] + (ptr[offset + 1] << 8) + (ptr[offset + 2] << 16) + ((guint32)ptr[offset + 3] << 24); *denominator = ptr[offset + 4] + (ptr[offset + 5] << 8) + (ptr[offset + 6] << 16) + ((guint32)ptr[offset + 7] << 24); return Ok; } GpStatus gdip_bitmapdata_property_add_long(ActiveBitmapData *bitmap_data, PROPID id, guint32 value) { BYTE buffer[4]; buffer[0] = value & 0xff; buffer[1] = (value & 0x0000ff00) >> 8; buffer[2] = (value & 0x00ff0000) >> 16; buffer[3] = (value & 0xff000000) >> 24; return gdip_bitmapdata_property_add (bitmap_data, id, 4, PropertyTagTypeLong, buffer); } GpStatus gdip_bitmapdata_property_add_ASCII(ActiveBitmapData *bitmap_data, PROPID id, BYTE *value) { return gdip_bitmapdata_property_add (bitmap_data, id, strlen((char *)value) + 1, PropertyTagTypeASCII, value); } GpStatus gdip_bitmapdata_property_add_byte (ActiveBitmapData *bitmap_data, PROPID id, BYTE value) { return gdip_bitmapdata_property_add (bitmap_data, id, 1, PropertyTagTypeByte, &value); } GpStatus gdip_bitmapdata_property_add_short(ActiveBitmapData *bitmap_data, PROPID id, unsigned short value) { BYTE buffer[2]; buffer[0] = value & 0xff; buffer[1] = (value & 0x0ff00) >> 8; return gdip_bitmapdata_property_add (bitmap_data, id, 2, PropertyTagTypeShort, buffer); } GpStatus gdip_bitmapdata_property_add_rational(ActiveBitmapData *bitmap_data, PROPID id, guint32 numerator, guint32 denominator) { BYTE buffer[8]; buffer[0] = numerator & 0xff; buffer[1] = (numerator & 0x0000ff00) >> 8; buffer[2] = (numerator & 0x00ff0000) >> 16; buffer[3] = (numerator & 0xff000000) >> 24; buffer[4] = denominator & 0xff; buffer[5] = (denominator & 0x0000ff00) >> 8; buffer[6] = (denominator & 0x00ff0000) >> 16; buffer[7] = (denominator & 0xff000000) >> 24; return gdip_bitmapdata_property_add (bitmap_data, id, 8, PropertyTagTypeRational, buffer); } GpStatus gdip_bitmapdata_property_add_srational(ActiveBitmapData *bitmap_data, PROPID id, unsigned short numerator, unsigned short denominator) { BYTE buffer[4]; buffer[0] = numerator & 0xff; buffer[1] = (numerator & 0x0ff00) >> 8; buffer[2] = denominator & 0xff; buffer[3] = (denominator & 0xff00) >> 8; return gdip_bitmapdata_property_add (bitmap_data, id, 8, PropertyTagTypeRational, buffer); } GpStatus gdip_bitmapdata_property_add(ActiveBitmapData *bitmap_data, PROPID id, ULONG length, WORD type, VOID *value) { int property_count; if (bitmap_data == NULL) { return InvalidParameter; } property_count = bitmap_data->property_count; if (bitmap_data->property == NULL) { bitmap_data->property = GdipAlloc(sizeof(PropertyItem)); } else { bitmap_data->property = gdip_realloc (bitmap_data->property, sizeof(PropertyItem) * (property_count + 1)); } if (bitmap_data->property == NULL) { bitmap_data->property_count = 0; return OutOfMemory; } if ((value != NULL) && (length > 0)) { bitmap_data->property[property_count].value = GdipAlloc(length); if (bitmap_data->property[property_count].value == NULL) { return OutOfMemory; } memcpy(bitmap_data->property[property_count].value, value, length); } else { bitmap_data->property[property_count].value = NULL; } bitmap_data->property[property_count].id = id; bitmap_data->property[property_count].length = length; bitmap_data->property[property_count].type = type; bitmap_data->property_count++; return Ok; } GpStatus gdip_bitmapdata_property_remove_id(ActiveBitmapData *bitmap_data, PROPID id) { int i; for (i = 0; i < bitmap_data->property_count; i++) { if (bitmap_data->property[i].id == id) { return gdip_bitmapdata_property_remove_index(bitmap_data, i); } } return GenericError; } GpStatus gdip_bitmapdata_property_remove_index(ActiveBitmapData *bitmap_data, int index) { if (index >= bitmap_data->property_count) { return PropertyNotFound; } /* We don't realloc the array, more overhead than savings */ if ((index + 1) < bitmap_data->property_count) { if (bitmap_data->property[index].value != NULL) { GdipFree(bitmap_data->property[index].value); bitmap_data->property[index].value = NULL; } memmove(&bitmap_data->property[index], &bitmap_data->property[index + 1], (bitmap_data->property_count - index - 1) * sizeof(PropertyItem)); } bitmap_data->property_count--; return Ok; } GpStatus gdip_bitmapdata_property_find_id(ActiveBitmapData *bitmap_data, PROPID id, int *index) { int i; if (index == NULL) { return InvalidParameter; } for (i = 0; i < bitmap_data->property_count; i++) { if (bitmap_data->property[i].id == id) { *index = i; return Ok; } } return PropertyNotFound; } GpStatus gdip_bitmapdata_clone (ActiveBitmapData *src, ActiveBitmapData **dest, int count) { GpStatus status; ActiveBitmapData *result; int i; unsigned long long int size; if (!dest) return InvalidParameter; if (src == NULL) { *dest = NULL; return Ok; } result = GdipAlloc (sizeof (ActiveBitmapData) * count); if (!result) return OutOfMemory; for (i = 0; i < count; i++) { result[i].width = src[i].width; result[i].height = src[i].height; result[i].stride = src[i].stride; result[i].pixel_format = src[i].pixel_format; result[i].reserved = GBD_OWN_SCAN0; /* We're duplicating SCAN0, we always own it*/ result[i].dpi_horz = src[i].dpi_horz; result[i].dpi_vert = src[i].dpi_vert; result[i].image_flags = src[i].image_flags; result[i].top = src[i].top; result[i].left = src[i].left; result[i].x = src[i].x; result[i].y = src[i].y; result[i].transparent = src[i].transparent; if (src[i].scan0 != NULL) { size = (unsigned long long int)src[i].stride * src[i].height; if (size > G_MAXINT32) { GdipFree(result); return OutOfMemory; } result[i].scan0 = GdipAlloc(size); if (result[i].scan0 == NULL) { GdipFree(result); return OutOfMemory; } memcpy(result[i].scan0, src[i].scan0, size); } else { result[i].scan0 = NULL; } result[i].palette = gdip_palette_clone (src[i].palette); result[i].property_count = src[i].property_count; status = gdip_propertyitems_clone(src[i].property, &result[i].property, src[i].property_count); if (status != Ok) { int j; for (j = 0; j < i; j++) { if (result[j].scan0 != NULL) { GdipFree(result[j].scan0); } if (result[j].property != NULL) { gdip_propertyitems_dispose(result[j].property, result[j].property_count); } } GdipFree(result); return status; } } *dest = result; return Ok; } static GpStatus gdip_bitmapdata_dispose(ActiveBitmapData *bitmap, int count) { int index; if (bitmap == NULL) { return Ok; } for (index = 0; index < count; index++) { if ((bitmap[index].scan0 != NULL) && ((bitmap[index].reserved & GBD_OWN_SCAN0) != 0)) { GdipFree(bitmap[index].scan0); bitmap[index].scan0 = NULL; } if (bitmap[index].palette != NULL) { GdipFree(bitmap[index].palette); bitmap[index].palette = NULL; } gdip_propertyitems_dispose(bitmap[index].property, bitmap[index].property_count); } GdipFree(bitmap); return Ok; } /* Add a new frame for the given dimension, if it does not exist. Return pointer to frame for dimension */ FrameData * gdip_frame_add(GpBitmap *bitmap, const GUID *dimension) { int i; if (bitmap == NULL) { return NULL; } if (bitmap->frames == NULL) { bitmap->frames = GdipAlloc(sizeof(FrameData)); if (bitmap->frames == NULL) { return NULL; } bitmap->num_of_frames = 1; bitmap->frames[0].count = 0; bitmap->frames[0].bitmap = NULL; bitmap->frames[0].frame_dimension = *dimension; return bitmap->frames; } else { /* Check if this dimension already exists, if not, add it */ for (i = 0; i < bitmap->num_of_frames; i++) { if (memcmp(&bitmap->frames[i].frame_dimension, dimension, sizeof(GUID)) == 0) { return &bitmap->frames[i]; } } /* No frame for the requested dimension exists */ bitmap->num_of_frames++; bitmap->frames = gdip_realloc (bitmap->frames, sizeof(FrameData) * (bitmap->num_of_frames)); if (bitmap->frames == NULL) { return NULL; } bitmap->frames[bitmap->num_of_frames - 1].count = 0; bitmap->frames[bitmap->num_of_frames - 1].bitmap = NULL; bitmap->frames[bitmap->num_of_frames - 1].frame_dimension = *dimension; return &bitmap->frames[bitmap->num_of_frames - 1]; } } /* Add a new ActiveBitmapData structure to an existing frame, return pointer to the new structure */ ActiveBitmapData * gdip_frame_add_bitmapdata(FrameData *frame) { if (frame == NULL) { return NULL; } if (frame->bitmap == NULL) { frame->bitmap = GdipAlloc (sizeof (ActiveBitmapData)); if (frame->bitmap == NULL) { return NULL; } gdip_bitmapdata_init(frame->bitmap); frame->count++; return frame->bitmap; } frame->bitmap = gdip_realloc (frame->bitmap, sizeof (ActiveBitmapData) * (frame->count + 1)); if (frame->bitmap == NULL) { return NULL; } gdip_bitmapdata_init(&frame->bitmap[frame->count]); frame->count++; return &frame->bitmap[frame->count - 1]; } ColorPalette* gdip_palette_clone (ColorPalette *original) { if (!original) return NULL; /* ColorPalette definition already includes a (single) ARGB value */ int size = sizeof (ColorPalette) + sizeof (ARGB) * (original->Count - 1); ColorPalette *result = GdipAlloc (size); if (result) memcpy (result, original, size); return result; } GpStatus gdip_bitmap_setactive(GpBitmap *bitmap, const GUID *dimension, int index) { int i; if (bitmap == NULL) { return InvalidParameter; } /* Invalidate the cached surface */ gdip_bitmap_invalidate_surface (bitmap); if ((bitmap->num_of_frames == 0) || (bitmap->frames == NULL)) { bitmap->active_frame = 0; bitmap->active_bitmap_no = 0; bitmap->active_bitmap = NULL; return Ok; } if (dimension == NULL) { if (bitmap->frames[0].count <= index) { return InvalidParameter; } bitmap->active_frame = 0; bitmap->active_bitmap_no = index; bitmap->active_bitmap = &bitmap->frames[0].bitmap[index]; return Ok; } for (i = 0; i < bitmap->num_of_frames; i++) { if (memcmp(&bitmap->frames[i].frame_dimension, dimension, sizeof(GUID)) == 0) { if (bitmap->frames[i].count <= index) { return Win32Error; } bitmap->active_frame = i; bitmap->active_bitmap_no = index; bitmap->active_bitmap = &bitmap->frames[i].bitmap[index]; return Ok; } } bitmap->active_frame = 0; bitmap->active_bitmap_no = 0; bitmap->active_bitmap = NULL; return InvalidParameter; } GpStatus gdip_bitmap_clone (GpBitmap *bitmap, GpBitmap **clonedbitmap) { GpBitmap *result; int frame; GpStatus status; result = (GpBitmap *) GdipAlloc (sizeof (GpBitmap)); if (result == NULL) { return OutOfMemory; } /* Copy simple types */ result->type = bitmap->type; result->image_format = bitmap->image_format; result->num_of_frames = bitmap->num_of_frames; result->active_frame = bitmap->active_frame; result->active_bitmap_no = bitmap->active_bitmap_no; result->active_bitmap = NULL; result->cairo_format = bitmap->cairo_format; result->surface = NULL; /* Allocate and copy frames, properties and bitmap data */ if (bitmap->frames != NULL) { result->frames = GdipAlloc(sizeof (FrameData) * result->num_of_frames); if (!result->frames) { status = OutOfMemory; goto fail; } for (frame = 0; frame < result->num_of_frames; frame++) { result->frames[frame].count = bitmap->frames[frame].count; result->frames[frame].frame_dimension = bitmap->frames[frame].frame_dimension; result->frames[frame].bitmap = NULL; status = gdip_bitmapdata_clone (bitmap->frames[frame].bitmap, &result->frames[frame].bitmap, bitmap->frames[frame].count); if (status != Ok) goto fail; } result->active_bitmap = &result->frames[result->active_frame].bitmap[result->active_bitmap_no]; } else { bitmap->frames = NULL; } *clonedbitmap = result; return Ok; fail: gdip_bitmap_dispose(result); return status; } GpBitmap * gdip_bitmap_new(void) { GpBitmap *result; result = (GpBitmap *) GdipAlloc (sizeof (GpBitmap)); if (result != NULL) { gdip_bitmap_init (result); } return result; } /* Create a new bitmap, and create a frame with the given dimension */ GpBitmap * gdip_bitmap_new_with_frame (const GUID *dimension, BOOL add_bitmapdata) { GpBitmap *result; FrameData *frame; if (dimension == NULL) { dimension = &gdip_image_frameDimension_page_guid; } result = gdip_bitmap_new(); if (result != NULL) { frame = gdip_frame_add(result, dimension); if ((frame != NULL) && add_bitmapdata) { ActiveBitmapData *bitmap_data; bitmap_data = gdip_frame_add_bitmapdata(frame); if (bitmap_data != NULL) { result->active_bitmap = bitmap_data; } } } return result; } GpStatus gdip_bitmap_dispose (GpBitmap *bitmap) { /* Might be called with partially filled bitmaps, so check values to be freed instead of assuming */ if (!bitmap) return Ok; if (bitmap->frames) { int frame; for (frame = 0; frame < bitmap->num_of_frames; frame++) { gdip_bitmapdata_dispose (bitmap->frames[frame].bitmap, bitmap->frames[frame].count); } GdipFree (bitmap->frames); bitmap->frames = NULL; } if (bitmap->surface) { cairo_surface_destroy (bitmap->surface); bitmap->surface = NULL; } GdipFree (bitmap); return Ok; } GpStatus GdipCreateBitmapFromStream (void *stream, GpBitmap **bitmap) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!stream || !bitmap) return InvalidParameter; // This will never be implemented, as 'stream' is a COM IStream. return NotImplemented; } /* coverity[+alloc : arg-*1] */ GpStatus GdipCreateBitmapFromFile (GDIPCONST WCHAR* filename, GpBitmap **bitmap) { GpImage *image; GpStatus status; status = GdipLoadImageFromFile (filename, &image); if (status != Ok) return status == OutOfMemory ? InvalidParameter : status; switch (image->type) { case ImageTypeBitmap: *bitmap = (GpBitmap *)image; return Ok; case ImageTypeMetafile: status = gdip_get_bitmap_from_metafile ((GpMetafile *) image, 0, 0, (GpImage **) bitmap); GdipDisposeImage (image); return status; default: return GenericError; } } GpStatus GdipCreateBitmapFromStreamICM (void *stream, GpBitmap **bitmap) { /* ICM isn't supported */ return GdipCreateBitmapFromStream (stream, bitmap); } /* coverity[+alloc : arg-*1] */ GpStatus GdipCreateBitmapFromFileICM (GDIPCONST WCHAR* filename, GpBitmap **bitmap) { /* ICM isn't supported */ return GdipCreateBitmapFromFile (filename, bitmap); } /* coverity[+alloc : arg-*5] */ GpStatus GdipCreateBitmapFromScan0 (INT width, INT height, INT stride, PixelFormat format, BYTE *scan0, GpBitmap **bitmap) { FrameData *frame; GpBitmap *result; ActiveBitmapData *bitmap_data; int cairo_format; int flags = 0; if (!gdiplusInitialized) return GdiplusNotInitialized; if (width <= 0 || height <= 0 || !bitmap) return InvalidParameter; switch (format) { case PixelFormat24bppRGB: cairo_format = CAIRO_FORMAT_RGB24; break; case PixelFormat32bppARGB: case PixelFormat32bppPARGB: flags = ImageFlagsHasAlpha; cairo_format = CAIRO_FORMAT_ARGB32; break; case PixelFormat32bppRGB: cairo_format = CAIRO_FORMAT_ARGB32; break; case PixelFormat16bppRGB555: case PixelFormat16bppRGB565: /* fake them as 32bpp RGB as Cairo deprecated CAIRO_FORMAT_RGB16_565 support */ /* why 32bpp ? because that's the result of MS GDI+ when loading them, even if the bitmap is empty */ cairo_format = CAIRO_FORMAT_ARGB32; break; case PixelFormat8bppIndexed: case PixelFormat4bppIndexed: flags = ImageFlagsHasAlpha; cairo_format = CAIRO_FORMAT_A8; break; case PixelFormat1bppIndexed: flags = ImageFlagsHasAlpha; cairo_format = CAIRO_FORMAT_A1; break; case PixelFormat16bppGrayScale: case PixelFormat16bppARGB1555: case PixelFormat48bppRGB: case PixelFormat64bppARGB: case PixelFormat64bppPARGB: case PixelFormat32bppCMYK: *bitmap = NULL; return NotImplemented; default: return InvalidParameter; } if (scan0 && (stride == 0 || stride % 4)) return InvalidParameter; result = gdip_bitmap_new (); if (!result) return OutOfMemory; result->image_format = MEMBMP; result->cairo_format = cairo_format; result->surface = NULL; result->active_frame = 0; result->active_bitmap_no = 0; result->active_bitmap = NULL; /* Create single 'page' frame, with single bitmap */ frame = gdip_frame_add (result, &gdip_image_frameDimension_page_guid); if (!frame) { gdip_bitmap_dispose (result); return OutOfMemory; } bitmap_data = gdip_frame_add_bitmapdata (frame); if (!bitmap_data) { gdip_bitmap_dispose (result); return OutOfMemory; } /* populate first bitmap in first frame */ bitmap_data->width = width; bitmap_data->height = height; bitmap_data->pixel_format = format; bitmap_data->image_flags = flags; if (stride == 0) { if (gdip_is_an_indexed_pixelformat(format)) { stride = ((gdip_get_pixel_format_depth(format) * width) + 7) / 8; } else { stride = (gdip_get_pixel_format_components (format) * gdip_get_pixel_format_depth (format) * width) / 8; } /* make sure the stride aligns the next row to a 32 bits boundary */ gdip_align_stride (stride); } bitmap_data->stride = stride; if (!scan0) { unsigned long long int size = (unsigned long long int)stride * height; if (size > G_MAXINT32) { gdip_bitmap_dispose (result); return OutOfMemory; } scan0 = GdipAlloc (size); if (!scan0) { gdip_bitmap_dispose (result); return OutOfMemory; } if ((gdip_get_pixel_format_bpp(format) < 32) || gdip_is_an_alpha_pixelformat(format)) { memset (scan0, 0, size); } else { /* Since the pixel format is not an alpha pixel format (i.e., it is * PixelFormat32bppRGB), the image should be initially black, not * initially transparent. Thus, we need to set the alpha channel, * which the user code doesn't think exists but Cairo is still paying * attention to, to 0xFF. */ for (int y = 0; y < height; y++) { ARGB *scan = (ARGB *) (scan0 + y * stride); for (int x = 0; x < width; x++) { scan[x] = 0xFF000000; } } } bitmap_data->reserved = GBD_OWN_SCAN0; } bitmap_data->scan0 = scan0; /* Make sure indexed images have a palette */ if (gdip_is_an_indexed_pixelformat (format)) { int palette_entries; int header_size; int bytes_needed; const unsigned int *default_palette; #if WORDS_BIGENDIAN int i; #endif palette_entries = 1 << gdip_get_pixel_format_depth(format); header_size = sizeof(ColorPalette) - sizeof(ARGB); bytes_needed = header_size + palette_entries * sizeof(ARGB); bitmap_data->palette = GdipAlloc (bytes_needed); if (!bitmap_data->palette) { gdip_bitmap_dispose (result); return OutOfMemory; } bitmap_data->palette->Count = palette_entries; bitmap_data->palette->Flags = COLOR_PALETTE_FLAGS_DEFAULT; switch (format) { case PixelFormat1bppIndexed: default_palette = default_Format1bppIndexed_palette; bitmap_data->palette->Flags |= COLOR_PALETTE_FLAGS_GREYSCALE; break; case PixelFormat4bppIndexed: default_palette = default_Format4bppIndexed_palette; break; case PixelFormat8bppIndexed: default_palette = default_Format8bppIndexed_palette; bitmap_data->palette->Flags |= COLOR_PALETTE_FLAGS_HALFTONE; break; default: default_palette = NULL; /* Suppress unassigned val used warning */ palette_entries = 0; /* make sure we don't try to access default_palette later */ } #if WORDS_BIGENDIAN for (i=0; i < palette_entries; i++) { set_pixel_bgra (bitmap_data->palette->Entries, (i << 2), default_palette[i], (default_palette[i] >> 8), (default_palette[i] >> 16), (default_palette[i] >> 24)); } #else memcpy (bitmap_data->palette->Entries, default_palette, palette_entries * 4); #endif } else { bitmap_data->palette = NULL; } gdip_bitmap_setactive(result, NULL, 0); *bitmap = result; return Ok; } /* coverity[+alloc : arg-*3] */ GpStatus GdipCreateBitmapFromGraphics (int width, int height, GpGraphics *graphics, GpBitmap **bitmap) { GpStatus status; GpBitmap *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!graphics || !bitmap) return InvalidParameter; status = GdipCreateBitmapFromScan0 (width, height, 0, PixelFormat32bppPARGB, NULL, &result); if (status != Ok) return status; GdipGetDpiX (graphics, &result->active_bitmap->dpi_horz); GdipGetDpiY (graphics, &result->active_bitmap->dpi_vert); *bitmap = result; return Ok; } GpStatus GdipCreateBitmapFromHBITMAP (HBITMAP hbm, HPALETTE hpal, GpBitmap** bitmap) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!bitmap || !hbm) return InvalidParameter; return GdipCloneImage ((GpImage *)hbm, (GpImage**)bitmap); } GpStatus GdipCreateHBITMAPFromBitmap (GpBitmap* bitmap, HBITMAP *hbmReturn, ARGB background) { if (!gdiplusInitialized) return GdiplusNotInitialized; /* * Note: the handle must survive disposing the bitmap. This means that there's no interoperable way to free this memory. * For libgdiplus you must use GdipDisposeImage on the handle, while on Windows you should call the DeleteObject function. */ GpStatus status = GdipCloneImage ((GpImage *)bitmap, (GpImage**)hbmReturn); if (status != Ok) return status; ((GpImage*)*hbmReturn)->image_format = MEMBMP; ((GpImage*)*hbmReturn)->active_bitmap->image_flags |= ImageFlagsUndocumented; /* 0x00040000 */ ((GpImage*)*hbmReturn)->active_bitmap->image_flags &= ~ImageFlagsHasAlpha; /* 0x00000002 */ return Ok; } GpStatus GdipCreateBitmapFromHICON (HICON hicon, GpBitmap** bitmap) { GpStatus status; GpImage *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!hicon || !bitmap) return InvalidParameter; #if defined(WIN32) return NotImplemented; #endif status = GdipCloneImage ((GpImage *)hicon, &result); if (status != Ok) return status; if (result->active_bitmap->palette) { GdipFree (result->active_bitmap->palette); result->active_bitmap->palette = NULL; } result->image_format = MEMBMP; result->active_bitmap->image_flags |= ImageFlagsUndocumented;/* 0x00040000 */ result->active_bitmap->image_flags &= ~ImageFlagsHasAlpha; /* 0x00000002 */ *bitmap = (GpBitmap *) result; return Ok; } GpStatus GdipCreateHICONFromBitmap (GpBitmap* bitmap, HICON *hbmReturn) { if (!gdiplusInitialized) return GdiplusNotInitialized; /* * Note: the handle must survive disposing the bitmap. This means that there's no interoperable way to free this memory. * For libgdiplus you must use GdipDisposeImage on the handle, while on Windows you should call the DestroyIcon function. */ return GdipCloneImage ((GpImage *)bitmap, (GpImage**)hbmReturn); } GpStatus WINGDIPAPI GdipCreateBitmapFromResource (HINSTANCE hInstance, GDIPCONST WCHAR *lpBitmapName, GpBitmap** bitmap) { if (!gdiplusInitialized) return GdiplusNotInitialized; return(NotImplemented); } /* coverity[+alloc : arg-*6] */ GpStatus WINGDIPAPI GdipCloneBitmapAreaI (INT x, INT y, INT width, INT height, PixelFormat format, GpBitmap *original, GpBitmap **bitmap) { GpBitmap *result; Rect sr = { x, y, width, height }; Rect dr = { 0, 0, width, height }; GpStatus status; if ((original == NULL) || (bitmap == NULL) || (original->active_bitmap == NULL)) { return InvalidParameter; } if (((x + width) > original->active_bitmap->width) || ((y + height) > original->active_bitmap->height)) { return InvalidParameter; } result = gdip_bitmap_new_with_frame(NULL, TRUE); if (result == NULL) { return OutOfMemory; } result->image_format = original->image_format; gdip_bitmap_flush_surface (original); status = gdip_bitmap_clone_data_rect (original->active_bitmap, &sr, result->active_bitmap, &dr); if (status != Ok) { goto fail; } result->cairo_format = original->cairo_format; // Preserve the resolution values. See https://bugzilla.xamarin.com/show_bug.cgi?id=44127. result->active_bitmap->dpi_horz = original->active_bitmap->dpi_horz; result->active_bitmap->dpi_vert = original->active_bitmap->dpi_vert; result->active_bitmap->image_flags |= (original->active_bitmap->image_flags & ImageFlagsHasRealDPI); *bitmap = result; return Ok; fail: gdip_bitmap_dispose (result); return status; } /* coverity[+alloc : arg-*6] */ GpStatus WINGDIPAPI GdipCloneBitmapArea (REAL x, REAL y, REAL w, REAL h, PixelFormat format, GpBitmap *original, GpBitmap **bitmap) { return GdipCloneBitmapAreaI ((int) x, (int) y, (int) w, (int) h, format, original, bitmap); } static void gdip_copy_strides (BYTE *dst, int dstStride, BYTE *src, int srcStride, int realBytes, int height) { int i; for (i = 0; i < height; i++) { memcpy (dst, src, realBytes); dst += dstStride; src += srcStride; } } /* * Copy srcRect region in srcData to destRect region in destData. No conversion is done. Assumes * ActiveBitmapData is straight from a GpBitmap. src and dest rects must be the same width/height and * bits must be of the same PixelFormat. */ static GpStatus gdip_bitmap_clone_data_rect (ActiveBitmapData *srcData, Rect *srcRect, ActiveBitmapData *destData, Rect *destRect) { int dest_components; int dest_depth; if ((srcData == NULL) || (srcRect == NULL) || (destData == NULL) || (destRect == NULL) || (srcRect->Width != destRect->Width) || (srcRect->Height != destRect->Height)) { return InvalidParameter; } if (!gdip_is_a_supported_pixelformat (srcData->pixel_format)) { return NotImplemented; } dest_components = gdip_get_pixel_format_components (destData->pixel_format); if (destData->scan0 == NULL) { dest_components = gdip_get_pixel_format_components (srcData->pixel_format); dest_depth = gdip_get_pixel_format_depth (srcData->pixel_format); destData->pixel_format = srcData->pixel_format; destData->stride = ((destRect->Width * dest_components * dest_depth) >> 3); gdip_align_stride (destData->stride); unsigned long long int size = (unsigned long long int)destData->stride * destRect->Height; if (size > G_MAXINT32) { return OutOfMemory; } destData->scan0 = GdipAlloc (size); if (destData== NULL) { return OutOfMemory; } destData->width = destRect->Width; destData->height = destRect->Height; destData->pixel_format = srcData->pixel_format; destData->reserved = GBD_OWN_SCAN0; if (srcData->palette) { destData->palette = gdip_palette_clone (srcData->palette); if (!destData->palette) { GdipFree (destData->scan0); destData->scan0 = NULL; return OutOfMemory; } } } if (!gdip_is_an_indexed_pixelformat (srcData->pixel_format)) { gdip_copy_strides (destData->scan0, destData->stride, srcData->scan0 + (srcData->stride * srcRect->Y) + (gdip_get_pixel_format_components (srcData->pixel_format) * srcRect->X), srcData->stride, destRect->Width * dest_components, destRect->Height); } else { int src_depth; int src_first_x_bit_index; int width_bits; int src_first_x_bit_offset_into_byte; src_depth = gdip_get_pixel_format_depth (srcData->pixel_format); /* first, check if the bits are aligned onto a byte boundary */ src_first_x_bit_index = srcRect->X * src_depth; width_bits = destRect->Width * src_depth; src_first_x_bit_offset_into_byte = src_first_x_bit_index & 7; if (src_first_x_bit_offset_into_byte == 0) { /* the fast path: no mid-byte bit mangling required :-) * this will always be the case for 8-bit images. * basically, the source bits are aligned to the destination * bytes, and it doesn't matter if the width isn't a multiple * of 8 bits, because the remainder is guaranteed to be * allocated by the stride, and will be ignored because the * width will indicate fewer pixels than actually end up being * copied. */ gdip_copy_strides ( destData->scan0, destData->stride, srcData->scan0 + (src_first_x_bit_index / 8) + (srcData->stride * srcRect->Y), srcData->stride, width_bits / 8, destRect->Height); } else { /* the not-so-fast path: no bits are aligned, so the entire image requires bit juggling. */ BYTE *src_scan; BYTE *src_scan0; BYTE *dest_scan; BYTE *dest_scan0; unsigned short buffer; int left_shift; int x; int y; src_scan0 = srcData->scan0; dest_scan0 = destData->scan0; left_shift = src_first_x_bit_offset_into_byte; /* move the src_scan0 up to the first byte with pixel data involved in the copy */ src_scan0 += srcRect->Y * srcData->stride; src_scan0 += (src_first_x_bit_offset_into_byte / 8); for (y=0; y < destRect->Height; y++) { src_scan = src_scan0 + y * srcData->stride; dest_scan = dest_scan0 + y * destData->stride; /* jump-start the packing function. it avoids double-sampling the source bits by * using buffer as a shift register; bits 8-15 are the current packed dest pixel, * and some of bits 0-7 are not used, to permit alignment of the pixel data. */ buffer = src_scan[0] << left_shift; for (x = 1; x < destRect->Width; x++) { buffer <<= 8; buffer |= src_scan[x] << left_shift; dest_scan[0] = (buffer >> 8); } } } } return Ok; } /* * According to GDI+ testing, * RGB[A] PixelFormats can be converted to/from any other RGB[A] pixel format, with or without alpha. * We should support all of these: * * 32bpp argb - 16bpp argb 1555 * 32bpp argb - 16bpp rgb 555 * 32bpp argb - 16bpp rgb 565 * 32bpp argb - 24bpp rgb 888 * 32bpp argb - 32bpp Pargb * 32bpp argb - 32bpp rgb * * Upconversion is allowed (e.g 8bpp indexed to 32bpp rgb), but no downconversion (32bpp to 8bpp indexed) * */ static int gdip_is_pixel_format_conversion_valid (PixelFormat src, PixelFormat dest) { if (src == dest) { return 1; } /* non-GDI supported formats can't be converted */ if (!(src & PixelFormatGDI)) { return 0; } /* We don't allow converting *to* indexed formats */ if (dest & PixelFormatIndexed) { return 0; } /* These are the RGB formats */ if ((src & PixelFormatGDI) && !(src & PixelFormatExtended)) { /* all of these should be supported, but we only report the * ones we really can do for now */ /* We can't handle converting to/from the 565/555/1555 ones */ if ((src & 0xff00) == 16 || (dest & 0xff00) == 16) { return 0; } return 1; } return 0; } GpStatus gdip_init_pixel_stream (StreamingState *state, ActiveBitmapData *data, int x, int y, int w, int h) { if ((state == NULL) || (data == NULL) || (data->scan0 == NULL)) { return InvalidParameter; } /* Ensure that the rectangle requested is legal. */ if ((x < 0) || (y < 0) || ((x + w) > data->width) || ((y + h) > data->height)) { return InvalidParameter; } /* Initialize the StreamingState structure to point at the first pixel. */ state->region.X = x; state->region.Y = y; state->region.Width = w; state->region.Height = h; state->x = x; state->y = y; state->p = -1; /* ensure that the buffer will be preloaded on the first call, for indexed formats */ /* The following computation will compute the byte pointer that _contains_ the first * pixel; this doesn't necessarily mean that the pixel is aligned to the byte. This * will be handled in gdip_pixel_stream_get_next () each time it starts a new row. */ state->scan = (BYTE*)(data->scan0) + y * data->stride; switch (data->pixel_format) { case PixelFormat1bppIndexed: state->one_pixel_mask = 0x01; state->one_pixel_shift = 1; state->pixels_per_byte = 8; state->scan += (x >> 3); /* x * 1 / 8 */ break; case PixelFormat4bppIndexed: state->one_pixel_mask = 0x0F; state->one_pixel_shift = 4; state->pixels_per_byte = 2; state->scan += (x >> 1); /* x * 4 / 8 */ break; case PixelFormat8bppIndexed: state->one_pixel_mask = 0xFF; state->one_pixel_shift = 8; state->pixels_per_byte = 1; state->scan += x; /* x * 8 / 8 */ break; case PixelFormat24bppRGB: /* GDI+ use 3 bytes for 24 bpp while Cairo use 4 bytes */ if (data->reserved & GBD_TRUE24BPP) { state->pixels_per_byte = -3; state->scan += ((x * 3) >> 3); /* x * 3 / 8 */ break; } /* fall through */ case PixelFormat32bppRGB: default: /* indicate full RGB processing */ state->pixels_per_byte = -(gdip_get_pixel_format_bpp (data->pixel_format) >> 3); state->scan -= x * state->pixels_per_byte; break; } state->data = data; return Ok; } static BOOL gdip_pixel_stream_has_next (StreamingState *state) { if (state != NULL) { return (state->p >= 0) || ((state->y < (state->region.Y + state->region.Height)) && (state->x < (state->region.X + state->region.Width))); } else { return FALSE; } } unsigned int /* <-- can be an ARGB or a palette index */ gdip_pixel_stream_get_next (StreamingState *state) { unsigned int ret; if (state == NULL) { int bright_pink; set_pixel_bgra(&bright_pink, 0, 0xFF, 0x00, 0xFF, 0xFF); /* bright pink; hopefully this will get somebody's attention :-) */ return bright_pink; } /* Note: This function does not check whether the end of the region has been hit. This function can * potentially overrun memory buffers! gdip_pixel_stream_has_next () must be used in conjunction * with this function. */ if (state->pixels_per_byte == 1) { /* A fast path for 8-bit indexed data: pixels are byte-aligned, so no special unpacking is required. */ ret = *state->scan; state->scan++; state->x++; if (state->x >= (state->region.X + state->region.Width)) { state->x = state->region.X; state->y++; state->scan = (BYTE*)(state->data->scan0) + state->y * state->data->stride + state->x; } } else if (state->pixels_per_byte > 0) { /* We have an indexed format (the RGB formats can't fit a whole pixel into a single byte). */ if (state->p < 0) { state->buffer = *state->scan; state->scan++; state->p = 0; if (state->x == state->region.X) { /* First pixel of the row; check whether it is aligned to the byte or not. */ int index_into_byte = state->x & (state->pixels_per_byte - 1); if (index_into_byte != 0) { /* Not aligned; need to advance the buffer to the * first pixel in the stream region. */ state->buffer <<= (index_into_byte * state->one_pixel_shift); state->p = index_into_byte; } } } state->buffer <<= state->one_pixel_shift; ret = (state->buffer >> 8) & state->one_pixel_mask; state->x++; state->p++; /* Have we hit the end of the buffer? */ if (state->p >= state->pixels_per_byte) state->p = -1; if (state->x >= (state->region.X + state->region.Width)) { state->x = state->region.X; state->y++; state->scan = (BYTE*)(state->data->scan0) + state->y * state->data->stride + state->x * gdip_get_pixel_format_bpp (state->data->pixel_format) / 8; state->p = -1; } } else { /* We have an RGB format. In the current implementation, these are always stored as * CAIRO_FORMAT_ARGB. This makes this section very easy to implement. If native * support for 15- and 16-bit pixel formats needs to be added in the future, though, * then this is where it needs to be done. * * In order to simplify advancing the state->scan pointer, the state->pixels_per_byte * member is set to the number of bytes per pixel, negated. That is, for 24-bit * formats, it is set to -3, and for 32-bit formats, it is set to -4. * * Note that pixel streams do not support 48- and 64-bit data at this time. */ if (state->pixels_per_byte == -4) { #if WORDS_BIGENDIAN ret = state->scan [0] | (state->scan [1] << 8) | (state->scan [2] << 16) | ((guint32)state->scan [3] << 24); #else ret = *(unsigned int *)state->scan; #endif } else { /* Special case: 24-bit data needs to have the cairo format alpha component forced * to 0xFF, or many operations will do nothing (or do strange things if the alpha * channel contains garbage). */ ret = state->scan [0] | (state->scan [1] << 8) | (state->scan [2] << 16) | 0xFF000000; } state->scan -= state->pixels_per_byte; state->x++; if (state->x >= (state->region.X + state->region.Width)) { state->x = state->region.X; state->y++; state->scan = (BYTE*)(state->data->scan0) + state->y * state->data->stride + state->x * -state->pixels_per_byte; } } return ret; } static void gdip_pixel_stream_set_next (StreamingState *state, unsigned int pixel_value) { if (state == NULL) { return; } /* Note: This function does not check whether the end of the region has been hit. This function can * potentially overrun memory buffers! gdip_pixel_stream_has_next () must be used in conjunction * with this function. */ if (state->pixels_per_byte == 1) { /* A fast path for 8-bit indexed data: pixels are byte-aligned, so no special packing is required. */ *state->scan = pixel_value; state->scan++; state->x++; if (state->x >= (state->region.X + state->region.Width)) { state->x = state->region.X; state->y++; state->scan = (BYTE*)(state->data->scan0) + state->y * state->data->stride + state->x; } } else if (state->pixels_per_byte > 0) { /* We have an indexed format (the RGB formats can't fit a whole pixel into a single byte). */ if (state->p < 0) { state->p = 0; if (state->x == state->region.X) { /* First pixel of the row; check whether it is aligned to the byte or not. */ int index_into_byte = state->x & (state->pixels_per_byte - 1); if (index_into_byte == 0) { /* It is aligned; all we need to do is clear the buffer. */ state->buffer = 0; } else { /* It is not aligned; the buffer needs to be pre-loaded with those * pixels that are to the left of the first pixel to be set. */ state->buffer = (*state->scan << (index_into_byte * state->one_pixel_shift)); state->p = index_into_byte; } } } state->buffer <<= state->one_pixel_shift; state->buffer |= ((pixel_value & state->one_pixel_mask) << 8); state->x++; state->p++; /* Have we hit the end of the buffer? */ if (state->p >= state->pixels_per_byte) { *state->scan = (state->buffer >> 8); state->scan++; state->p = -1; } if (state->x >= (state->region.X + state->region.Width)) { if (state->p >= 0) { int existing_mask = 0; while (state->p < state->pixels_per_byte) { existing_mask <<= state->one_pixel_shift; existing_mask |= state->one_pixel_mask; state->buffer <<= state->one_pixel_shift; state->p++; } *state->scan = (*state->scan & existing_mask) | (state->buffer >> 8); } state->x = state->region.X; state->y++; state->scan = (BYTE*)(state->data->scan0) + state->y * state->data->stride + state->x * gdip_get_pixel_format_bpp (state->data->pixel_format) / 8; state->p = -1; } } else { /* We have an RGB format. In the current implementation, these are always stored as * CAIRO_FORMAT_ARGB. This makes this section very easy to implement. If native * support for 15- and 16-bit pixel formats needs to be added in the future, though, * then this is where it needs to be done. * * In order to simplify advancing the state->scan pointer, the state->pixels_per_byte * member is set to the number of bytes per pixel, negated. That is, for 24-bit * formats, it is set to -3, and for 32-bit formats, it is set to -4. * * Note that pixel streams do not support 48- and 64-bit data at this time. */ if (state->pixels_per_byte == -4) { #if WORDS_BIGENDIAN state->scan [0] = (pixel_value >> 24); state->scan [1] = (pixel_value >> 16); state->scan [2] = (pixel_value >> 8); state->scan [3] = (state->data->pixel_format == PixelFormat32bppRGB) ? 0xFF : pixel_value; #else if (state->data->pixel_format == PixelFormat32bppRGB) pixel_value |= 0xFF000000; *(unsigned int *)state->scan = pixel_value; #endif } else { /* ensure we don't get one byte over our allocated buffer */ #if WORDS_BIGENDIAN state->scan [0] = (pixel_value >> 24); state->scan [1] = (pixel_value >> 16); state->scan [2] = (pixel_value >> 8); #else state->scan [2] = (pixel_value >> 16); state->scan [1] = (pixel_value >> 8); state->scan [0] = pixel_value; #endif } state->scan -= state->pixels_per_byte; state->x++; if (state->x >= (state->region.X + state->region.Width)) { state->x = state->region.X; state->y++; state->scan = (BYTE*)(state->data->scan0) + state->y * state->data->stride + state->x * -state->pixels_per_byte; } } } static BOOL /* <-- TRUE if optimisation was possible and copy done, else FALSE */ gdip_pixel_stream_copy_optimized (StreamingState *dst_state, StreamingState *src_state) { if (src_state == NULL) return FALSE; if (dst_state == NULL) return FALSE; /* in a first shot we only support copy operations for cases where source and destination storage width is exactly the same */ if (src_state->pixels_per_byte != dst_state->pixels_per_byte) return FALSE; //if (src_state->data->pixel_format == PixelFormat32bppRGB) return FALSE; /* if the target is in 32bpp format with only RGB but no alpha then we should forcefully set all alpha bits to 0xff -> optimize this later! */ if (dst_state->pixels_per_byte == -4) { if (dst_state->data->pixel_format == PixelFormat32bppRGB) return FALSE; } /* optimisation code differs for different bytes per pixel (== pixels per byte) */ if (src_state->pixels_per_byte == 1) { /* A fast path for 8-bit indexed data: pixels are byte-aligned, so no special unpacking is required. */ return FALSE; /* optimize this later */ } else if (src_state->pixels_per_byte > 0) { /* We have an indexed format (the RGB formats can't fit a whole pixel into a single byte). */ return FALSE; /* optimize this later */ } else if (src_state->pixels_per_byte == 0) { return FALSE; /* unknown format - dont know how to handle; this is a sanity check for crash prevention in the following code */ } else { /* We have an RGB format. In the current implementation, these are always stored as * CAIRO_FORMAT_ARGB. This makes this section very easy to implement. If native * support for 15- and 16-bit pixel formats needs to be added in the future, though, * then this is where it needs to be done. * * In order to simplify advancing the state->scan pointer, the state->pixels_per_byte * member is set to the number of bytes per pixel, negated. That is, for 24-bit * formats, it is set to -3, and for 32-bit formats, it is set to -4. * * Note that pixel streams do not support 48- and 64-bit data at this time. */ #if WORDS_BIGENDIAN return FALSE; /* optimize this later */ #else int bytes_per_pixel = -src_state->pixels_per_byte; int bytes_per_line = bytes_per_pixel * src_state->region.Width; int bytes_per_region = bytes_per_line * src_state->region.Height; int src_stride = src_state->data->stride; int dst_stride = dst_state->data->stride; /* calculate region base addresses (this might resemble the current ..._state->scan value, but we simply dont care) */ BYTE* src_region = (BYTE*)(src_state->data->scan0) + src_state->region.Y * src_stride + src_state->region.X * bytes_per_pixel; BYTE* dst_region = (BYTE*)(dst_state->data->scan0) + dst_state->region.Y * dst_stride + dst_state->region.X * bytes_per_pixel; /* check if thze data at both locations is in a perfectly consecutive arrangement */ if ((src_state->region.Width * bytes_per_pixel == src_stride) && (dst_state->region.Width * bytes_per_pixel == dst_stride)) { memcpy (dst_region, src_region, bytes_per_region); } else { BYTE *src = src_region; BYTE *dst = dst_region; int lines; for (lines = src_state->region.Height; lines; lines--) { memcpy (dst, src, bytes_per_line); src += src_stride; dst += dst_stride; } } /* all data got copied */ /* adjust the position index and the scan value to the end of the region */ src_state->x = src_state->region.X + src_state->region.Width; src_state->y = src_state->region.Y + src_state->region.Height; src_state->scan += src_state->region.Y * src_stride; dst_state->x = dst_state->region.X + dst_state->region.Width; dst_state->y = dst_state->region.Y + dst_state->region.Height; dst_state->scan += dst_state->region.Y * dst_stride; #endif } return TRUE; } /** * srcData - input data * srcRect - rectangle of input data to place in destData * destData - where to place output; only the PixelFormat field is needed, * which specifies the output type. * destRect - destination rectangle in output. * * assumes that: * - non-null data * - rectangles are valid * - the pixel format conversion has already been validated. */ static GpStatus gdip_bitmap_change_rect_pixel_format (ActiveBitmapData *srcData, const Rect *srcRect, ActiveBitmapData *destData, Rect *destRect) { PixelFormat srcFormat; PixelFormat destFormat; StreamingState srcStream; StreamingState destStream; Rect effectiveDestRect; GpStatus status; srcFormat = srcData->pixel_format; destFormat = destData->pixel_format; if (!gdip_is_pixel_format_conversion_valid (srcFormat, destFormat)) return InvalidParameter; if (!destData->scan0) return InvalidParameter; /* Check that the destRect lies fully within the destData buffer. */ if ((destRect->X + destRect->Width > destData->width) || (destRect->Y + destRect->Height > destData->height)) return InvalidParameter; effectiveDestRect = *destRect; if (effectiveDestRect.Width > srcRect->Width) { effectiveDestRect.Width = srcRect->Width; } if (effectiveDestRect.Height > srcRect->Height) { effectiveDestRect.Height = srcRect->Height; } /* Fire up the pixel streams. */ status = gdip_init_pixel_stream (&srcStream, srcData, srcRect->X, srcRect->Y, srcRect->Width, srcRect->Height); if (status != Ok) { return status; } status = gdip_init_pixel_stream (&destStream, destData, effectiveDestRect.X, effectiveDestRect.Y, effectiveDestRect.Width, effectiveDestRect.Height); if (status != Ok) { return status; } /* Move the data; special path going from indexed to not-indexed */ if ((srcFormat & PixelFormatIndexed) && !(destFormat & PixelFormatIndexed)) { int pixel; while (gdip_pixel_stream_has_next (&srcStream)) { pixel = gdip_pixel_stream_get_next (&srcStream); /* Look up the pixel in the palette and get the ARGB value */ pixel = srcData->palette->Entries[pixel]; #if G_BYTE_ORDER != G_LITTLE_ENDIAN pixel = GUINT32_FROM_LE (pixel); #endif gdip_pixel_stream_set_next (&destStream, pixel); } } else { if (!gdip_pixel_stream_copy_optimized (&destStream, &srcStream)) { while (gdip_pixel_stream_has_next (&srcStream)) { gdip_pixel_stream_set_next (&destStream, gdip_pixel_stream_get_next (&srcStream)); } } } return Ok; } GpStatus WINGDIPAPI GdipBitmapLockBits (GpBitmap *bitmap, GDIPCONST GpRect *rect, UINT flags, PixelFormat format, BitmapData *lockedBitmapData) { Rect src_rect; ActiveBitmapData *src_data; ActiveBitmapData *dest_data; GpStatus status; if (!bitmap || !lockedBitmapData) return InvalidParameter; src_data = bitmap->active_bitmap; dest_data = (ActiveBitmapData *) lockedBitmapData; /* Is this bitmap already locked? */ if (src_data->reserved & GBD_LOCKED) return WrongState; if (rect) { if ((rect->X < 0) || (rect->Y < 0) || (rect->Width <= 0) || (rect->Height <= 0)) return InvalidParameter; if (((rect->X + rect->Width) > src_data->width) || ((rect->Y + rect->Height) > src_data->height)) return InvalidParameter; src_rect = *rect; } else { // Lock the entire bitmap if no source rect is supplied. src_rect.X = 0; src_rect.Y = 0; src_rect.Width = src_data->width; src_rect.Height = src_data->height; } /* if the current and specified format are different, that the bitmap is indexed and that we ask for write then... */ if ((src_data->pixel_format != format) && gdip_is_an_indexed_pixelformat (src_data->pixel_format) && ((flags & ImageLockModeWrite) != 0)) { return InvalidParameter; } if (!gdip_is_a_supported_pixelformat (format)) return InvalidParameter; /* Common stuff */ if ((flags & ImageLockModeWrite) != 0) { dest_data->reserved |= GBD_WRITE_OK; dest_data->image_flags &= ~ImageFlagsReadOnly; } else { dest_data->reserved &= ~GBD_WRITE_OK; dest_data->image_flags |= ImageFlagsReadOnly; } if ((format & PixelFormatAlpha) != 0) { dest_data->image_flags |= ImageFlagsHasAlpha; } src_data->reserved |= GBD_LOCKED; dest_data->reserved |= GBD_LOCKED; dest_data->x = src_rect.X; dest_data->y = src_rect.Y; dest_data->width = src_rect.Width; dest_data->height = src_rect.Height; dest_data->pixel_format = format; dest_data->palette = NULL; if (format != PixelFormat24bppRGB && format == src_data->pixel_format && (flags & ImageLockModeUserInputBuf) == 0) { // No conversion needed, just read the bits directly. dest_data->reserved &= ~GBD_OWN_SCAN0; dest_data->stride = src_data->stride; dest_data->scan0 = src_data->scan0; } else { int dest_pixel_format_bpp; switch (format) { case PixelFormat24bppRGB: // Cairo uses 32bpp to represent 24bpp images so this is read as 32bpp. // https://github.com/mono/libgdiplus/issues/448. dest_pixel_format_bpp = 24; dest_data->reserved |= GBD_TRUE24BPP; break; default: dest_pixel_format_bpp = gdip_get_pixel_format_bpp (format); break; } dest_data->stride = (src_rect.Width * dest_pixel_format_bpp + 7) >> 3; gdip_align_stride (dest_data->stride); if ((flags & ImageLockModeUserInputBuf) == 0) { dest_data->reserved |= GBD_OWN_SCAN0; unsigned long long int size = (unsigned long long int)src_rect.Height * dest_data->stride; if (size > G_MAXINT32) return OutOfMemory; dest_data->scan0 = GdipAlloc (size); if (!dest_data->scan0) return OutOfMemory; } else { dest_data->reserved &= ~GBD_OWN_SCAN0; /* User is supposed to have provided the buffer */ if (!dest_data->scan0) return InvalidParameter; } } gdip_bitmap_flush_surface (bitmap); /* If the user wants the original data to be readable, then convert the bits. */ if ((flags & ImageLockModeRead) != 0) { Rect dest_rect = {0, 0, src_rect.Width, src_rect.Height}; status = gdip_bitmap_change_rect_pixel_format (src_data, &src_rect, dest_data, &dest_rect); if (status != Ok) { if ((dest_data->reserved & GBD_OWN_SCAN0) != 0) { GdipFree (dest_data->scan0); dest_data->scan0 = NULL; dest_data->reserved &= ~GBD_OWN_SCAN0; } return status; } } return Ok; } GpStatus WINGDIPAPI GdipBitmapUnlockBits (GpBitmap *bitmap, BitmapData *lockedBitmapData) { GpStatus status; ActiveBitmapData *src_data; ActiveBitmapData *dest_data; if (!bitmap || !lockedBitmapData) return InvalidParameter; src_data = (ActiveBitmapData *) lockedBitmapData; dest_data = bitmap->active_bitmap; /* It is not safe to assume that the correct ActiveBitmapData has been passed in. * Sanity check: Make sure the locked data is in fact locked.*/ if (!(dest_data->reserved & GBD_LOCKED) || !(dest_data->reserved & GBD_LOCKED)) { return Win32Error; } /* Sanity check: Make sure the locked data's size is consistent with having * been returned from LockBits (). */ if ((src_data->width > dest_data->width) || (src_data->height > dest_data->height)) { return InvalidParameter; } /* We need to copy the locked data back to the root data's Scan0 if the image was writeable */ if ((src_data->reserved & GBD_WRITE_OK) != 0) { Rect src_rect = { 0, 0, src_data->width, src_data->height }; Rect dest_rect = { src_data->x, src_data->y, src_data->width, src_data->height }; status = gdip_bitmap_change_rect_pixel_format (src_data, &src_rect, dest_data, &dest_rect); } else { status = Ok; } if ((src_data->reserved & GBD_OWN_SCAN0) != 0) { GdipFree(src_data->scan0); src_data->scan0 = NULL; src_data->reserved &= ~GBD_OWN_SCAN0; } if (src_data->palette) { GdipFree(src_data->palette); src_data->palette = NULL; } if (bitmap->surface != NULL) { BYTE *surface_scan0 = cairo_image_surface_get_data (bitmap->surface); if (surface_scan0 != bitmap->active_bitmap->scan0) { gdip_bitmap_get_premultiplied_scan0_inplace (bitmap, surface_scan0); } } src_data->reserved &= ~GBD_LOCKED; dest_data->reserved &= ~GBD_LOCKED; return status; } GpStatus WINGDIPAPI GdipBitmapSetPixel (GpBitmap *bitmap, INT x, INT y, ARGB color) { BYTE *v; ActiveBitmapData *data; PixelFormat pixel_format; if (!bitmap || !bitmap->active_bitmap) return InvalidParameter; data = bitmap->active_bitmap; if (x < 0 || y < 0 || x >= data->width || y >= data->height || data->reserved & GBD_LOCKED) { return InvalidParameter; } if (gdip_is_an_indexed_pixelformat (data->pixel_format)) return InvalidParameter; if (bitmap->surface != NULL && gdip_bitmap_format_needs_premultiplication(bitmap)) { v = (BYTE*)(cairo_image_surface_get_data (bitmap->surface)) + y * data->stride; pixel_format = PixelFormat32bppPARGB; } else { v = (BYTE*)(data->scan0) + y * data->stride; pixel_format = data->pixel_format; } switch (pixel_format) { case PixelFormat24bppRGB: case PixelFormat32bppRGB: color |= 0xFF000000; /* force the alpha for Cairo */ /* fall through */ case PixelFormat32bppARGB: { ARGB *scan = (ARGB *)v; scan[x] = color; break; } case PixelFormat32bppPARGB: { BYTE r, g, b, a; get_pixel_bgra (color, b, g, r, a); if (a < 0xff) { b = pre_multiplied_table [b][a]; g = pre_multiplied_table [g][a]; r = pre_multiplied_table [r][a]; set_pixel_bgra(v, x * 4, b, g, r, a); } else { ARGB *scan = (ARGB *)v; scan[x] = color; } break; } case PixelFormat16bppGrayScale: return InvalidParameter; default: return NotImplemented; } return Ok; } GpStatus WINGDIPAPI GdipBitmapGetPixel (GpBitmap *bitmap, INT x, INT y, ARGB *color) { ActiveBitmapData *data; if (!bitmap || !bitmap->active_bitmap || !color) return InvalidParameter; data = bitmap->active_bitmap; if (x < 0 || y < 0 || x >= data->width || y >= data->height || data->reserved & GBD_LOCKED) return InvalidParameter; if (gdip_is_an_indexed_pixelformat (data->pixel_format)) { StreamingState pixel_stream; GpStatus status; unsigned int palette_index; if (!data->palette) return InvalidParameter; status = gdip_init_pixel_stream (&pixel_stream, data, x, y, 1, 1); if (status != Ok) return status; palette_index = gdip_pixel_stream_get_next (&pixel_stream); if (palette_index >= data->palette->Count) { *color = 0xFF000000; } else { *color = data->palette->Entries[palette_index]; } } else { if (data->reserved & GBD_LOCKED) return WrongState; if (x < 0 || x >= data->width || y < 0 || y >= data->height) return InvalidParameter; BYTE *v; PixelFormat pixel_format; if (bitmap->surface != NULL && gdip_bitmap_format_needs_premultiplication(bitmap)) { v = (BYTE*)(cairo_image_surface_get_data (bitmap->surface)) + y * data->stride; pixel_format = PixelFormat32bppPARGB; } else { v = (BYTE*)(data->scan0) + y * data->stride; pixel_format = data->pixel_format; } switch (pixel_format) { case PixelFormat16bppGrayScale: return InvalidParameter; case PixelFormat32bppARGB: { ARGB *scan = (ARGB *)v; *color = scan[x]; break; } case PixelFormat32bppPARGB: { ARGB *scan = (ARGB *)v; BYTE r, g, b, a; get_pixel_bgra (scan[x], b, g, r, a); if (a < 0xff) { b = pre_multiplied_table_reverse [b][a]; g = pre_multiplied_table_reverse [g][a]; r = pre_multiplied_table_reverse [r][a]; set_pixel_bgra(color, 0, b, g, r, a); } else { *color = scan[x]; } break; } case PixelFormat24bppRGB: case PixelFormat32bppRGB: { ARGB *scan = (ARGB *)v; *color = scan[x] | 0xFF000000; break; } case PixelFormat16bppARGB1555: case PixelFormat16bppRGB555: *color = gdip_getpixel_16bppRGB555 (v, x); break; case PixelFormat16bppRGB565: *color = gdip_getpixel_16bppRGB565 (v, x); break; default: return NotImplemented; } } return Ok; } GpStatus WINGDIPAPI GdipBitmapSetResolution (GpBitmap *bitmap, REAL xdpi, REAL ydpi) { if (!bitmap || !bitmap->active_bitmap || isnan(xdpi) || isnan(xdpi) || (xdpi <= 0.0f) || (ydpi <= 0.0f)) return InvalidParameter; bitmap->active_bitmap->dpi_horz = xdpi; bitmap->active_bitmap->dpi_vert = ydpi; bitmap->active_bitmap->image_flags |= ImageFlagsHasRealDPI; return Ok; } cairo_surface_t * gdip_bitmap_ensure_surface (GpBitmap *bitmap) { cairo_format_t format; ActiveBitmapData *data = bitmap->active_bitmap; if (bitmap->surface || !data || !data->scan0) return bitmap->surface; switch (data->pixel_format) { case PixelFormat24bppRGB: format = CAIRO_FORMAT_RGB24; break; case PixelFormat32bppARGB: /* premultiplication is required */ case PixelFormat32bppRGB: /* no alpha */ case PixelFormat32bppPARGB: /* alpha already premultiplied */ format = CAIRO_FORMAT_ARGB32; break; default: g_warning ("gdip_bitmap_ensure_surface: Unable to create a surface for raw bitmap data of format 0x%08x", data->pixel_format); return NULL; } if (gdip_bitmap_format_needs_premultiplication (bitmap)) { BYTE *premul = gdip_bitmap_get_premultiplied_scan0 (bitmap); if (!premul) return NULL; bitmap->surface = cairo_image_surface_create_for_data (premul, CAIRO_FORMAT_ARGB32, data->width, data->height, data->stride); } else { bitmap->surface = cairo_image_surface_create_for_data ((BYTE*)data->scan0, format, data->width, data->height, data->stride); } return bitmap->surface; } void gdip_bitmap_flush_surface (GpBitmap *bitmap) { if (bitmap->surface != NULL) { BYTE *surface_scan0 = cairo_image_surface_get_data (bitmap->surface); if (surface_scan0 != bitmap->active_bitmap->scan0) { // The surface had to be premultiplied, we need to reverse the transition gdip_bitmap_get_premultiplied_scan0_reverse (bitmap, surface_scan0); } } } void gdip_bitmap_invalidate_surface (GpBitmap *bitmap) { if (bitmap->surface != NULL) { BYTE *surface_scan0 = cairo_image_surface_get_data (bitmap->surface); gdip_bitmap_flush_surface (bitmap); cairo_surface_destroy (bitmap->surface); bitmap->surface = NULL; if (surface_scan0 != bitmap->active_bitmap->scan0) { GdipFree (surface_scan0); } } } BOOL gdip_bitmap_format_needs_premultiplication (GpBitmap *bitmap) { return (bitmap->active_bitmap->pixel_format == PixelFormat32bppARGB); } static void gdip_bitmap_get_premultiplied_scan0_internal (GpBitmap *bitmap, BYTE *src, BYTE *dest, const BYTE pre_multiplied_table[256][256]) { ActiveBitmapData *data = bitmap->active_bitmap; BYTE *source = src; BYTE *target = dest; int y, x; for (y = 0; y < data->height; y++) { ARGB *sp = (ARGB*) source; ARGB *tp = (ARGB*) target; for (x = 0; x < data->width; x++) { BYTE r, g, b, a; get_pixel_bgra (*sp, b, g, r, a); if (a < 0xff) { b = pre_multiplied_table [b][a]; g = pre_multiplied_table [g][a]; r = pre_multiplied_table [r][a]; set_pixel_bgra (tp, 0, b, g, r, a); } else { *tp = *sp; } sp++; tp++; } source += data->stride; target += data->stride; } } BYTE* gdip_bitmap_get_premultiplied_scan0 (GpBitmap *bitmap) { ActiveBitmapData *data = bitmap->active_bitmap; unsigned long long int size = (unsigned long long int)data->height * data->stride; if (size > G_MAXINT32) return NULL; BYTE* premul = (BYTE*) GdipAlloc (size); if (!premul) return NULL; gdip_bitmap_get_premultiplied_scan0_internal (bitmap, (BYTE*)data->scan0, premul, pre_multiplied_table); return premul; } void gdip_bitmap_get_premultiplied_scan0_inplace (GpBitmap *bitmap, BYTE *premul) { gdip_bitmap_get_premultiplied_scan0_internal (bitmap, (BYTE*)bitmap->active_bitmap->scan0, premul, pre_multiplied_table); } void gdip_bitmap_get_premultiplied_scan0_reverse (GpBitmap *bitmap, BYTE *premul) { gdip_bitmap_get_premultiplied_scan0_internal (bitmap, premul, (BYTE*)bitmap->active_bitmap->scan0, pre_multiplied_table_reverse); } GpBitmap * gdip_convert_indexed_to_rgb (GpBitmap *indexed_bmp) { ActiveBitmapData *data; ColorPalette *palette; int rgb_stride; int rgb_bytes; int force_alpha; int one_pixel_mask; int one_pixel_shift; int pixels_per_byte; ARGB *rgb_scan0; int p; int x; int y; GpBitmap *ret; GpStatus status; BYTE *indexed_scan; ARGB *rgb_scan; int pixels_this_byte; unsigned short sample; int index; int format; data = indexed_bmp->active_bitmap; if (data == NULL) { return NULL; } palette = data->palette; if (palette == NULL || !gdip_is_an_indexed_pixelformat (data->pixel_format)) { return NULL; } switch (data->pixel_format) { case PixelFormat1bppIndexed: one_pixel_mask = 0x01; one_pixel_shift = 1; pixels_per_byte = 8; break; case PixelFormat4bppIndexed: one_pixel_mask = 0x0F; one_pixel_shift = 4; pixels_per_byte = 2; break; case PixelFormat8bppIndexed: one_pixel_mask = 0xFF; one_pixel_shift = 8; pixels_per_byte = 1; break; default: /* something is wrong!! */ return NULL; } if ((palette->Flags & PaletteFlagsHasAlpha) == 0) { format = PixelFormat32bppRGB; set_pixel_bgra (&force_alpha, 0, 0, 0, 0, 0xFF); /* full alpha bits set */ } else { format = PixelFormat32bppARGB; force_alpha = 0; } rgb_stride = data->width * sizeof (ARGB); /* ensure 32bits alignment */ gdip_align_stride (rgb_stride); rgb_bytes = data->height * rgb_stride; /* allocate the RGB frame */ rgb_scan0 = GdipAlloc (rgb_bytes); if (rgb_scan0 == NULL) { /* out of memory?? */ return NULL; } /* convert the indexed pixels into RGB values and store them into the RGB frame */ for (y=0; y < data->height; y++) { indexed_scan = (BYTE*)(data->scan0) + y * data->stride; rgb_scan = rgb_scan0 + (y * data->width); /* Speed up the 8bpp case */ if (pixels_per_byte == 1) { for (x = 0; x < data->width; x++) { index = *indexed_scan++; rgb_scan [x] = palette->Entries [index] | force_alpha; } continue; } /* For 4bpp and 1bpp */ for (x=0; x < data->width; x += pixels_per_byte) { pixels_this_byte = pixels_per_byte; sample = *indexed_scan; indexed_scan++; if (x + pixels_this_byte >= data->width) { pixels_this_byte = data->width - x; } for (p=0; p < pixels_this_byte; p++) { sample <<= one_pixel_shift; index = (sample >> 8) & one_pixel_mask; rgb_scan[x + p] = palette->Entries[index] | force_alpha; } } } /* try to get a GpBitmap out of it :-) */ status = GdipCreateBitmapFromScan0 (data->width, data->height, rgb_stride, format, (BYTE*)rgb_scan0, &ret); if (status == Ok) { ret->active_bitmap->reserved = GBD_OWN_SCAN0; return ret; } if (ret != NULL) { gdip_bitmap_dispose(ret); } if (rgb_scan0 != NULL) { GdipFree (rgb_scan0); } return NULL; } ColorPalette* gdip_create_greyscale_palette (int num_colors) { ColorPalette *palette; int i; if ((num_colors < 0) || (num_colors > 256)) return NULL; /* ColorPalette definition already include 1 ARGB member */ palette = GdipAlloc (sizeof(ColorPalette) + (num_colors - 1) * sizeof(ARGB)); if (!palette) return NULL; palette->Count = num_colors; palette->Flags = 0; /* not every codec sets the ImageFlagsColorSpaceGRAY flag*/ /* always force alpha to opaque */ if (num_colors == 256) { for (i = 0; i < 256; i++) set_pixel_bgra (&palette->Entries[i], 0, i, i, i, 0xFF); } else { for (i = 0; i < num_colors; i++) { int intensity = i * 255 / (num_colors - 1); set_pixel_bgra (&palette->Entries[i], 0, intensity, intensity, intensity, 0xFF); } } return palette; } libgdiplus-6.0.4+dfsg/src/graphics-path.h0000644000175000017500000001716413542674535021037 0ustar directhexdirecthex/* * graphics-path.h * * 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. * * Authors: * Duncan Mak (duncan@ximian.com) * Ravindra (rkumar@novell.com) * Sebastien Pouliot * * Copyright (C) 2003, 2006-2007 Novell, Inc (http://www.novell.com) */ #ifndef __GRAPHICS_PATH_H__ #define __GRAPHICS_PATH_H__ GpStatus WINGDIPAPI GdipCreatePath (GpFillMode brushMode, GpPath **path); GpStatus WINGDIPAPI GdipCreatePath2 (GDIPCONST GpPointF *points, GDIPCONST BYTE *types, INT count, GpFillMode fillMode, GpPath **path); GpStatus WINGDIPAPI GdipCreatePath2I (GDIPCONST GpPoint *points, GDIPCONST BYTE *types, INT count, GpFillMode fillMode, GpPath **path); GpStatus WINGDIPAPI GdipClonePath (GpPath *path, GpPath **clonePath); GpStatus WINGDIPAPI GdipDeletePath (GpPath *path); GpStatus WINGDIPAPI GdipResetPath (GpPath *path); GpStatus WINGDIPAPI GdipGetPointCount (GpPath *path, INT *count); GpStatus WINGDIPAPI GdipGetPathTypes (GpPath *path, BYTE *types, INT count); GpStatus WINGDIPAPI GdipGetPathPoints (GpPath *path, GpPointF *points, INT count); GpStatus WINGDIPAPI GdipGetPathPointsI (GpPath *path, GpPoint *points, INT count); GpStatus WINGDIPAPI GdipGetPathData (GpPath *path, GpPathData *pathData); GpStatus WINGDIPAPI GdipGetPathFillMode (GpPath *path, GpFillMode *fillmode); GpStatus WINGDIPAPI GdipSetPathFillMode (GpPath *path, GpFillMode fillmode); GpStatus WINGDIPAPI GdipStartPathFigure (GpPath *path); GpStatus WINGDIPAPI GdipClosePathFigure (GpPath *path); GpStatus WINGDIPAPI GdipClosePathFigures (GpPath *path); GpStatus WINGDIPAPI GdipSetPathMarker (GpPath *path); GpStatus WINGDIPAPI GdipClearPathMarkers (GpPath *path); GpStatus WINGDIPAPI GdipReversePath (GpPath *path); GpStatus WINGDIPAPI GdipGetPathLastPoint (GpPath *path, GpPointF *lastPoint); GpStatus WINGDIPAPI GdipAddPathLine (GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2); GpStatus WINGDIPAPI GdipAddPathLine2 (GpPath *path, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipAddPathArc (GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipAddPathBezier (GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4); GpStatus WINGDIPAPI GdipAddPathBeziers (GpPath *path, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipAddPathCurve (GpPath *path, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipAddPathCurve2 (GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipAddPathCurve3 (GpPath *path, GDIPCONST GpPointF *points, INT count, INT offset, INT numberOfSegments, REAL tension); GpStatus WINGDIPAPI GdipAddPathClosedCurve (GpPath *path, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipAddPathClosedCurve2 (GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipAddPathRectangle (GpPath *path, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipAddPathRectangles (GpPath *path, GDIPCONST GpRectF *rects, INT count); GpStatus WINGDIPAPI GdipAddPathEllipse (GpPath *path, REAL x, REAL y, REAL width, REAL height); GpStatus WINGDIPAPI GdipAddPathPie (GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipAddPathPolygon (GpPath *path, GDIPCONST GpPointF *points, INT count); GpStatus WINGDIPAPI GdipAddPathPath (GpPath *path, GDIPCONST GpPath *addingPath, BOOL connect); GpStatus WINGDIPAPI GdipAddPathString (GpPath *path, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFontFamily *family, INT style, REAL emSize, GDIPCONST GpRectF *layoutRect, GDIPCONST GpStringFormat *format); GpStatus WINGDIPAPI GdipAddPathLineI (GpPath *path, INT x1, INT y1, INT x2, INT y2); GpStatus WINGDIPAPI GdipAddPathLine2I (GpPath *path, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipAddPathArcI (GpPath *path, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipAddPathBezierI (GpPath *path, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4); GpStatus WINGDIPAPI GdipAddPathBeziersI (GpPath *path, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipAddPathCurveI (GpPath *path, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipAddPathCurve2I (GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipAddPathCurve3I (GpPath *path, GDIPCONST GpPoint *points, INT count, INT offset, INT numberOfSegments, REAL tension); GpStatus WINGDIPAPI GdipAddPathClosedCurveI (GpPath *path, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipAddPathClosedCurve2I (GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension); GpStatus WINGDIPAPI GdipAddPathRectangleI (GpPath *path, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipAddPathRectanglesI (GpPath *path, GDIPCONST GpRect *rects, INT count); GpStatus WINGDIPAPI GdipAddPathEllipseI (GpPath *path, INT x, INT y, INT width, INT height); GpStatus WINGDIPAPI GdipAddPathPieI (GpPath *path, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle); GpStatus WINGDIPAPI GdipAddPathPolygonI (GpPath *path, GDIPCONST GpPoint *points, INT count); GpStatus WINGDIPAPI GdipAddPathStringI (GpPath *path, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFontFamily *family, INT style, REAL emSize, GDIPCONST GpRect *layoutRect, GDIPCONST GpStringFormat *format); GpStatus WINGDIPAPI GdipFlattenPath (GpPath *path, GpMatrix *matrix, REAL flatness); GpStatus WINGDIPAPI GdipWindingModeOutline (GpPath *path, GpMatrix *matrix, REAL flatness); GpStatus WINGDIPAPI GdipWidenPath (GpPath *nativePath, GpPen *pen, GpMatrix *matrix, REAL flatness); GpStatus WINGDIPAPI GdipWarpPath (GpPath *nativePath, GpMatrix *matrix, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, WarpMode warpMode, REAL flatness); GpStatus WINGDIPAPI GdipTransformPath (GpPath* path, GpMatrix *matrix); GpStatus WINGDIPAPI GdipGetPathWorldBounds (GpPath *path, GpRectF *bounds, GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen); GpStatus WINGDIPAPI GdipGetPathWorldBoundsI (GpPath *path, GpRect *bounds, GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen); GpStatus WINGDIPAPI GdipIsVisiblePathPoint (GpPath *path, REAL x, REAL y, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsVisiblePathPointI (GpPath *path, INT x, INT y, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint (GpPath *path, REAL x, REAL y, GpPen *pen, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI (GpPath *path, INT x, INT y, GpPen *pen, GpGraphics *graphics, BOOL *result); #endif libgdiplus-6.0.4+dfsg/src/stringformat-private.h0000644000175000017500000000425213542674535022466 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __STRINGFORMAT_PRIVATE_H__ #define __STRINGFORMAT_PRIVATE_H__ #include "gdiplus-private.h" struct _StringFormat { StringAlignment alignment; StringAlignment lineAlignment; HotkeyPrefix hotkeyPrefix; StringFormatFlags formatFlags; StringTrimming trimming; StringDigitSubstitute substitute; LANGID language; CharacterRange *charRanges; float firstTabOffset; float *tabStops; int numtabStops; int charRangeCount; }; void gdip_create_generic_stringformats () GDIP_INTERNAL; void gdip_delete_generic_stringformats () GDIP_INTERNAL; #include "stringformat.h" #endif libgdiplus-6.0.4+dfsg/src/pngcodec.h0000644000175000017500000000212613542672033020046 0ustar directhexdirecthex/* * pngcodec.h : Contains function declarations for encoding decoding png images * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * * Copyright (C) 2003-2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef _PNGCODEC_H #define _PNGCODEC_H #include "bitmap-private.h" #include "bmpcodec.h" GpStatus gdip_load_png_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_png_image_from_stream_delegate (GetBytesDelegate getBytesFunc, SeekDelegate seeknFunc, GpImage **image) GDIP_INTERNAL; GpStatus gdip_save_png_image_to_file (FILE *fp, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; GpStatus gdip_save_png_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; ImageCodecInfo *gdip_getcodecinfo_png () GDIP_INTERNAL; GpStatus gdip_fill_encoder_parameter_list_png (EncoderParameters *buffer, UINT size) GDIP_INTERNAL; typedef struct { UINT count; EncoderParameter imageItems; } PngEncoderParameters; #endif /* _PNGCODEC_H */ libgdiplus-6.0.4+dfsg/src/emfcodec.h0000644000175000017500000000424713542674535020050 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __EMFCODEC_H__ #define __EMFCODEC_H__ #include "gdiplus-private.h" #include "metafile-private.h" #include "graphics-private.h" /* * Some interesting links... * http://wvware.sourceforge.net/caolan/ora-wmf.html * http://www.undocprint.org/formats/winspool/emf */ #define EMF_MIN_RECORD_SIZE 8 #define EMF_CHECK_PARAMS(x) do { \ if (params < (x)) goto cleanup; \ } while (0) #define EMF_FUNCTION 0 #define EMF_RECORDSIZE 4 #define DWP1 8 #define DWP2 12 #define DWP3 16 #define DWP4 20 #define DWP5 24 #define DWP6 28 #define DWP7 32 #define DWP8 36 #define DWP9 40 #define DWP10 44 #define DWP11 48 #define DWP(y) (8 + ((y) << 2)) #define gdip_read_emf_data gdip_read_bmp_data GpStatus gdip_load_emf_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_emf_image_from_stream_delegate (dstream_t *loader, GpImage **image) GDIP_INTERNAL; /* no save functions as the EMF "codec" is a decoder only */ ImageCodecInfo* gdip_getcodecinfo_emf () GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/imageattributes.c0000644000175000017500000005543613545154626021472 0ustar directhexdirecthex/* * Copyright (c) 2004-2005 Ximian * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Jordi Mas i Hernandez , 2004-2005 * Sebastien Pouliot * Frederik Carlier * */ #include "imageattributes-private.h" #include "bitmap-private.h" #include "general-private.h" static void gdip_init_image_attribute (GpImageAttribute* attr) { attr->flags = 0; attr->colormap = NULL; attr->colormap_elem = 0; attr->gamma_correction = 0.0f; attr->key_colorlow = 0; attr->key_colorhigh = 0; attr->colormatrix = NULL; attr->graymatrix = NULL; attr->colormatrix_flags = ColorMatrixFlagsDefault; attr->threshold = 0; attr->outputchannel_flags = 0; attr->colorprofile_filename = NULL; } static void gdip_dispose_image_attribute (GpImageAttribute* attr) { if (attr->colormap) { GdipFree (attr->colormap); attr->colormap = NULL; } if (attr->colormatrix) { GdipFree (attr->colormatrix); attr->colormatrix = NULL; } if (attr->graymatrix) { GdipFree (attr->graymatrix); attr->graymatrix = NULL; } if (attr->colorprofile_filename) { GdipFree (attr->colorprofile_filename); attr->colorprofile_filename = NULL; } } static GpStatus gdip_clone_image_attribute(const GpImageAttribute* attr, GpImageAttribute* clone) { if (attr->colormap && attr->colormap_elem > 0) { clone->colormap = GdipAlloc(sizeof(ColorMap) * attr->colormap_elem); if (!clone->colormap) { gdip_dispose_image_attribute(clone); return OutOfMemory; } memcpy(clone->colormap, attr->colormap, sizeof(ColorMap) * attr->colormap_elem); } if (attr->colormatrix) { clone->colormatrix = GdipAlloc(sizeof(ColorMatrix)); if (!clone->colormatrix) { gdip_dispose_image_attribute(clone); return OutOfMemory; } memcpy(clone->colormatrix, attr->colormatrix, sizeof(ColorMatrix)); } if (attr->graymatrix) { clone->graymatrix = GdipAlloc(sizeof(ColorMatrix)); if (!clone->graymatrix) { gdip_dispose_image_attribute(clone); return OutOfMemory; } memcpy(clone->graymatrix, attr->graymatrix, sizeof(ColorMatrix)); } if (attr->colorprofile_filename) { clone->colorprofile_filename = strdup (attr->colorprofile_filename); if (!clone->colorprofile_filename) { gdip_dispose_image_attribute(clone); return OutOfMemory; } } return Ok; } static GpImageAttribute* gdip_get_image_attribute (GpImageAttributes* attr, ColorAdjustType type) { switch (type) { case ColorAdjustTypeDefault: return &attr->def; case ColorAdjustTypeBitmap: return &attr->bitmap; case ColorAdjustTypeBrush: return &attr->brush; case ColorAdjustTypePen: return &attr->pen; case ColorAdjustTypeText: return &attr->text; default: return NULL; } } GpStatus gdip_process_bitmap_attributes (GpBitmap *bitmap, void **dest, GpImageAttributes* attr, BOOL *allocated) { GpStatus status; GpImageAttribute *imgattr, *def; GpImageAttribute *colormap, *gamma, *trans, *cmatrix, *treshold, *cmyk; GpBitmap *bmpdest; ARGB color; BYTE *color_p = (BYTE*) &color; *allocated = FALSE; bmpdest = NULL; if (!bitmap || !dest || !attr) return Ok; imgattr = gdip_get_image_attribute (attr, ColorAdjustTypeBitmap); def = gdip_get_image_attribute (attr, ColorAdjustTypeDefault); if (imgattr->flags & ImageAttributeFlagsColorRemapTableEnabled) { colormap = imgattr; } else { colormap = def; } if (imgattr->flags & ImageAttributeFlagsGammaEnabled) { gamma = imgattr; } else { gamma = def; } if (imgattr->flags & ImageAttributeFlagsThresholdEnabled) { treshold = imgattr; } else { treshold = def; } if (imgattr->flags & ImageAttributeFlagsColorKeysEnabled) { trans = imgattr; } else { trans = def; } if (imgattr->flags & ImageAttributeFlagsColorMatrixEnabled && imgattr->colormatrix) { cmatrix = imgattr; } else { cmatrix = def; } if (imgattr->flags & ImageAttributeFlagsOutputChannelEnabled) { cmyk = imgattr; } else { cmyk = def; } if ((!(colormap->flags & ImageAttributeFlagsNoOp) && (colormap->flags & ImageAttributeFlagsColorRemapTableEnabled)) || (!(gamma->flags & ImageAttributeFlagsNoOp) && (gamma->flags & ImageAttributeFlagsGammaEnabled)) || (!(trans->flags & ImageAttributeFlagsNoOp) && (trans->flags & ImageAttributeFlagsColorKeysEnabled)) || (!(cmatrix->flags & ImageAttributeFlagsNoOp) && (cmatrix->flags & ImageAttributeFlagsColorMatrixEnabled) && cmatrix->colormatrix != NULL) || (!(treshold->flags & ImageAttributeFlagsNoOp) && (treshold->flags & ImageAttributeFlagsThresholdEnabled)) || (!(cmyk->flags & ImageAttributeFlagsNoOp) && (cmyk->flags & ImageAttributeFlagsOutputChannelEnabled))) { bmpdest = gdip_bitmap_new_with_frame (NULL, FALSE); if (!bmpdest) return OutOfMemory; gdip_bitmap_flush_surface (bitmap); status = gdip_bitmapdata_clone (bitmap->active_bitmap, &bmpdest->frames[0].bitmap, 1); if (status != Ok) { gdip_bitmap_dispose (bmpdest); return OutOfMemory; } bmpdest->frames[0].count = 1; gdip_bitmap_setactive (bmpdest, NULL, 0); *dest = bmpdest->active_bitmap->scan0; *allocated = TRUE; } /* We use get/set pixel instead of direct buffer manipulation because it's a good way of keeping the pixel logic in a single place */ /* Color mapping */ if (!(colormap->flags & ImageAttributeFlagsNoOp) && colormap->flags & ImageAttributeFlagsColorRemapTableEnabled) { for (int y = 0; y active_bitmap->height; y++) { for (int x = 0; x active_bitmap->width; x++) { ColorMap* clrmap = colormap->colormap; GdipBitmapGetPixel (bmpdest, x, y, &color); for (int cnt = 0; cnt < colormap->colormap_elem; cnt++, clrmap++) { if (color == clrmap->oldColor.Argb) { color = clrmap->newColor.Argb; GdipBitmapSetPixel (bmpdest, x, y, color); break; } } } } } /* Gamma correction */ if (!(gamma->flags & ImageAttributeFlagsNoOp) && gamma->flags & ImageAttributeFlagsGammaEnabled) { for (int y = 0; y < bitmap->active_bitmap->height; y++) { for (int x = 0; x < bitmap->active_bitmap->width; x++) { BYTE r,g,b,a; GdipBitmapGetPixel (bmpdest, x, y, &color); a = (color & 0xff000000) >> 24; r = (color & 0x00ff0000) >> 16; g = (color & 0x0000ff00) >> 8; b = (color & 0x000000ff); r = (int) roundf(powf(r / 255.0, gamma->gamma_correction) * 255.0); g = (int) roundf(powf(g / 255.0, gamma->gamma_correction) * 255.0); b = (int) roundf(powf(b / 255.0, gamma->gamma_correction) * 255.0); color = ((guint32)a << 24) | (r << 16) | (g << 8) | b; GdipBitmapSetPixel (bmpdest, x, y, color); } } } /* Treshold correction */ if (!(treshold->flags & ImageAttributeFlagsNoOp) && treshold->flags & ImageAttributeFlagsThresholdEnabled) { BYTE cutoff = (BYTE)round(treshold->threshold * 255.0); for (int y = 0; y < bitmap->active_bitmap->height; y++) { for (int x = 0; x < bitmap->active_bitmap->width; x++) { BYTE r, g, b, a; GdipBitmapGetPixel(bmpdest, x, y, &color); a = (color & 0xff000000) >> 24; r = (color & 0x00ff0000) >> 16; g = (color & 0x0000ff00) >> 8; b = (color & 0x000000ff); r = r > cutoff ? 255 : 0; g = g > cutoff ? 255 : 0; b = b > cutoff ? 255 : 0; color = ((guint32)a << 24) | (r << 16) | (g << 8) | b; GdipBitmapSetPixel(bmpdest, x, y, color); } } } /* CMYK calculation */ if (!(cmyk->flags & ImageAttributeFlagsNoOp) && cmyk->flags & ImageAttributeFlagsOutputChannelEnabled) { for (int y = 0; y < bitmap->active_bitmap->height; y++) { for (int x = 0; x < bitmap->active_bitmap->width; x++) { BYTE r, g, b, a, C, M, Y, K; GdipBitmapGetPixel(bmpdest, x, y, &color); a = (color & 0xff000000) >> 24; r = (color & 0x00ff0000) >> 16; g = (color & 0x0000ff00) >> 8; b = (color & 0x000000ff); C = 255 - r; M = 255 - g; Y = 255 - b; K = min(min(C, M), Y); /* correct complementary color lever based on k */ C -= K; M -= K; Y -= K; switch (cmyk->outputchannel_flags) { case ColorChannelFlagsC: r = g = b = C; break; case ColorChannelFlagsM: r = g = b = M; break; case ColorChannelFlagsY: r = g = b = Y; break; case ColorChannelFlagsK: r = g = b = K; break; default: return InvalidParameter; } color = ((guint32)a << 24) | (r << 16) | (g << 8) | b; GdipBitmapSetPixel(bmpdest, x, y, color); } } } /* Apply transparency range */ /* FIXME: This will convert pixels which have a color in [key_colorlow, key_colorhey] to transparent pixels. However, GdipDrawImageRectRect in image.c uses cairo_fill to draw these transparent pixels onto the target surface. This method will not copy the transparency value; rather, it will ignore transparent values. */ if (!(trans->flags & ImageAttributeFlagsNoOp) && trans->flags & ImageAttributeFlagsColorKeysEnabled) { for (int y = 0; y < bitmap->active_bitmap->height; y++) { for (int x = 0; x < bitmap->active_bitmap->width; x++) { GdipBitmapGetPixel (bmpdest, x, y, &color); color &= ~ALPHA_MASK; if (color >= trans->key_colorlow && color <= trans->key_colorhigh) { GdipBitmapSetPixel (bmpdest, x, y, 0x00FFFFFF /* transparent white */); } } } } /* Apply Color Matrix */ if (!(cmatrix->flags & ImageAttributeFlagsNoOp) && cmatrix->flags & ImageAttributeFlagsColorMatrixEnabled && cmatrix->colormatrix) { ActiveBitmapData *data = bmpdest->active_bitmap; BYTE *v = ((BYTE*)data->scan0); ARGB *scan; ColorMatrixFlags flags = cmatrix->colormatrix_flags; ColorMatrix *cm; BOOL bmpdest_is_premultiplied = !gdip_bitmap_format_needs_premultiplication (bmpdest); for (int y = 0; y < data->height; y++) { scan = (ARGB*) v; for (int x = 0; x < data->width; x++) { BYTE r,g,b,a; int r_new,g_new,b_new,a_new; get_pixel_bgra (*scan, b, g, r, a); /* by default the matrix applies to all colors, including grays */ if ((flags != ColorMatrixFlagsDefault) && (b == g) && (b == r)) { if (flags == ColorMatrixFlagsSkipGrays) { /* does not apply */ scan++; continue; } /* ColorMatrixFlagsAltGray */ cm = cmatrix->graymatrix; } else { cm = cmatrix->colormatrix; } a_new = (r * cm->m[0][3] + g * cm->m[1][3] + b * cm->m[2][3] + a * cm->m[3][3] + (255 * cm->m[4][3])); if (a_new == 0 && bmpdest_is_premultiplied) { /* 100% transparency, don't waste time computing other values (pre-mul will always be 0) */ *scan++ = 0; } else { r_new = (r * cm->m[0][0] + g * cm->m[1][0] + b * cm->m[2][0] + a * cm->m[3][0] + (255 * cm->m[4][0])); g_new = (r * cm->m[0][1] + g * cm->m[1][1] + b * cm->m[2][1] + a * cm->m[3][1] + (255 * cm->m[4][1])); b_new = (r * cm->m[0][2] + g * cm->m[1][2] + b * cm->m[2][2] + a * cm->m[3][2] + (255 * cm->m[4][2])); if (bmpdest_is_premultiplied && a != (BYTE) a_new && a < 0xff && a != 0) { /* reverse previous pre-multiplication if necessary */ r_new = r_new * 255 / a; g_new = g_new * 255 / a; b_new = b_new * 255 / a; } r = (r_new > 0xff) ? 0xff : (BYTE) r_new; g = (g_new > 0xff) ? 0xff : (BYTE) g_new; b = (b_new > 0xff) ? 0xff : (BYTE) b_new; /* remember that Cairo use pre-multiplied alpha, e.g. 50% red == 0x80800000 not 0x80ff0000 */ if (bmpdest_is_premultiplied && a != (BYTE) a_new && a_new < 0xff) { /* apply new pre-multiplication */ a = (BYTE) a_new; r = pre_multiplied_table [r][a]; g = pre_multiplied_table [g][a]; b = pre_multiplied_table [b][a]; } else { a = (BYTE) a_new; } set_pixel_bgra (color_p, 0, b, g, r, a); *scan++ = color; } } v += data->stride; } } if (bmpdest != NULL) { bmpdest->active_bitmap->scan0 = NULL; gdip_bitmap_dispose (bmpdest); } return Ok; } /* coverity[+alloc : arg-*0] */ GpStatus WINGDIPAPI GdipCreateImageAttributes (GpImageAttributes **imageattr) { GpImageAttributes *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!imageattr) return InvalidParameter; result = (GpImageAttributes *) GdipAlloc (sizeof (GpImageAttributes)); if (!result) { *imageattr = NULL; return OutOfMemory; } gdip_init_image_attribute (&result->def); gdip_init_image_attribute (&result->bitmap); gdip_init_image_attribute (&result->brush); gdip_init_image_attribute (&result->pen); gdip_init_image_attribute (&result->text); result->color = 0x00000000; result->wrapmode = WrapModeClamp; *imageattr = result; return Ok; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipCloneImageAttributes (GDIPCONST GpImageAttributes *imageattr, GpImageAttributes **cloneImageattr) { GpImageAttributes *result; if (!imageattr || !cloneImageattr) return InvalidParameter; result = (GpImageAttributes *) GdipAlloc (sizeof (GpImageAttributes)); if (!result) { *cloneImageattr = NULL; return OutOfMemory; } memcpy (result, imageattr, sizeof (GpImageAttributes)); GpStatus ret = Ok; ret = gdip_clone_image_attribute(&imageattr->def, &result->def); if (ret) { GdipDisposeImageAttributes(result); return ret; } ret = gdip_clone_image_attribute(&imageattr->bitmap, &result->bitmap); if (ret) { GdipDisposeImageAttributes(result); return ret; } ret = gdip_clone_image_attribute(&imageattr->brush, &result->brush); if (ret) { GdipDisposeImageAttributes(result); return ret; } ret = gdip_clone_image_attribute(&imageattr->pen, &result->pen); if (ret) { GdipDisposeImageAttributes(result); return ret; } ret = gdip_clone_image_attribute(&imageattr->text, &result->text); if (ret) { GdipDisposeImageAttributes(result); return ret; } *cloneImageattr = result; return Ok; } GpStatus WINGDIPAPI GdipDisposeImageAttributes (GpImageAttributes *imageattr) { if (!imageattr) return InvalidParameter; gdip_dispose_image_attribute (&imageattr->def); gdip_dispose_image_attribute (&imageattr->bitmap); gdip_dispose_image_attribute (&imageattr->brush); gdip_dispose_image_attribute (&imageattr->pen); gdip_dispose_image_attribute (&imageattr->text); GdipFree (imageattr); return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity (GpImageAttributes *imageattr, ColorAdjustType type) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; gdip_dispose_image_attribute (imgattr); gdip_init_image_attribute (imgattr); return Ok; } GpStatus WINGDIPAPI GdipResetImageAttributes (GpImageAttributes *imageattr, ColorAdjustType type) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; gdip_dispose_image_attribute (imgattr); gdip_init_image_attribute (imgattr); return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesThreshold ( GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, REAL threshold) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { imgattr->threshold = threshold; imgattr->flags |= ImageAttributeFlagsThresholdEnabled; } else imgattr->flags &= ~ImageAttributeFlagsThresholdEnabled; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesGamma (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, REAL gamma) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { if (gamma <= 0) return InvalidParameter; imgattr->gamma_correction = gamma; imgattr->flags |= ImageAttributeFlagsGammaEnabled; } else imgattr->flags &= ~ImageAttributeFlagsGammaEnabled; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesNoOp (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) imgattr->flags |= ImageAttributeFlagsNoOp; else imgattr->flags &= ~ImageAttributeFlagsNoOp; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { BYTE rLow = (colorLow >> 16) & 0xFF; BYTE gLow = (colorLow >> 8) & 0xFF; BYTE bLow = colorLow & 0xFF; BYTE rHigh = (colorHigh >> 16) & 0xFF; BYTE gHigh = (colorHigh >> 8) & 0xFF; BYTE bHigh = colorHigh & 0xFF; if (rLow > rHigh || gLow > gHigh || bLow > bHigh) return InvalidParameter; imgattr->key_colorlow = colorLow; imgattr->key_colorhigh = colorHigh; imgattr->flags |= ImageAttributeFlagsColorKeysEnabled; } else imgattr->flags &= ~ImageAttributeFlagsColorKeysEnabled; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, GDIPCONST WCHAR *colorProfileFilename) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { if (!colorProfileFilename) return Win32Error; char *utf8 = utf16_to_utf8 (colorProfileFilename, -1); if (!utf8) return OutOfMemory; FILE *fileHandle = fopen (utf8, "rb"); if (!fileHandle) { GdipFree (utf8); return OutOfMemory; } fclose (fileHandle); if (imgattr->colorprofile_filename) GdipFree (imgattr->colorprofile_filename); imgattr->colorprofile_filename = utf8; imgattr->flags |= ImageAttributeFlagsOutputChannelColorProfileEnabled; } else imgattr->flags &= ~ImageAttributeFlagsOutputChannelColorProfileEnabled; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, UINT mapSize, GDIPCONST ColorMap *map) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { if (mapSize == 0 || !map) return InvalidParameter; /* Copy colormap table */ int size = mapSize * sizeof (ColorMap); ColorMap *newColorMap = GdipAlloc (size); if (!newColorMap) return OutOfMemory; if (imgattr->colormap) GdipFree (imgattr->colormap); imgattr->colormap = newColorMap; memcpy (imgattr->colormap, map, size); imgattr->colormap_elem = mapSize; imgattr->flags |= ImageAttributeFlagsColorRemapTableEnabled; } else imgattr->flags &= ~ImageAttributeFlagsColorRemapTableEnabled; return Ok; } /* According to Microsoft documentation: clamp: This parameter has no effect in Microsoft® Windows® GDI+ version 1.0 */ GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode (GpImageAttributes *imageattr, WrapMode wrap, ARGB argb, BOOL clamp) { if (!imageattr) return InvalidParameter; imageattr->wrapmode = wrap; imageattr->color = argb; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesICMMode (GpImageAttributes *imageAttr, BOOL on) { if (!imageAttr) return InvalidParameter; // This has no effect in GDI+. return Ok; } GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette (GpImageAttributes *imageattr, ColorPalette *colorPalette, ColorAdjustType type) { if (!imageattr || !colorPalette || !colorPalette->Count || type == ColorAdjustTypeDefault) return InvalidParameter; if (type >= ColorAdjustTypeCount) return InvalidParameter; return NotImplemented; } GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix, GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { if (!colorMatrix || flags > ColorMatrixFlagsAltGray || flags < ColorMatrixFlagsDefault) { return InvalidParameter; } if (!imgattr->colormatrix) { imgattr->colormatrix = GdipAlloc (sizeof (ColorMatrix)); if (!imgattr->colormatrix) return OutOfMemory; } if (flags == ColorMatrixFlagsAltGray) { if (!grayMatrix) return InvalidParameter; if (!imgattr->graymatrix) { imgattr->graymatrix = GdipAlloc (sizeof (ColorMatrix)); if (!imgattr->graymatrix) return OutOfMemory; } memcpy (imgattr->graymatrix, grayMatrix, sizeof (ColorMatrix)); imgattr->flags |= ImageAttributeFlagsGrayMatrixEnabled; } memcpy (imgattr->colormatrix, colorMatrix, sizeof (ColorMatrix)); imgattr->colormatrix_flags = flags; imgattr->flags |= ImageAttributeFlagsColorMatrixEnabled; } else { imgattr->flags &= ~(ImageAttributeFlagsColorMatrixEnabled | ImageAttributeFlagsGrayMatrixEnabled); } return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags) { GpImageAttribute *imgattr; if (!imageattr) return InvalidParameter; imgattr = gdip_get_image_attribute (imageattr, type); if (!imgattr) return InvalidParameter; if (enableFlag) { if (channelFlags >= ColorChannelFlagsLast) return InvalidParameter; imgattr->outputchannel_flags = channelFlags; imgattr->flags |= ImageAttributeFlagsOutputChannelEnabled; } else imgattr->flags &= ~ImageAttributeFlagsOutputChannelEnabled; return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground (GpImageAttributes *imageattr, BOOL enableFlag) { if (!imageattr) return InvalidParameter; // This has no effect in GDI+. return Ok; } libgdiplus-6.0.4+dfsg/src/graphics-pathiterator-private.h0000644000175000017500000000403712377405421024243 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __GRAPHICS_PATHITERATOR_PRIVATE__ #define __GRAPHICS_PATHITERATOR_PRIVATE__ #include "gdiplus-private.h" struct _PathIterator { GpPath *path; int markerPosition; /* The start position of next marker, index of (marker type) + 1 */ int subpathPosition; /* The start position of next subpath, index of (start type) */ int pathTypePosition; /* The position to get the next path type inside a subpath */ }; #include "graphics-pathiterator.h" #endif libgdiplus-6.0.4+dfsg/src/gifcodec.h0000644000175000017500000000217313542672033020031 0ustar directhexdirecthex/* * gifcodec.h : Contains function declarations for encoding decoding gif images * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * * Copyright (C) 2003-2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef _GIFCODEC_H #define _GIFCODEC_H #include "bitmap-private.h" #include "bmpcodec.h" GpStatus gdip_load_gif_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_gif_image_from_stream_delegate (GetBytesDelegate getBytesFunc, SeekDelegate seekFunc, GpImage **image) GDIP_INTERNAL; GpStatus gdip_save_gif_image_to_file (unsigned char *filename, GpImage *image) GDIP_INTERNAL; GpStatus gdip_save_gif_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; ImageCodecInfo *gdip_getcodecinfo_gif () GDIP_INTERNAL; GpStatus gdip_fill_encoder_parameter_list_gif (EncoderParameters *buffer, UINT size) GDIP_INTERNAL; typedef struct { UINT count; EncoderParameter imageItems; EncoderParameter saveFlag; LONG saveFlagValue; } GifEncoderParameters; #endif /* _GIFCODEC_H */ libgdiplus-6.0.4+dfsg/src/graphics-cairo-private.h0000644000175000017500000001121313542674535022635 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __GRAPHICS_CAIRO_PRIVATE_H__ #define __GRAPHICS_CAIRO_PRIVATE_H__ #include "gdiplus-private.h" #include "brush-private.h" #include "matrix-private.h" /* constant for make_ellipse */ #define C1 0.552285 /* * Handling of pens with a width greater than 1 is not identical between GDI+ and Cairo * * On cairo >= 1.12 pen adjustment is not required or tons of tests senstive to this break. */ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) #define gdip_cairo_pen_width_needs_adjustment(pen) (0) #else #define gdip_cairo_pen_width_needs_adjustment(pen) (((int)(pen->width) & 1) == 0) #endif cairo_fill_rule_t gdip_convert_fill_mode (FillMode fill_mode) GDIP_INTERNAL; GpStatus gdip_plot_path (GpGraphics *graphics, GpPath *path, BOOL antialiasing) GDIP_INTERNAL; GpStatus cairo_DrawArc (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) GDIP_INTERNAL; GpStatus cairo_DrawBeziers (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) GDIP_INTERNAL; GpStatus cairo_DrawClosedCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count, float tension) GDIP_INTERNAL; GpStatus cairo_FillClosedCurve2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, float tension, GpFillMode fillMode) GDIP_INTERNAL; GpStatus cairo_DrawCurve3 (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPointF *points, int count, int offset, int numOfSegments, float tension) GDIP_INTERNAL; GpStatus cairo_DrawEllipse (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height) GDIP_INTERNAL; GpStatus cairo_FillEllipse (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height) GDIP_INTERNAL; GpStatus cairo_DrawLines (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) GDIP_INTERNAL; GpStatus cairo_DrawRectangles (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, int count) GDIP_INTERNAL; GpStatus cairo_FillRectangles (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, int count) GDIP_INTERNAL; GpStatus cairo_DrawPath (GpGraphics *graphics, GpPen *pen, GpPath *path) GDIP_INTERNAL; GpStatus cairo_FillPath (GpGraphics *graphics, GpBrush *brush, GpPath *path) GDIP_INTERNAL; GpStatus cairo_DrawPie (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) GDIP_INTERNAL; GpStatus cairo_FillPie (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height, float startAngle, float sweepAngle) GDIP_INTERNAL; GpStatus cairo_DrawPolygon (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) GDIP_INTERNAL; GpStatus cairo_FillPolygon (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, FillMode fillMode) GDIP_INTERNAL; GpStatus cairo_FillRegion (GpGraphics *graphics, GpBrush *brush, GpRegion *region) GDIP_INTERNAL; GpStatus cairo_GraphicsClear (GpGraphics *graphics, ARGB color) GDIP_INTERNAL; GpStatus cairo_SetCompositingMode (GpGraphics *graphics, CompositingMode compositingMode) GDIP_INTERNAL; GpStatus cairo_SetSmoothingMode (GpGraphics *graphics, SmoothingMode mode) GDIP_INTERNAL; GpStatus cairo_SetGraphicsClip (GpGraphics *graphics) GDIP_INTERNAL; GpStatus cairo_ResetClip (GpGraphics *graphics) GDIP_INTERNAL; GpStatus cairo_ResetWorldTransform (GpGraphics *graphics) GDIP_INTERNAL; GpStatus cairo_SetWorldTransform (GpGraphics *graphics, GpMatrix *matrix) GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/region-bitmap.c0000644000175000017500000007460113542674535021034 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "region-private.h" #include "graphics-path-private.h" #include "graphics-cairo-private.h" // #define DEBUG_REGION #ifdef DEBUG_REGION /* * Debugging helpers */ static void display32 (BYTE *shape, int width, int height) { int i, j; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { printf ("%s", (shape [(i*width + j) * 4] == 0) ? "." : "X"); } printf ("\n"); } printf ("\n"); } void display (char* message, GpRegionBitmap *bitmap) { int i = 0, j = 0, k; printf ("\n%s\n\tbitmap X: %d, Y: %d, Width: %d, Height %d, Mask %p\n", message, bitmap->X, bitmap->Y, bitmap->Width, bitmap->Height, bitmap->Mask); if (!bitmap->Mask) return; while (i < SHAPE_SIZE(bitmap)) { BYTE b = bitmap->Mask [i++]; for (k = 0; k < 8; k++) { if (j++ == bitmap->Width) { j = 1; printf ("\n"); } printf ("%s", ((b & (1 << k)) == 0) ? "." : "X"); } } printf ("\n"); } #endif /* Helpers */ /* * rect_union: * @bitmap1: a GpRegionBitmap * @bitmap2: a GpRegionBitmap * @rect: a pointer to a GpRect * * Calculate a rectangle, @rect, that contains both @bitmap1 and @bitmap2 * rectangles. */ static void rect_union (GpRegionBitmap *bitmap1, GpRegionBitmap *bitmap2, GpRect *rect) { int max_x_1 = bitmap1->X + bitmap1->Width; int max_x_2 = bitmap2->X + bitmap2->Width; int max_y_1 = bitmap1->Y + bitmap1->Height; int max_y_2 = bitmap2->Y + bitmap2->Height; rect->X = (bitmap1->X < bitmap2->X) ? bitmap1->X : bitmap2->X; rect->Y = (bitmap1->Y < bitmap2->Y) ? bitmap1->Y : bitmap2->Y; rect->Width = ((max_x_1 > max_x_2) ? max_x_1 : max_x_2) - rect->X; rect->Height = ((max_y_1 > max_y_2) ? max_y_1 : max_y_2) - rect->Y; } /* * rect_intersect: * @bitmap1: a GpRegionBitmap * @bitmap2: a GpRegionBitmap * @rect: a pointer to a GpRect * * Calculate a rectangle, @rect, that represent the area shared by both * @bitmap1 and @bitmap2 rectangles. */ static void rect_intersect (GpRegionBitmap *bitmap1, GpRegionBitmap *bitmap2, GpRect *rect) { rect->X = (bitmap1->X > bitmap2->X) ? bitmap1->X : bitmap2->X; rect->Y = (bitmap1->Y > bitmap2->Y) ? bitmap1->Y : bitmap2->Y; rect->Width = (((bitmap1->X + bitmap1->Width) < (bitmap2->X + bitmap2->Width)) ? (bitmap1->X + bitmap1->Width) : (bitmap2->X + bitmap2->Width)) - rect->X; rect->Height = (((bitmap1->Y + bitmap1->Height) < (bitmap2->Y + bitmap2->Height)) ? (bitmap1->Y + bitmap1->Height) : (bitmap2->Y + bitmap2->Height)) - rect->Y; } /* * rect_adjust_horizontal: * @x: a pointer to an integer * @width: a pointer to an integer * * Adjust the @x and @width values so that they both are multiples of 32 * and still encompass, at least, the same data as their original value. * The value 32 is chosen to match CAIRO_STRIDE_ALIGNMENT and allow direct * use of cairo surfaces. */ static void rect_adjust_horizontal (int *x, int *width) { /* ensure that X is a multiple of 8 */ int i = (*x & 31); if (i > 0) { /* reduce X to be a multiple of 8*/ *x -= i; /* but keep the "true" Width constant */ *width += i; } /* ensure that Width is a multiple of 8 */ i = (*width & 31); if (i > 0) { *width += (32 - i); } } /* * alloc_bitmap_memory: * @size: the size of the required allocation * @clear: a BOOL * * Allocate the alpha (1bpp) memory required for storing a bitmap and return * a pointer to this memory. @clear decides if the memory will be zeroized * after being allocated. NULL can be returned if too much memory is * requested (very large region) or if the memory couldn't be allocated (low * memory). */ static BYTE* alloc_bitmap_memory (int size, BOOL clear) { BYTE *buffer; if ((size < 1) || (size > REGION_MAX_BITMAP_SIZE)) { g_warning ("Requested %d bytes. Maximum size for region is %d bytes.", size, REGION_MAX_BITMAP_SIZE); return NULL; } buffer = (BYTE*) GdipAlloc (size); if (!buffer) return NULL; if (clear) memset (buffer, 0, size); return buffer; } /* * alloc_bitmap_with_buffer: * @x: an integer representing the X coordinate of the bitmap * @y: an integer representing the Y coordinate of the bitmap * @width: an integer representing the Width of the bitmap * @height: an integer representing the Height of the bitmap * @buffer: a byte array of the bitmap data * * Allocate and return a new GpRegionBitmap structure using the supplied * @buffer. * * Notes: * - The allocated structure must be freed using gdip_region_bitmap_free. * - The bitmap @x and @width MUST BE multiple of 8. * - The supplied @buffer MUST match the supplied width and height parameters. */ static GpRegionBitmap* alloc_bitmap_with_buffer (int x, int y, int width, int height, BYTE *buffer) { GpRegionBitmap *result = (GpRegionBitmap*) GdipAlloc (sizeof (GpRegionBitmap)); if (!result) { return NULL; } result->X = x; result->Y = y; result->Width = width; result->Height = height; result->Mask = buffer; result->reduced = FALSE; /* bitmap size isn't optimal wrt contents */ return result; } /* * alloc_bitmap: * @x: an integer representing the X coordinate of the bitmap * @y: an integer representing the Y coordinate of the bitmap * @width: an integer representing the Width of the bitmap * @height: an integer representing the Height of the bitmap * * Allocate and return a new GpRegionBitmap structure. * * Notes: * - The allocated structure must be freed using gdip_region_bitmap_free. * - The bitmap @x and @width will be adjusted to a multiple of 8. */ static GpRegionBitmap* alloc_bitmap (int x, int y, int width, int height) { BYTE *buffer; int size; /* ensure X and Width are multiple of 8 */ rect_adjust_horizontal (&x, &width); size = (width * height >> 3); /* 1 bit per pixel */ buffer = alloc_bitmap_memory (size, TRUE); return alloc_bitmap_with_buffer (x, y, width, height, buffer); } /* * alloc_merged_bitmap: * @bitmap1: a GpRegionBitmap * @bitmap2: a GpRegionBitmap * * Allocate and return a new GpRegionBitmap that covers the total area * (single rectangle) of both @bitmap1 and @bitmap2. * * Notes: * - The allocated structure must be freed using gdip_region_bitmap_free. */ static GpRegionBitmap* alloc_merged_bitmap (GpRegionBitmap *bitmap1, GpRegionBitmap *bitmap2) { GpRect rect; rect_union (bitmap1, bitmap2, &rect); return alloc_bitmap (rect.X, rect.Y, rect.Width, rect.Height); } /* * alloc_intersected_bitmap: * @bitmap1: a GpRegionBitmap * @bitmap2: a GpRegionBitmap * * Allocate and return a new GpRegionBitmap that covers only the shared * rectangle area of both @bitmap1 and @bitmap2. * * Notes: * - The allocated structure must be freed using gdip_region_bitmap_free. * - The bitmap width will be adjusted to a multiple of 8. */ static GpRegionBitmap* alloc_intersected_bitmap (GpRegionBitmap *bitmap1, GpRegionBitmap *bitmap2) { GpRect rect; rect_intersect (bitmap1, bitmap2, &rect); return alloc_bitmap (rect.X, rect.Y, rect.Width, rect.Height); } /* * gdip_region_bitmap_clone: * @bitmap: a GpRegionBitmap * * Allocate and return new GpRegionBitmap containing a copy of @bitmap. * * Note: the allocated structure must be freed using gdip_region_bitmap_free. */ GpRegionBitmap* gdip_region_bitmap_clone (GpRegionBitmap *bitmap) { BYTE *buffer; int size = (bitmap->Width * bitmap->Height >> 3); /* 1 bit per pixel */ if (size > 0) { buffer = alloc_bitmap_memory (size, FALSE); if (buffer) memcpy (buffer, bitmap->Mask, size); } else { buffer = NULL; } return alloc_bitmap_with_buffer (bitmap->X, bitmap->Y, bitmap->Width, bitmap->Height, buffer); } /* * empty_bitmap: * @bitmap: a GpRegionBitmap * * Clear and, if required, free the mask of @bitmap. Note that the allocated * GpRegionBitmap structure MUST still be freed using gdip_region_bitmap_free. */ static void empty_bitmap (GpRegionBitmap *bitmap) { bitmap->X = 0; bitmap->Y = 0; bitmap->Width = 0; bitmap->Height = 0; if (bitmap->Mask) { GdipFree (bitmap->Mask); bitmap->Mask = NULL; } } /* * gdip_region_bitmap_free: * @bitmap: a GpRegionBitmap * * Free the region bitmap @bitmap. */ void gdip_region_bitmap_free (GpRegionBitmap *bitmap) { empty_bitmap (bitmap); GdipFree (bitmap); } /* * gdip_region_bitmap_from_tree: * @tree: a GpPathTree * * Return a new GpRegionBitmap containing the bitmap recomposed from the * @tree. * * Note: the allocated structure must be freed using gdip_region_bitmap_free. */ static GpRegionBitmap* gdip_region_bitmap_from_tree (GpPathTree *tree) { GpRegionBitmap *result; if (!tree) return NULL; /* each item has... */ if (tree->path) { /* (a) only a path (the most common case) */ result = gdip_region_bitmap_from_path (tree->path); } else { /* (b) two items with an binary operation */ GpRegionBitmap *bitmap1 = gdip_region_bitmap_from_tree (tree->branch1); GpRegionBitmap *bitmap2 = gdip_region_bitmap_from_tree (tree->branch2); result = gdip_region_bitmap_combine (bitmap1, bitmap2, tree->mode); if (bitmap1) gdip_region_bitmap_free (bitmap1); if (bitmap2) gdip_region_bitmap_free (bitmap2); } return result; } /* * gdip_region_bitmap_ensure: * @region: a GpRegion * * Ensure the @region bitmap is available (as it isn't created until it is * actually needed). */ void gdip_region_bitmap_ensure (GpRegion *region) { /* we already have the bitmap */ if (region->bitmap) return; /* redraw the bitmap from the original path + all other operations/paths */ region->bitmap = gdip_region_bitmap_from_tree (region->tree); } /* * gdip_region_bitmap_invalidate: * @region: a GpRegion * * Invalidate (and free) the bitmap (if any) associated with @region. The * bitmap will need to be re-created before begin used. */ void gdip_region_bitmap_invalidate (GpRegion *region) { /* it's possible that the bitmap hasn't yet been created (e.g. if a rectangle region has just been converted to a path region) */ if (!region->bitmap) return; empty_bitmap (region->bitmap); region->bitmap = NULL; } /* * gdip_region_bitmap_to_cairo_surface * @bitmap: a GpRegionBitmap * * Create a cairo mask surface for the given region bitmap. Caller is * responsible for calling cairo_surface_destroy on the returned surface. */ cairo_surface_t * gdip_region_bitmap_to_cairo_surface (GpRegionBitmap *bitmap) { return cairo_image_surface_create_for_data (bitmap->Mask, CAIRO_FORMAT_A1, bitmap->Width, bitmap->Height, bitmap->Width >> 3); } /* * gdip_region_bitmap_from_path: * @path: a GpPath * * Return a new GpRegionBitmap containing the bitmap representing the @path. * NULL will be returned if the bitmap cannot be created (e.g. too big). * * Note: the allocated structure must be freed using gdip_region_bitmap_free. */ GpRegionBitmap* gdip_region_bitmap_from_path (GpPath *path) { GpRect bounds; GpRegionBitmap *bitmap; int i, idx; int length = path->count; unsigned long long int size; cairo_surface_t *surface = NULL; cairo_t *cr = NULL; /* empty path == empty bitmap */ if (length == 0) return alloc_bitmap_with_buffer (0, 0, 0, 0, NULL); /* get the limits of the bitmap we need to allocate */ if (GdipGetPathWorldBoundsI (path, &bounds, NULL, NULL) != Ok) return NULL; /* ensure X and Width are multiple of 8 */ rect_adjust_horizontal (&bounds.X, &bounds.Width); /* an empty width or height is valid, even if no bitmap can be produced */ if ((bounds.Width == 0) || (bounds.Height == 0)) return alloc_bitmap_with_buffer (bounds.X, bounds.Y, bounds.Width, bounds.Height, NULL); /* replay the path list and the operations to reconstruct the bitmap */ size = (unsigned long long int)(bounds.Width >> 3) * bounds.Height; if ((size < 1) || (size > REGION_MAX_BITMAP_SIZE)) { g_warning ("Path conversion requested %llu bytes (%d x %d). Maximum size is %d bytes.", size, bounds.Width, bounds.Height, REGION_MAX_BITMAP_SIZE); return NULL; } bitmap = alloc_bitmap (bounds.X, bounds.Y, bounds.Width, bounds.Height); if (bitmap == NULL) return NULL; surface = gdip_region_bitmap_to_cairo_surface (bitmap); cr = cairo_create (surface); idx = 0; for (i = 0; i < length; ++i) { GpPointF pt = path->points[i]; BYTE type = path->types[i]; GpPointF pts [3]; /* mask the bits so that we get only the type value not the other flags */ switch (type & PathPointTypePathTypeMask) { case PathPointTypeStart: cairo_move_to (cr, pt.X - bounds.X, pt.Y - bounds.Y); break; case PathPointTypeLine: cairo_line_to (cr, pt.X - bounds.X, pt.Y - bounds.Y); break; case PathPointTypeBezier: /* make sure we only add at most 3 points to pts */ if (idx < 3) { pts [idx] = pt; idx ++; } /* once we've added 3 pts, we can draw the curve */ if (idx == 3) { cairo_curve_to (cr, pts [0].X - bounds.X, pts [0].Y - bounds.Y, pts [1].X - bounds.X, pts [1].Y - bounds.Y, pts [2].X - bounds.X, pts [2].Y - bounds.Y); idx = 0; } break; } /* close the subpath */ if (type & PathPointTypeCloseSubpath) cairo_close_path (cr); } cairo_clip (cr); cairo_set_source_rgba (cr, 1, 1, 1, 1); cairo_paint (cr); cairo_destroy (cr); cairo_surface_destroy (surface); return bitmap; } /* * gdip_region_bitmap_get_smallest_rect: * @bitmap: a GpRegionBitmap * @rect: a pointer to a GpRect * * Return the minimal used space in the bitmap inside @rect. */ void gdip_region_bitmap_get_smallest_rect (GpRegionBitmap *bitmap, GpRect *rect) { int first_y = bitmap->Height + 1; /* empty (top) lines */ int last_y = -1; /* empty (bottom) lines */ int first_x = bitmap->Width + 1; /* empty (left) columns */ int last_x = -1; /* empty (right) columns */ int i = 0; int original_size = SHAPE_SIZE(bitmap); int x = 0, y = 0; int k; while (i < original_size) { if (bitmap->Mask [i] != 0) { for (k = 0; k < 8; k++) { if ((bitmap->Mask [i] & (1 << k)) != 0) { if (x < first_x) first_x = x; if (x > last_x) last_x = x; if (y < first_y) first_y = y; if (y > last_y) last_y = y; } x++; } } else { x += 8; } i++; if (x == bitmap->Width) { x = 0; y++; } } /* did we found some bits ? */ if ((last_x == -1) && (last_y == -1) && (first_x == bitmap->Width + 1) && (first_y == bitmap->Height + 1)) { rect->X = rect->Y = rect->Width = rect->Height = 0; } else { // convert to pixel values rect->X = bitmap->X + first_x; rect->Y = bitmap->Y + first_y; rect->Width = last_x - first_x + 1; rect->Height = last_y - first_y + 1; } } /* * is_worth_shrinking: * @original_size: the original size of a bitmap * @new_size: the _potential_ new size of the bitmap (if shrinked) * * Decide if the current bitmap, based on it's current size, is worth * shrinking to a lesser size. * * Note: Many binary operations (e.g. intersection) can greatly reduce the * size of the final bitmap. */ static BOOL is_worth_shrinking (int original_size, int new_size) { /* FIXME - we can do better than checking if we "save" 4kb */ return ((original_size - new_size) > 4096); } /* * gdip_region_bitmap_shrink: * @bitmap: a GpRegionBitmap * @always_shrink: a BOOL * * Shrink the @bitmap if either @always_shrink is TRUE, or if it is decided * to be worth the CPU time (see is_worth_shrinking). * * Reducing the bitmap size permit (a) to reduce the memory footprint and * (b) makes it more likely to apply certain optimizations using rectangle * intersections. * * Notes: * 1. we don't call this after an union (because the result will never be * smaller) but other operations can result in a smaller bitmap. * 2. we keep the bitmap width in multiple of 8 - it's simpler and faster */ void gdip_region_bitmap_shrink (GpRegionBitmap *bitmap, BOOL always_shrink) { int original_size, new_size; BOOL can_be_reduced; GpRect rect; /* bitmap (a) was already shrinked, or (b) is empty */ if (bitmap->reduced || !bitmap->Mask) return; gdip_region_bitmap_get_smallest_rect (bitmap, &rect); if ((rect.Width == 0) || (rect.Height == 0)) { /* no, the the bitmap is empty */ empty_bitmap (bitmap); return; } /* ensure X and Width are multiple of 8 */ rect_adjust_horizontal (&rect.X, &rect.Width); original_size = SHAPE_SIZE(bitmap); new_size = (rect.Height * rect.Width) >> 3; /* bits->bytes */ can_be_reduced = (new_size < original_size); /* shrink if: * a. the caller asked for it (and there is a size change) * b. the caller didn't ask for it but "we" decided it's worth it */ if ((always_shrink && can_be_reduced) || is_worth_shrinking (original_size, new_size)) { /* reallocate a new bitmap buffer */ BYTE *new_mask = alloc_bitmap_memory (new_size, FALSE); int new_width, new_height; int y; int old_width_byte, new_width_byte; BYTE* newline = NULL; BYTE* oldline = NULL; if (!new_mask) return; new_width = rect.Width; new_height = rect.Height; old_width_byte = bitmap->Width >> 3; new_width_byte = new_width >> 3; newline = new_mask; oldline = bitmap->Mask + ((rect.Y - bitmap->Y) * old_width_byte) + ((rect.X - bitmap->X) >> 3); /* copy the interesting portion in the new bitmap */ for (y = 0; y < new_height; y++) { memcpy (newline, oldline, new_width_byte); newline += new_width_byte; oldline += old_width_byte; } /* replace current data */ bitmap->X = rect.X; bitmap->Y = rect.Y; bitmap->Width = rect.Width; bitmap->Height = rect.Height; GdipFree (bitmap->Mask); bitmap->Mask = new_mask; bitmap->reduced = TRUE; } } /* * is_point_visible: * @bitmap: a GpRegionBitmap * @x: the horizontal position * @y: the vertical position * * Return TRUE if the @x,@y point is set on the bitmap. * * Note: No bounds check are done this internal shared function. */ static BOOL is_point_visible (GpRegionBitmap *bitmap, int x, int y) { int pixel, pos, mask; /* is the pixel set ? */ x -= bitmap->X; y -= bitmap->Y; pixel = (y * bitmap->Width + x); pos = (pixel >> 3); mask = (pixel & 7); return ((bitmap->Mask [pos] & (1 << mask)) != 0); } /* * gdip_region_bitmap_is_point_visible: * @bitmap: a GpRegionBitmap * @x: the horizontal position * @y: the vertical position * * Return TRUE if the @x,@y point is set on the bitmap. * * Note: Using a bitmap reduce the precision to integers. */ BOOL gdip_region_bitmap_is_point_visible (GpRegionBitmap *bitmap, int x, int y) { /* is this an empty bitmap ? */ if ((bitmap->Width == 0) || (bitmap->Height == 0)) return FALSE; /* is the point inside the bitmap ? */ if ((x < bitmap->X) || (x >= bitmap->X + bitmap->Width)) return FALSE; if ((y < bitmap->Y) || (y >= bitmap->Y + bitmap->Height)) return FALSE; return is_point_visible (bitmap, x, y); } /* * gdip_region_bitmap_is_point_visible: * @bitmap: a GpRegionBitmap * @rect: a pointer to a GpRect * * Return TRUE is _any_ part of @rect is inside the region. */ BOOL gdip_region_bitmap_is_rect_visible (GpRegionBitmap *bitmap, GpRect *rect) { int x, y; /* is this an empty bitmap ? */ if ((bitmap->Width == 0) || (bitmap->Height == 0)) return FALSE; /* quick intersection checks */ if (bitmap->X >= rect->X + rect->Width) return FALSE; if (bitmap->X + bitmap->Width <= rect->X) return FALSE; if (bitmap->Y >= rect->Y + rect->Height) return FALSE; if (bitmap->Y + bitmap->Height <= rect->Y) return FALSE; /* TODO - optimize */ for (y = rect->Y; y < rect->Y + rect->Height; y++) { for (x = rect->X; x < rect->X + rect->Width; x++) { if (gdip_region_bitmap_is_point_visible (bitmap, x, y)) return TRUE; } } return FALSE; } /* * get_buffer_pos: * @shape: a GpRegionBitmap * @x: the horizontal position * @y: the vertical position * * Return the index, inside the @shape buffer, corresponding to the @x,@y * point. */ static int get_buffer_pos (GpRegionBitmap *shape, int x, int y) { /* check for out of bounds */ if ((x < shape->X) || (x >= shape->X + shape->Width)) return -1; if ((y < shape->Y) || (y >= shape->Y + shape->Height)) return -1; x -= shape->X; y -= shape->Y; return ((y * shape->Width + x) >> 3); } /* * get_byte: * @shape: a GpRegionBitmap * @x: the horizontal position * @y: the vertical position * * Return the byte, from the @shape buffer, corresponding to the @x,@y point. * Note that this byte contains 8 pixels. */ static int get_byte (GpRegionBitmap *shape, int x, int y) { /* out of bounds == empty (no pixel) */ int pos = get_buffer_pos (shape, x, y); return (pos == -1) ? 0 : shape->Mask [pos]; } /* * Process a single line for gdip_region_bitmap_get_scans. */ static BOOL process_line (GpRegionBitmap *bitmap, int y, int *x, int *w) { int pos = *x; *x = -1; *w = -1; while (pos < bitmap->X + bitmap->Width) { BOOL visible = gdip_region_bitmap_is_point_visible (bitmap, pos, y); if (*x == -1) { if (visible) { *x += pos + 1; } } else { if (!visible) { *w = pos - *x; return TRUE; } } pos++; } /* end of line - have we started a rect ? */ if (*x != -1) { *w = pos - *x; return TRUE; } return FALSE; } /* * gdip_region_bitmap_get_scans: * @bitmap: a GpRegionBitmap * @rect: a pointer to an array of GpRectF * * Convert the scan lines of the bitmap into an array of GpRectF. The return * value represents the actual number of GpRectF entries that were generated. */ int gdip_region_bitmap_get_scans (GpRegionBitmap *bitmap, GpRectF *rect) { if (!bitmap || !bitmap->Mask) return 0; GpRect actual; int x, y, w; int n = 0; actual.X = REGION_INFINITE_POSITION; actual.Width = REGION_INFINITE_LENGTH; /* for each line in the bitmap */ for (y = bitmap->Y; y < bitmap->Y + bitmap->Height; y++) { /* until we processed the whole line */ x = bitmap->X; while (process_line (bitmap, y, &x, &w)) { /* FIXME - we only look at the last rectangle but we could check all rectangles in the previous line (and retain perfect rendering with, possibly, less rectangle. We could also allow non exact match for X and Width (e.g. +/- 1 pixel). MS doesn't seems to return perfect rectangles for all shapes. */ /* if position (X) and Width are identical to previous rectangle */ if ((x == actual.X) && (w == actual.Width)) { /* then augment it's Height by one */ if (rect && (n > 0)) { rect [n - 1].Height++; } } else { actual.X = x; actual.Y = y; actual.Width = w; actual.Height = 1; if (rect) { rect [n].X = actual.X; rect [n].Y = actual.Y; rect [n].Width = actual.Width; rect [n].Height = actual.Height; } n++; } /* continue on the same line */ x += w + 1; } } return n; } /* * Binary operators helper functions */ /* * bitmap_intersect: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * This function checks if the rectangle containing @shape1 intersect with * the rectangle containing @shape2. It is used to optimize certain code * path in the binary operations. */ static BOOL bitmap_intersect (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { return ((shape1->X < shape2->X + shape2->Width) && (shape1->X + shape1->Width > shape2->X) && (shape1->Y < shape2->Y + shape2->Height) && (shape1->Y + shape1->Height > shape2->Y)); } /* * gdip_region_bitmap_compare: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * This function checks if the data inside @shape1 is identical to the data * inside @shape2 - even if their respective rectangles are different. */ BOOL gdip_region_bitmap_compare (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { GpRect rect; int x, y; /* if the rectangles containing shape1 and shape2 DO NOT intersect, then there is no possible intersection */ if (!bitmap_intersect (shape1, shape2)) return FALSE; rect_union (shape1, shape2, &rect); for (y = rect.Y; y < rect.Y + rect.Height; y++) { for (x = rect.X; x < rect.X + rect.Width; x += 8) { if (get_byte (shape1, x, y) != get_byte (shape2, x, y)) return FALSE; } } return TRUE; } /* * Binary operators on bitmap regions * * Notes * - All operations requires the bitmap x origin and it's width to be multiple * of 8. */ /* * gdip_region_bitmap_union: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * Return a new bitmap containing the union of the two specified region * bitmaps. */ static GpRegionBitmap* gdip_region_bitmap_union (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { GpRegionBitmap *op = alloc_merged_bitmap (shape1, shape2); int x, y; for (y = op->Y; y < op->Y + op->Height; y++) { int p = get_buffer_pos (op, op->X, y); for (x = op->X; x < op->X + op->Width; x += 8) { op->Mask [p++] = get_byte (shape1, x, y) | get_byte (shape2, x, y); } } /* no need to call reduce_bitmap (it will never shrink, unless the original bitmap were oversized) */ return op; } /* * gdip_region_bitmap_intersection: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * Return a new bitmap containing the intersection of the two specified region * bitmaps. */ static GpRegionBitmap* gdip_region_bitmap_intersection (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { GpRegionBitmap *op; int x, y; /* if the rectangles containing shape1 and shape2 DO NOT intersect, then there is no possible intersection */ if (!bitmap_intersect (shape1, shape2)) return alloc_bitmap_with_buffer (0, 0, 0, 0, NULL); /* the bitmap size cannot be bigger than a rectangle intersection of both bitmaps */ op = alloc_intersected_bitmap (shape1, shape2); for (y = op->Y; y < op->Y + op->Height; y++) { int p = get_buffer_pos (op, op->X, y); for (x = op->X; x < op->X + op->Width; x += 8) { op->Mask [p++] = get_byte (shape1, x, y) & get_byte (shape2, x, y); } } /* reduce bitmap size - if it make sense */ gdip_region_bitmap_shrink (op, FALSE); return op; } /* * gdip_region_bitmap_exclude: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * Return a new bitmap containing the first shape minus the second shape. */ static GpRegionBitmap* gdip_region_bitmap_exclude (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { GpRegionBitmap *op; int x, y; /* if the rectangles containing shape1 and shape2 DO NOT intersect, then the result is identical shape1 */ if (!bitmap_intersect (shape1, shape2)) return gdip_region_bitmap_clone (shape1); /* the new bitmap size cannot be bigger than shape1 */ op = alloc_bitmap (shape1->X, shape1->Y, shape1->Width, shape1->Height); for (y = op->Y; y < op->Y + op->Height; y++) { int p = get_buffer_pos (op, op->X, y); for (x = op->X; x < op->X + op->Width; x += 8) { BYTE b1 = get_byte (shape1, x, y); op->Mask [p++] = b1 - (b1 & get_byte (shape2, x, y)); } } /* reduce bitmap size - if it make sense */ gdip_region_bitmap_shrink (op, FALSE); return op; } /* * gdip_region_bitmap_complement: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * Return a new bitmap containing the second shape minus the first shape. */ static GpRegionBitmap* gdip_region_bitmap_complement (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { GpRegionBitmap *op; int x, y; /* if the rectangles containing shape1 and shape2 DO NOT intersect, then the result is identical shape2 */ if (!bitmap_intersect (shape1, shape2)) return gdip_region_bitmap_clone (shape2); /* the new bitmap size cannot be bigger than shape2 */ op = alloc_bitmap (shape2->X, shape2->Y, shape2->Width, shape2->Height); for (y = op->Y; y < op->Y + op->Height; y++) { int p = get_buffer_pos (op, op->X, y); for (x = op->X; x < op->X + op->Width; x += 8) { BYTE b2 = get_byte (shape2, x, y); op->Mask [p++] = b2 - (b2 & get_byte (shape1, x, y)); } } /* reduce bitmap size - if it make sense */ gdip_region_bitmap_shrink (op, FALSE); return op; } /* * gdip_region_bitmap_xor: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * * Return a new bitmap containing the exclusive-or of the two specified region * bitmaps. */ static GpRegionBitmap* gdip_region_bitmap_xor (GpRegionBitmap *shape1, GpRegionBitmap *shape2) { GpRegionBitmap *op; int x, y; /* if the rectangles containing shape1 and shape2 DO NOT intersect, then the result is identical an union of shape1 and shape2. Code is almost similar but no reduction is required for an union. */ if (!bitmap_intersect (shape1, shape2)) return gdip_region_bitmap_union (shape1, shape2); /* the new bitmap is potentially as big as the two merged bitmaps */ op = alloc_merged_bitmap (shape1, shape2); for (y = op->Y; y < op->Y + op->Height; y++) { int p = get_buffer_pos (op, op->X, y); for (x = op->X; x < op->X + op->Width; x += 8) { op->Mask [p++] = get_byte (shape1, x, y) ^ get_byte (shape2, x, y); } } /* reduce bitmap size - if it make sense */ gdip_region_bitmap_shrink (op, FALSE); return op; } /* * gdip_region_bitmap_combine: * @shape1: a GpRegionBitmap * @shape2: a GpRegionBitmap * @combineMode: the binary operator to apply between the two shapes * * Return a new GpRegionBitmap containing a new bitmap resulting from applying * the @combineMode to @shape1 and @shape2 bitmaps. */ GpRegionBitmap* gdip_region_bitmap_combine (GpRegionBitmap *bitmap1, GpRegionBitmap* bitmap2, CombineMode combineMode) { if (!bitmap1 || !bitmap2) return NULL; switch (combineMode) { case CombineModeComplement: return gdip_region_bitmap_complement (bitmap1, bitmap2); case CombineModeExclude: return gdip_region_bitmap_exclude (bitmap1, bitmap2); case CombineModeIntersect: return gdip_region_bitmap_intersection (bitmap1, bitmap2); case CombineModeUnion: return gdip_region_bitmap_union (bitmap1, bitmap2); case CombineModeXor: return gdip_region_bitmap_xor (bitmap1, bitmap2); default: g_warning ("Unkown combine mode specified (%d)", combineMode); return NULL; } } libgdiplus-6.0.4+dfsg/src/print.c0000644000175000017500000000431612377405421017416 0ustar directhexdirecthex/* * print.c * * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Jordi Mas (jordi@ximian.com) * Sebastien Pouliot */ #include #ifdef CAIRO_HAS_PS_SURFACE #include "graphics-private.h" #include /* * NOTE: The functions in this file aren't part of GDI+ and can only be called * from Mono's System.Drawing.dll on non-Windows operating systems */ /* coverity[+alloc : arg-*5] */ GpStatus GdipGetPostScriptGraphicsContext (char* filename, int width, int height, double dpix, double dpiy, GpGraphics **graphics) { GpGraphics *gfx; cairo_surface_t *surface; if (!graphics) return InvalidParameter; surface = cairo_ps_surface_create (filename, (double) width, (double) height); cairo_surface_set_fallback_resolution (surface, dpix, dpiy); gfx = gdip_graphics_new (surface); gfx->dpi_x = dpix; gfx->dpi_y = dpiy; cairo_surface_destroy (surface); gfx->type = gtPostScript; *graphics = gfx; return Ok; } GpStatus GdipGetPostScriptSavePage (GpGraphics* graphics) { if (!graphics) return InvalidParameter; cairo_show_page (graphics->ct); return Ok; } #endif libgdiplus-6.0.4+dfsg/src/general.h0000644000175000017500000000435013542672033017702 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __GENERAL_H__ #define __GENERAL_H__ #include "win32structs.h" /* Startup / shutdown */ typedef struct { UINT32 GdiplusVersion; /* must be 1 or 2 */ void* DebugEventCallback; /* ignored in libgdiplus */ BOOL SuppressBackgroundThread; /* ignored in libgdiplus */ BOOL SuppressExternalCodecs; /* ignored in libgdiplus */ } GdiplusStartupInput; typedef struct { void* NotificationHook; /* ignored in libgdiplus */ void* NotificationUnhook; /* ignored in libgdiplus */ } GdiplusStartupOutput; GpStatus WINGDIPAPI GdiplusStartup (ULONG_PTR *token, const GdiplusStartupInput *input, GdiplusStartupOutput *output); void WINGDIPAPI GdiplusShutdown (ULONG_PTR token); /* Memory / public API */ WINGDIPAPI void* GdipAlloc (size_t size); WINGDIPAPI void GdipFree (void *ptr); /* Notification API */ GpStatus WINGDIPAPI GdiplusNotificationHook (ULONG_PTR *token); void WINGDIPAPI GdiplusNotificationUnhook (ULONG_PTR token); /* libgdiplus-specific API, useful for quirking buggy behavior in older versions */ WINGDIPAPI char* GetLibgdiplusVersion (); #endif libgdiplus-6.0.4+dfsg/src/bmpcodec.c0000644000175000017500000012573113545154623020046 0ustar directhexdirecthex/* * Copyright (c) 2004 Ximian * Copyright (C) 2003-2004,2007 Novell, Inc (http://www.novell.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. * * bmpcodec.c : Contains function definitions for encoding decoding bmp images * * Authors: * Jordi Mas i Hernandez (jordi@ximian.com) * Sanjay Gupta (gsanjay@novell.com) * Mark Steele (ms@rapidsys.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Useful documentation about bitmaps * * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_4v1h.asp * http://www.csdn.net/Dev/Format/windows/Bmp.html * http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html * * Header structure * BITMAPFILEHEADER * BITMAPINFOHEADER or BITMAPV4HEADER or BITMAPV5HEADER or BITMAPCOREHEADER * RGBQUADS or RGBTRIPLE (optional) * Bitmap data */ #include "gdiplus-private.h" #include "bmpcodec.h" GUID gdip_bmp_image_format_guid = {0xb96b3cabU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; /* Codecinfo related data*/ static ImageCodecInfo bmp_codec; static const WCHAR bmp_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'B', 'M', 'P', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in BMP Codec */ static const WCHAR bmp_extension[] = {'*','.','B', 'M', 'P',';', '*','.', 'D','I', 'B',';', '*','.', 'R', 'L', 'E',0}; /* *.BMP;*.DIB;*.RLE */ static const WCHAR bmp_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'b', 'm', 'p', 0}; /* image/bmp */ static const WCHAR bmp_format[] = {'B', 'M', 'P', 0}; /* BMP */ static const BYTE bmp_sig_pattern[] = { 0x42, 0x4D }; static const BYTE bmp_sig_mask[] = { 0xFF, 0xFF }; ImageCodecInfo * gdip_getcodecinfo_bmp () { bmp_codec.Clsid = (CLSID) { 0x557cf400, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; bmp_codec.FormatID = gdip_bmp_image_format_guid; bmp_codec.CodecName = (const WCHAR*) bmp_codecname; bmp_codec.DllName = NULL; bmp_codec.FormatDescription = (const WCHAR*) bmp_format; bmp_codec.FilenameExtension = (const WCHAR*) bmp_extension; bmp_codec.MimeType = (const WCHAR*) bmp_mimetype; bmp_codec.Flags = ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; bmp_codec.Version = 1; bmp_codec.SigCount = 1; bmp_codec.SigSize = 2; bmp_codec.SigPattern = bmp_sig_pattern; bmp_codec.SigMask = bmp_sig_mask; return &bmp_codec; } static GpStatus gdip_get_bmp_stride (PixelFormat format, INT width, INT *strideResult, BOOL cairoHacks) { INT stride; /* stride is a (signed) _int_ and once multiplied by 4 it should hold a value that can be allocated by GdipAlloc * this effectively limits 'width' to 536870911 pixels */ unsigned long long int widthBuff = width; switch (format) { case PixelFormat1bppIndexed: stride = (width + 7) / 8; break; case PixelFormat4bppIndexed: stride = (width + 1) / 2; break; case PixelFormat8bppIndexed: stride = width; break; case PixelFormat16bppRGB555: case PixelFormat16bppRGB565: widthBuff *= 2; if (widthBuff > G_MAXINT32) return InvalidParameter; stride = widthBuff; break; case PixelFormat24bppRGB: widthBuff *= cairoHacks ? 4 : 3; if (widthBuff > G_MAXINT32) return InvalidParameter; stride = widthBuff; break; default: widthBuff *= 4; if (widthBuff > G_MAXINT32) return InvalidParameter; stride = widthBuff; break; } /* Ensure 32bits alignment */ gdip_align_stride (stride); *strideResult = stride; return Ok; } static GpStatus gdip_get_bmp_pixelformat (const BITMAPV5HEADER *bih, PixelFormat *sourceFormatResult, PixelFormat *conversionFormatResult) { PixelFormat sourceFormat; PixelFormat conversionFormat; if (bih->bV5Compression == BI_BITFIELDS) { if (bih->bV5BitCount != 16) return OutOfMemory; if ((bih->bV5RedMask == 0x7C00) && (bih->bV5GreenMask == 0x3E0) && (bih->bV5BlueMask == 0x1F)) sourceFormat = PixelFormat16bppRGB555; else if ((bih->bV5RedMask == 0xF800) && (bih->bV5GreenMask == 0x7E0) && (bih->bV5BlueMask == 0x1F)) sourceFormat = PixelFormat16bppRGB565; else sourceFormat = PixelFormat16bppRGB555; conversionFormat = PixelFormat32bppRGB; } else { switch (bih->bV5BitCount) { case 64: sourceFormat = PixelFormat64bppARGB; conversionFormat = sourceFormat; break; case 32: sourceFormat = PixelFormat32bppRGB; conversionFormat = sourceFormat; break; case 24: sourceFormat = PixelFormat24bppRGB; conversionFormat = sourceFormat; break; case 16: sourceFormat = PixelFormat16bppRGB555; conversionFormat = PixelFormat32bppRGB; break; case 8: sourceFormat = PixelFormat8bppIndexed; conversionFormat = sourceFormat; break; case 4: sourceFormat = PixelFormat4bppIndexed; conversionFormat = sourceFormat; break; case 1: sourceFormat = PixelFormat1bppIndexed; conversionFormat = sourceFormat; break; default: return OutOfMemory; } } *sourceFormatResult = sourceFormat; *conversionFormatResult = conversionFormat; return Ok; } static void gdip_bitmap_fill_info_header (GpBitmap *bitmap, PBITMAPINFOHEADER bmi) { PixelFormat format = bitmap->active_bitmap->pixel_format; memset (bmi, 0, sizeof (BITMAPINFOHEADER)); #ifdef WORDS_BIGENDIAN bmi->biSize = GUINT32_FROM_LE (sizeof (BITMAPINFOHEADER)); bmi->biWidth = GULONG_FROM_LE (bitmap->active_bitmap->width); bmi->biHeight = GULONG_FROM_LE (bitmap->active_bitmap->height); bmi->biPlanes = GUINT16_FROM_LE (1); if (format != PixelFormat24bppRGB) bmi->biBitCount = GUINT16_FROM_LE (gdip_get_pixel_format_bpp (bitmap->active_bitmap->pixel_format)); else bmi->biBitCount = GUINT16_FROM_LE (24); bmi->biCompression = GUINT32_FROM_LE (BI_RGB); bmi->biSizeImage = GUINT32_FROM_LE (0); /* Many tools expect this may be set to zero for BI_RGB bitmaps */ bmi->biXPelsPerMeter = GULONG_FROM_LE ((int) (0.5f + ((gdip_get_display_dpi() * 3937) / 100))); bmi->biYPelsPerMeter = GULONG_FROM_LE ((int) (0.5f + ((gdip_get_display_dpi() * 3937) / 100))); /* 1 meter is = 39.37 */ #else bmi->biSize = sizeof (BITMAPINFOHEADER); bmi->biWidth = bitmap->active_bitmap->width; bmi->biHeight = bitmap->active_bitmap->height; bmi->biPlanes = 1; if (format != PixelFormat24bppRGB) bmi->biBitCount = gdip_get_pixel_format_bpp (bitmap->active_bitmap->pixel_format); else bmi->biBitCount = 24; bmi->biCompression = BI_RGB; bmi->biSizeImage = 0; /* Many tools expect this may be set to zero for BI_RGB bitmaps */ bmi->biXPelsPerMeter = (int) (0.5f + ((gdip_get_display_dpi() * 3937) / 100)); bmi->biYPelsPerMeter = (int) (0.5f + ((gdip_get_display_dpi() * 3937) / 100)); /* 1 meter is = 39.37 */ #endif } static void gdip_read_bmp_rle_8bit (void *pointer, BYTE *scan0, BOOL upsidedown, int stride, int scanWidth, int scanCount, ImageSource source) { BYTE code; int bytes_read; int col_offset = 0; int row_offset = (scanCount - 1) * stride; int row_delta = -stride; int rows_remaining = scanCount; int size = scanCount * stride; BOOL new_row = FALSE; if (!upsidedown) return; /* top to bottom images can't be compressed */ if (scanWidth > stride) return; while ((rows_remaining > 0) || ((row_offset == 0) && (col_offset < scanWidth))) { bytes_read = gdip_read_bmp_data (pointer, &code, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ if (code == 0) { /* RLE escape code */ bytes_read = gdip_read_bmp_data (pointer, &code, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ switch (code) { case 0: /* skip remainder of scan */ { if (new_row) new_row = FALSE; else { row_offset += row_delta; rows_remaining--; col_offset = 0; } break; } case 1: /* skip remainder of image -- in other words, we're finished :-) */ { return; } case 2: /* jump forward (dx, dy) coordinates */ { BYTE dx, dy; bytes_read = gdip_read_bmp_data (pointer, &dx, 1, source); bytes_read += gdip_read_bmp_data (pointer, &dy, 1, source); if (bytes_read < 2) return; /* TODO?: Add an "unexpected end of file" error code */ /* not really sure how to handle the case where the X delta goes * past the end of the scan. in the interest of not crashing, * let's wrap it back around. */ col_offset = (col_offset + dx) % scanWidth; row_offset -= dy * stride; /* BMPs go from bottom to top */ new_row = FALSE; break; } default: /* an uncompressed section, 'code' pixels wide */ { /* uncompressed sections must be an even number of bytes long, * even if they are an odd number of *pixels* long. */ BOOL pad_byte_present = ((code & 1) != 0); int bytes_to_read = code; /* wrap rows properly, even though they are inverted in memory */ while (bytes_to_read > 0) { int bytes_to_read_this_scan = scanWidth - col_offset; if (bytes_to_read_this_scan > bytes_to_read) bytes_to_read_this_scan = bytes_to_read; int pixel_index = row_offset + col_offset; if (pixel_index < 0 || pixel_index >= size) return; bytes_read = gdip_read_bmp_data ( pointer, &scan0[pixel_index], bytes_to_read_this_scan, source); if (bytes_read < bytes_to_read_this_scan) return; /* TODO?: Add an "unexpected end of file" error code */ col_offset += bytes_read; bytes_to_read -= bytes_read; if (col_offset >= scanWidth) { col_offset = 0; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; new_row = TRUE; } else new_row = FALSE; } if (pad_byte_present) { bytes_read = gdip_read_bmp_data(pointer, &code, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ } break; } } } else { /* we have a run of length 'code'. the colour of the run is the next byte in the file. */ int run_length = code; BYTE pixel_value; bytes_read = gdip_read_bmp_data(pointer, &pixel_value, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ while (run_length > 0) { int bytes_to_run_this_scan = scanWidth - col_offset; if (bytes_to_run_this_scan > run_length) bytes_to_run_this_scan = run_length; int pixel_index = row_offset + col_offset; if (pixel_index < 0 || pixel_index >= size) return; if (bytes_to_run_this_scan < 0 || pixel_index + bytes_to_run_this_scan > size) return; memset (scan0 + pixel_index, pixel_value, bytes_to_run_this_scan); col_offset += bytes_to_run_this_scan; run_length -= bytes_to_run_this_scan; if (col_offset >= scanWidth) { col_offset = 0; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; new_row = TRUE; } else new_row = FALSE; } } } return; } // PixelFormat32bppARGB. ARGB gdip_getpixel_32bppARGB (BYTE *scan, INT x) { ARGB pixel = ((ARGB *) scan)[x]; return pixel; } void gdip_setpixel_32bppARGB (BYTE *scan, INT x, BYTE a, BYTE r, BYTE g, BYTE b) { set_pixel_bgra (scan, x * 4, b, g, r, a); } // PixelFormat16bppRGB555. ARGB gdip_getpixel_16bppRGB555 (BYTE *scan, INT x) { WORD pixel = ((WORD *) scan)[x]; return ((pixel & 0x1F) >> 2) | 8 * ((pixel & 0x1F) | 8 * (((((pixel >> 5) & 0x1F) | (((pixel >> 10) & 0x1C) << 8)) & 0xFFFFFFFC) | 32 * (((pixel >> 5) & 0x1F) | ((((pixel >> 10) & 0x1F) | 0xFFFFFFE0) << 8)))); } // PixelFormat16bppRGB565. ARGB gdip_getpixel_16bppRGB565 (BYTE *scan, INT x) { WORD pixel = ((WORD *) scan)[x]; return ((pixel & 0x1F) >> 2) | 8 * ((pixel & 0x1F) | 2 * (((((pixel >> 5) & 0x3F) | (((pixel >> 11) & 0xFFFFFFFC) << 10)) & 0xFFFFFFF0) | ((((pixel >> 5) & 0x3F) | ((((pixel >> 11)) | 0xFFFFFFE0) << 9)) << 6))); } static void gdip_read_bmp_rle_4bit (void *pointer, BYTE *scan0, BOOL upsidedown, int stride, int scanWidth, int scanCount, ImageSource source) { BYTE code; int bytes_read; int col_offset = 0; int row_offset = (scanCount - 1) * stride; int row_delta = -stride; int rows_remaining = scanCount; int size = scanCount * stride; BOOL new_row = FALSE; if (!upsidedown) return; /* top to bottom images can't be compressed */ if ((scanWidth & 1) != 0) scanWidth++; if (scanWidth > stride * 2) return; while (rows_remaining > 0) { bytes_read = gdip_read_bmp_data (pointer, &code, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ if (code == 0) { /* RLE escape code */ bytes_read = gdip_read_bmp_data (pointer, &code, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ switch (code) { case 0: /* skip remainder of scan */ { if (new_row) new_row = FALSE; else { row_offset += row_delta; rows_remaining--; col_offset = 0; } break; } case 1: /* skip remainder of image -- in other words, we're finished :-) */ { return; } case 2: /* jump forward (dx, dy) coordinates */ { BYTE dx, dy; bytes_read = gdip_read_bmp_data (pointer, &dx, 1, source); bytes_read += gdip_read_bmp_data (pointer, &dy, 1, source); if (bytes_read < 2) return; /* TODO?: Add an "unexpected end of file" error code */ /* not really sure how to handle the case where the X delta goes * past the end of the scan. in the interest of not crashing, * let's wrap it back around. */ col_offset = (col_offset + dx) % scanWidth; row_offset -= dy * stride; /* BMPs go from bottom to top */ new_row = FALSE; break; } default: /* an uncompressed section, 'code' pixels wide */ { int pixels_to_read = code; int bytes_of_data = (pixels_to_read + 1) / 2; /* uncompressed sections must be an even number of bytes long, * even if they are an odd number of *pixels* long. */ BOOL pad_byte_present = ((bytes_of_data & 1) != 0); int bytes_to_read = pixels_to_read / 2; /* leave off the last pixel for now */ /* wrap rows properly, even though they are inverted in memory */ while (bytes_to_read > 0) { if ((scanWidth - col_offset) == 1) { /* special case: a pair of pixels is split across two rows. */ BYTE pixels, same_row_pixel, next_row_pixel; int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; bytes_read = gdip_read_bmp_data (pointer, &pixels, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ same_row_pixel = (pixels >> 4) & 0x0F; next_row_pixel = pixels & 0x0F; if ((col_offset & 1) != 0) { BYTE old_pixel = 0xF0 & scan0[pixel_index]; scan0[pixel_index] = (old_pixel & 0xF0) | same_row_pixel; } else scan0[pixel_index] = same_row_pixel << 4; col_offset = 1; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; if (row_offset < 0 || row_offset >= size) return; scan0[row_offset] = next_row_pixel << 4; new_row = FALSE; } else if ((col_offset & 1) == 0) { /* alignment is good; we can read pairs of pixels as bytes. * if there are an odd number of pixels in a scan, though, * then the last pixel will need to be special-cased. also, * if the scan width is odd, then a byte will be split * across a row ending. I don't know if this is in the spec, * but it is the most resistant to crashing. */ int bytes_to_read_this_scan = (scanWidth - col_offset) / 2; if (bytes_to_read_this_scan > bytes_to_read) bytes_to_read_this_scan = bytes_to_read; int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; bytes_read = gdip_read_bmp_data ( pointer, &scan0[pixel_index], bytes_to_read_this_scan, source); if (bytes_read < bytes_to_read_this_scan) return; /* TODO?: Add an "unexpected end of file" error code */ col_offset += bytes_read * 2; bytes_to_read -= bytes_read; new_row = FALSE; } else { /* bad alignment; nybble-swapping will be required */ int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; BYTE last_high_nybble = 0xF0 & scan0[pixel_index]; int bytes_to_read_this_scan = (scanWidth - col_offset) / 2; if (bytes_to_read_this_scan > bytes_to_read) bytes_to_read_this_scan = bytes_to_read; while (bytes_to_read_this_scan >= 0) { BYTE pixels; bytes_read = gdip_read_bmp_data (pointer, &pixels, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; scan0[pixel_index] = last_high_nybble | (pixels >> 4); last_high_nybble = (pixels << 4) & 0xF0; col_offset += 2; /* two pixels processed */ bytes_to_read_this_scan--; } new_row = FALSE; } if (col_offset >= scanWidth) { col_offset = 0; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; new_row = TRUE; } } if ((pixels_to_read & 1) != 0) { /* half of a byte remains to be inserted into the correct nybble */ BYTE pixel; int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; bytes_read = gdip_read_bmp_data (pointer, &pixel, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ pixel >>= 4; /* the last pixel is in the high nybble */ if ((col_offset & 1) != 0) { BYTE old_pixel = 0xF0 & scan0[pixel_index]; scan0[pixel_index] = (old_pixel & 0xF0) | pixel; } else scan0[pixel_index] = pixel << 4; col_offset++; if (col_offset >= scanWidth) { col_offset = 0; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; new_row = TRUE; } else new_row = FALSE; } if (pad_byte_present) { bytes_read = gdip_read_bmp_data(pointer, &code, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ } break; } } } else { /* we have a run of length 'code'. the colour of the run is the next byte in the file. * something weird is happening here in 4-bit land, though; a byte stores two pixels. * what happens is rather odd: the run is actually of two alternating colours (which * may, of course, be the same, but are not required to be). we need to make sure that * the colours end up in the right nybbles of the output bytes. */ int run_pixels = code; int run_length = run_pixels / 2; BYTE pixel_values; BYTE inverted_pixel_values; bytes_read = gdip_read_bmp_data(pointer, &pixel_values, 1, source); if (bytes_read < 1) return; /* TODO?: Add an "unexpected end of file" error code */ inverted_pixel_values = ((pixel_values & 0x0F) << 4) | ((pixel_values & 0xF0) >> 4); if ((col_offset & 1) != 0) { BYTE temp = inverted_pixel_values; inverted_pixel_values = pixel_values; pixel_values = temp; } while (run_length > 0) { if ((scanWidth - col_offset) == 1) { /* special case: a pair of pixels is split across two rows. */ BYTE same_row_pixel = (pixel_values >> 4) & 0x0F; BYTE next_row_pixel = pixel_values & 0x0F; int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; if ((col_offset & 1) != 0) { BYTE old_pixel = 0xF0 & scan0[pixel_index]; scan0[pixel_index] = (old_pixel & 0xF0) | same_row_pixel; } else scan0[pixel_index] = same_row_pixel << 4; col_offset = 1; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; if (row_offset < 0 || row_offset >= size) return; scan0[row_offset] = next_row_pixel << 4; new_row = FALSE; if ((scanWidth & 1) != 0) { /* if the width of the scan is odd, then the nybbles swap * places each time they cross from one row to the next */ BYTE temp = inverted_pixel_values; inverted_pixel_values = pixel_values; pixel_values = temp; } } else { int bytes_to_run_this_scan; int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; /* make sure we're byte-aligned; if we're not, we need to store a nybble first */ if ((col_offset & 1) != 0) { BYTE old_pixel = 0xF0 & scan0[pixel_index]; scan0[pixel_index] = (old_pixel & 0xF0) | (pixel_values & 0x0F); col_offset++; } bytes_to_run_this_scan = (scanWidth - col_offset) / 2; if (bytes_to_run_this_scan > run_length) bytes_to_run_this_scan = run_length; if (bytes_to_run_this_scan < 0 || pixel_index + bytes_to_run_this_scan > size) return; memset (scan0 + pixel_index, pixel_values, bytes_to_run_this_scan); col_offset += bytes_to_run_this_scan * 2; run_length -= bytes_to_run_this_scan; if (col_offset >= scanWidth) { col_offset = 0; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; new_row = TRUE; if ((scanWidth & 1) != 0) { /* if the width of the scan is odd, then the nybbles swap * places each time they cross from one row to the next */ BYTE temp = inverted_pixel_values; inverted_pixel_values = pixel_values; pixel_values = temp; } } else new_row = FALSE; } } if ((run_pixels & 1) != 0) { /* half of a byte remains to be inserted into the correct nybble */ BYTE pixel = pixel_values >> 4; /* the last pixel is in the high nybble */ int pixel_index = row_offset + col_offset / 2; if (pixel_index < 0 || pixel_index >= size) return; if ((col_offset & 1) != 0) { BYTE old_pixel = 0xF0 & scan0[pixel_index]; scan0[pixel_index] = (old_pixel & 0xF0) | pixel; } else scan0[pixel_index] = pixel << 4; col_offset++; if (col_offset >= scanWidth) { col_offset = 0; row_offset += row_delta; rows_remaining--; if (rows_remaining <= 0) /* more data than expected -- let's not make this a fatal error */ return; new_row = TRUE; } else new_row = FALSE; } } } return; } GpStatus gdip_read_BITMAPINFOHEADER (void *pointer, ImageSource source, BITMAPV5HEADER *bmi, BOOL *upsidedown) { DWORD dw = 0; BYTE *data_read = (BYTE*)&dw; int size = sizeof (DWORD); int size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; DWORD headerSize = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); switch (headerSize) { case BITMAPCOREHEADER_SIZE: bmi->bV5Size = headerSize; /* Old OS/2 format. Width and Height fields are WORDs instead of DWORDS */ dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5Width = (data_read[1]<<8 | data_read[0]); bmi->bV5Height = (data_read[3]<<8 | data_read[2]); break; case sizeof (BITMAPINFOHEADER): case sizeof (BITMAPV3HEADER): case sizeof (BITMAPV4HEADER): case sizeof (BITMAPV5HEADER): bmi->bV5Size = headerSize; dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5Width = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); // Width can't be negative (as opposed to Height where that indicates a top-down image) if (bmi->bV5Width <= 0) return OutOfMemory; dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5Height = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); if (bmi->bV5Height == 0) return OutOfMemory; break; default: /* This is an unknown or invalid header. */ return OutOfMemory; } dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5Planes = (data_read[1]<<8 | data_read[0]); bmi->bV5BitCount = (data_read[3]<<8 | data_read[2]); /* The OS/2 format doesn't have any of these other fields */ if (bmi->bV5Size == BITMAPCOREHEADER_SIZE) { bmi->bV5Compression = 0; bmi->bV5SizeImage = 0; bmi->bV5XPelsPerMeter = 0; bmi->bV5YPelsPerMeter = 0; bmi->bV5ClrUsed = 0; bmi->bV5ClrImportant = 0; return Ok; } dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5Compression = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); /* If the height is negative then the bitmap is sideup. */ if (bmi->bV5Height < 0) { *upsidedown = FALSE; bmi->bV5Height = -bmi->bV5Height; } dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5SizeImage = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5XPelsPerMeter = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5YPelsPerMeter = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5ClrUsed = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5ClrImportant = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); /* We've finished reading the BITMAPINFOHEADER but later versions are larger. */ if (bmi->bV5Size == sizeof (BITMAPINFOHEADER)) { // A 16bpp BITMAPINFOHEADER BI_BITFIELDS image is followed by a red, green and blue mask. if (bmi->bV5BitCount != 16 || bmi->bV5Compression != BI_BITFIELDS) return Ok; } dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5RedMask = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5GreenMask = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5BlueMask = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); if (bmi->bV5Size == sizeof (BITMAPINFOHEADER)) return Ok; dw = 0; size_read = gdip_read_bmp_data (pointer, data_read, size, source); if (size_read < size) return OutOfMemory; bmi->bV5AlphaMask = ((guint32)data_read[3]<<24 | data_read[2]<<16 | data_read[1]<<8 | data_read[0]); /* We don't use any information in BITMAPV4HEADER or BITMAPV5HEADER, so there is no point going through all of * the other fields. This leaves the rest of the structure uninitialized. */ size = headerSize - sizeof (BITMAPV3HEADER); if (size > 0) { while (size > sizeof (DWORD)) { if (gdip_read_bmp_data (pointer, data_read, sizeof (DWORD), source) != sizeof (DWORD)) return OutOfMemory; size -= sizeof (DWORD); } if (gdip_read_bmp_data (pointer, data_read, size, source) != size) return OutOfMemory; } return Ok; } static GpStatus gdip_readbmp_palette (void *pointer, ImageSource source, const BITMAPV5HEADER *bmi, ColorPalette **result) { UINT numberOfColors = bmi->bV5ClrUsed; if (bmi->bV5BitCount <= 8) { int defaultNumberOfColors = 1 << bmi->bV5BitCount; // A color count of 0 means use the default. Also use the default color count // if the bitmap has specified an unsupported number of colors (i.e. greater // than the default). if (bmi->bV5ClrUsed == 0 || bmi->bV5ClrUsed > defaultNumberOfColors) numberOfColors = defaultNumberOfColors; } // Nothing to do. if (numberOfColors == 0) return Ok; BYTE buffer[4]; INT colorEntrySize = bmi->bV5Size == BITMAPCOREHEADER_SIZE ? 3 : 4; unsigned long long int palette_size = (unsigned long long int)sizeof (ColorPalette) + sizeof (ARGB) * numberOfColors; /* ensure total 'palette_size' does not overflow an integer and fits inside our 2GB limit */ if (palette_size > G_MAXINT32) { return OutOfMemory; } ColorPalette *palette = GdipAlloc (palette_size); if (!palette) return OutOfMemory; palette->Flags = 0; palette->Count = numberOfColors; for (int i = 0; i < palette->Count; i++) { int size_read = gdip_read_bmp_data (pointer, buffer, colorEntrySize, source); if (size_read < colorEntrySize) { GdipFree (palette); return OutOfMemory; } set_pixel_bgra (palette->Entries, i * 4, buffer[0], buffer[1], buffer[2], 0xFF); } *result = palette; return Ok; } static GpStatus gdip_read_bmp_scans (void *pointer, BYTE *pixels, BOOL upsidedown, PixelFormat format, INT srcStride, INT destStride, INT width, INT height, ImageSource source) { BYTE *scan = (BYTE *) GdipAlloc (srcStride); if (!scan) return OutOfMemory; for (int y = 0; y < height; y++) { int currentLine = upsidedown ? height - y - 1 : y; int size_read = gdip_read_bmp_data (pointer, scan, srcStride, source); if (size_read < srcStride) { GdipFree (scan); return OutOfMemory; } BYTE *destScan = pixels + currentLine * destStride; switch (format) { case PixelFormat1bppIndexed: case PixelFormat4bppIndexed: case PixelFormat8bppIndexed: memcpy (destScan, scan, srcStride); continue; case PixelFormat16bppRGB555: { for (int x = 0; x < width; x++) { ARGB argb = gdip_getpixel_16bppRGB555 (scan, x); BYTE a = (argb & 0xFF000000) >> 24; BYTE r = (argb & 0x00FF0000) >> 16; BYTE g = (argb & 0x0000FF00) >> 8; BYTE b = (argb & 0x000000FF); gdip_setpixel_32bppARGB (destScan, x, a, r, g, b); } continue; } case PixelFormat16bppRGB565: { for (int x = 0; x < width; x++) { ARGB argb = gdip_getpixel_16bppRGB565 (scan, x); BYTE a = (argb & 0xFF000000) >> 24; BYTE r = (argb & 0x00FF0000) >> 16; BYTE g = (argb & 0x0000FF00) >> 8; BYTE b = (argb & 0x000000FF); gdip_setpixel_32bppARGB (destScan, x, a, r, g, b); } continue; } case PixelFormat24bppRGB: { for (int x = 0; x < width; x++) { gdip_setpixel_32bppARGB (destScan, x, 0xFF, scan[x * 3 + 2], scan[x * 3 + 1], scan[x * 3]); } continue; } case PixelFormat32bppRGB: { for (int x = 0; x < width; x++) { gdip_setpixel_32bppARGB (destScan, x, 0xFF, scan[x * 4 + 2], scan[x * 4 + 1], scan[x * 4]); } continue; } default: GdipFree(scan); return NotImplemented; } } GdipFree(scan); return Ok; } static GpStatus gdip_read_bmp_indexed (void *pointer, BYTE *pixels, BOOL upsidedown, PixelFormat format, INT stride, INT width, INT height, ImageSource source) { if (upsidedown) return gdip_read_bmp_scans (pointer, pixels, upsidedown, format, stride, stride, width, height, source); int size_read = gdip_read_bmp_data (pointer, pixels, stride * height, source); if (size_read < stride) return OutOfMemory; return Ok; } /* For use with in-memory bitmaps, where the BITMAPFILEHEADER doesn't exists */ GpStatus gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source) { BITMAPV5HEADER bmi; GpBitmap *result; BYTE *pixels; PixelFormat originalFormat; INT originalStride; BOOL upsidedown = TRUE; GpStatus status; unsigned long long int size; status = gdip_read_BITMAPINFOHEADER (pointer, source, &bmi, &upsidedown); if (status != Ok) return status; result = gdip_bitmap_new_with_frame (NULL, TRUE); if (!result) return OutOfMemory; status = gdip_get_bmp_pixelformat (&bmi, &originalFormat, &result->active_bitmap->pixel_format); if (status != Ok) { gdip_bitmap_dispose (result); return status; } status = gdip_get_bmp_stride (result->active_bitmap->pixel_format, bmi.bV5Width, &result->active_bitmap->stride, /* cairoHacks */ TRUE); if (status != Ok) { gdip_bitmap_dispose (result); return status; } status = gdip_get_bmp_stride (originalFormat, bmi.bV5Width, &originalStride, /* cairoHacks */ FALSE); if (status != Ok) { gdip_bitmap_dispose (result); return status; } result->type = ImageTypeBitmap; result->image_format = BMP; result->active_bitmap->width = bmi.bV5Width; result->active_bitmap->height = bmi.bV5Height; status = gdip_readbmp_palette (pointer, source, &bmi, &result->active_bitmap->palette); if (status != Ok) { gdip_bitmap_dispose (result); return status; } /* ensure total 'size' does not overflow an integer and fits inside our 2GB limit */ size = (unsigned long long int)result->active_bitmap->stride * result->active_bitmap->height; if (size > G_MAXINT32) { gdip_bitmap_dispose (result); return OutOfMemory; } pixels = GdipAlloc (size); if (!pixels) { gdip_bitmap_dispose (result); return OutOfMemory; } if (gdip_is_an_indexed_pixelformat (result->active_bitmap->pixel_format)) { if (bmi.bV5Compression == BI_RLE4) gdip_read_bmp_rle_4bit (pointer, pixels, upsidedown, result->active_bitmap->stride, result->active_bitmap->width, result->active_bitmap->height, source); else if (bmi.bV5Compression == BI_RLE8) gdip_read_bmp_rle_8bit (pointer, pixels, upsidedown, result->active_bitmap->stride, result->active_bitmap->width, result->active_bitmap->height, source); else { status = gdip_read_bmp_indexed (pointer, pixels, upsidedown, originalFormat, originalStride, result->active_bitmap->width, result->active_bitmap->height, source); if (status != Ok) { gdip_bitmap_dispose (result); return status; } } } else { status = gdip_read_bmp_scans (pointer, pixels, upsidedown, originalFormat, originalStride, result->active_bitmap->stride, result->active_bitmap->width, result->active_bitmap->height, source); if (status != Ok) { gdip_bitmap_dispose (result); return status; } } result->active_bitmap->scan0 = pixels; result->active_bitmap->reserved = GBD_OWN_SCAN0; result->active_bitmap->image_flags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize | ImageFlagsColorSpaceRGB; if (bmi.bV5XPelsPerMeter != 0 && bmi.bV5YPelsPerMeter != 0) result->active_bitmap->image_flags |= ImageFlagsHasRealDPI; *image = result; return Ok; } /* BMP read from files have a BITMAPFILEHEADER but this isn't the case for the GDI API * (e.g. displaying a bitmap) */ static void BitmapFileHeaderFromLE (BITMAPFILEHEADER *bitmapFileHeader) { #if G_BYTE_ORDER != G_LITTLE_ENDIAN bitmapFileHeader->bfType = GUINT16_FROM_LE (bitmapFileHeader->bfType); bitmapFileHeader->bfSize = GUINT32_FROM_LE (bitmapFileHeader->bfSize); bitmapFileHeader->bfReserved1 = GUINT16_FROM_LE (bitmapFileHeader->bfReserved1); bitmapFileHeader->bfReserved2 = GUINT16_FROM_LE (bitmapFileHeader->bfReserved2); bitmapFileHeader->bfOffBits = GUINT32_FROM_LE (bitmapFileHeader->bfOffBits); #endif } static GpStatus gdip_read_bmp_image_from_file_stream (void *pointer, GpImage **image, ImageSource source) { BITMAPFILEHEADER bmfh; int size_read; size_read = gdip_read_bmp_data (pointer, (BYTE *) &bmfh, sizeof (bmfh), source); if (size_read < sizeof (bmfh)) { return OutOfMemory; } BitmapFileHeaderFromLE (&bmfh); if (bmfh.bfType != BFT_BITMAP) { return UnknownImageFormat; } return gdip_read_bmp_image (pointer, image, source); } GpStatus gdip_load_bmp_image_from_file (FILE *fp, GpImage **image) { return gdip_read_bmp_image_from_file_stream ((void*)fp, image, File); } GpStatus gdip_load_bmp_image_from_stream_delegate (dstream_t *loader, GpImage **image) { return gdip_read_bmp_image_from_file_stream ((void*)loader, image, DStream); } int gdip_read_bmp_data (void *pointer, BYTE *data, int size, ImageSource source) { switch (source) { case File: return fread (data, 1, size, (FILE*) pointer); case DStream: { /* Streams are not required to return the number of bytes requested, they could return less yet our code seems to assume it will always get what it's asking for; lets loop until we get what was requested or we get an error */ int got; int total; dstream_t *loader; loader = (dstream_t *) pointer; total = 0; do { got = dstream_read (loader, data + total, size - total, 0); if (got < 1) { /* 0 = end of stream, -1 = error */ return total; } total += got; } while (total < size); return total; } case Memory: { MemorySource *ms = (MemorySource*)pointer; int len = (ms->pos + size < ms->size) ? size : ms->size - ms->pos; if (len > 0) { memcpy (data, ms->ptr + ms->pos, len); ms->pos += len; } return len; } default: return -1; } } static void gdip_write_bmp_data (void *pointer, BYTE *data, int size, BOOL useFile) { if (useFile) fwrite (data, 1, size, (FILE*) pointer); else ((PutBytesDelegate)(pointer))(data, size); } static GpStatus gdip_save_bmp_image_to_file_stream (void *pointer, GpImage *image, BOOL useFile) { BITMAPFILEHEADER bmfh; BITMAPINFOHEADER bmi; int bitmapLen; int i; ARGB color; int colours = 0; ARGB *entries; int palette_entries; ActiveBitmapData *activebmp; BYTE *scan0; activebmp = image->active_bitmap; if (activebmp->pixel_format != PixelFormat24bppRGB) { bitmapLen = activebmp->stride * activebmp->height; } else { bitmapLen = activebmp->width * 3; bitmapLen += 3; bitmapLen &= ~3; bitmapLen *= activebmp->height; } if (activebmp->palette) { colours = activebmp->palette->Count; } bmfh.bfReserved1 = bmfh.bfReserved2 = 0; bmfh.bfType = BFT_BITMAP; bmfh.bfOffBits = sizeof (BITMAPFILEHEADER) + sizeof (BITMAPINFOHEADER) + colours * sizeof (RGBQUAD); bmfh.bfSize = (bmfh.bfOffBits + bitmapLen); BitmapFileHeaderFromLE (&bmfh); gdip_write_bmp_data (pointer, (BYTE *) &bmfh, sizeof (bmfh), useFile); gdip_bitmap_fill_info_header (image, &bmi); gdip_write_bmp_data (pointer, (BYTE*) &bmi, sizeof (bmi), useFile); if (colours) { palette_entries = activebmp->palette->Count; if (activebmp->pixel_format == PixelFormat4bppIndexed) { palette_entries = 16; } entries = (ARGB *) GdipAlloc (palette_entries * sizeof (ARGB)); if (entries == NULL) return OutOfMemory; for (i = 0; i < palette_entries; i++) { color = activebmp->palette->Entries[i]; #if G_BYTE_ORDER == G_LITTLE_ENDIAN *(entries + i) = color; #else *(entries + i) = GUINT32_FROM_LE (color); #endif } gdip_write_bmp_data (pointer, (BYTE *) entries, palette_entries * sizeof (ARGB), useFile); GdipFree (entries); } scan0 = activebmp->scan0; if (activebmp->pixel_format == PixelFormat24bppRGB) { int width = activebmp->width; int height = activebmp->height; int mystride; int k; BYTE *current_line; /* rows need to be padded up to the next multiple of 4 */ mystride = width * 3; mystride += 3; mystride &= ~3; current_line = (BYTE*) GdipAlloc (mystride); if (!current_line) { return OutOfMemory; } memset (current_line, 0, mystride); /* Zero padding at the end if needed */ for (i = height - 1; i >= 0; i--) { BYTE *ptr; guint32 *iptr; iptr = (guint32 *) (scan0 + i * activebmp->stride); ptr = current_line; for (k = 0; k < width; k++) { guint32 color = *iptr++; *ptr++ = (color & 0x000000ff); *ptr++ = ((color & 0x0000ff00) >> 8); *ptr++ = ((color & 0x00ff0000) >> 16); } gdip_write_bmp_data (pointer, current_line, mystride, useFile); } GdipFree (current_line); return Ok; } /* Writes bitmap upside down. Many tools can only process bmp stored this way*/ #ifdef WORDS_BIGENDIAN if (gdip_is_an_indexed_pixelformat (activebmp->pixel_format) == FALSE) { int j; BYTE *row_pointer = GdipAlloc (activebmp->width * 4); if (row_pointer == NULL) { return OutOfMemory; } for (i = activebmp->height -1; i >= 0; i--) { for (j = 0; j < activebmp->width; j++) { row_pointer[j*4] = *((BYTE*)scan0 + (activebmp->stride * i) + (j*4) + 3); row_pointer[j*4+1] = *((BYTE*)scan0 + (activebmp->stride * i) + (j*4) + 2); row_pointer[j*4+2] = *((BYTE*)scan0 + (activebmp->stride * i) + (j*4) + 1); row_pointer[j*4+3] = *((BYTE*)scan0 + (activebmp->stride * i) + (j*4) + 0); } gdip_write_bmp_data (pointer, row_pointer, activebmp->stride, useFile); } GdipFree (row_pointer); } else #endif /* WORDS_BIGENDIAN */ for (i = activebmp->height - 1; i >= 0; i--) { gdip_write_bmp_data (pointer, scan0 + i * activebmp->stride, activebmp->stride, useFile); } return Ok; } GpStatus gdip_save_bmp_image_to_file (FILE *fp, GpImage *image) { return gdip_save_bmp_image_to_file_stream ( (void *)fp, image, TRUE); } GpStatus gdip_save_bmp_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image) { return gdip_save_bmp_image_to_file_stream ( (void *)putBytesFunc, image, FALSE); } libgdiplus-6.0.4+dfsg/src/lineargradientbrush.h0000644000175000017500000001142313542674535022331 0ustar directhexdirecthex/* * lineargradientbrush.h * * 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. * * Authors: * Ravindra (rkumar@novell.com) * Sebastien Pouliot * * Copyright (C) 2004, 2007 Novell, Inc. http://www.novell.com */ #ifndef __LINEAR_GRADIENT_H__ #define __LINEAR_GRADIENT_H__ typedef enum { LinearGradientModeHorizontal = 0, /* angle = 0 deg */ LinearGradientModeVertical = 1, /* angle = 90 deg */ LinearGradientModeForwardDiagonal = 2, /* angle = 45 deg */ LinearGradientModeBackwardDiagonal = 3 /* angle = 135 deg */ } LinearGradientMode; GpStatus WINGDIPAPI GdipCreateLineBrushI (GDIPCONST GpPoint *point1, GDIPCONST GpPoint *point2, ARGB color1, ARGB color2, GpWrapMode wrapMode, GpLineGradient **lineGradient); GpStatus WINGDIPAPI GdipCreateLineBrush (GDIPCONST GpPointF *point1, GDIPCONST GpPointF *point2, ARGB color1, ARGB color2, GpWrapMode wrapMode, GpLineGradient **lineGradient); GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI (GDIPCONST GpRect *rect, ARGB color1, ARGB color2, LinearGradientMode mode, GpWrapMode wrapMode, GpLineGradient **lineGradient); GpStatus WINGDIPAPI GdipCreateLineBrushFromRect (GDIPCONST GpRectF *rect, ARGB color1, ARGB color2, LinearGradientMode mode, GpWrapMode wrapMode, GpLineGradient **lineGradient); GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI (GDIPCONST GpRect *rect, ARGB color1, ARGB color2, REAL angle, BOOL isAngleScalable, GpWrapMode wrapMode, GpLineGradient **lineGradient); GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle (GDIPCONST GpRectF *rect, ARGB color1, ARGB color2, REAL angle, BOOL isAngleScalable, GpWrapMode wrapMode, GpLineGradient **lineGradient); GpStatus WINGDIPAPI GdipGetLineBlendCount (GpLineGradient *brush, INT *count); GpStatus WINGDIPAPI GdipSetLineBlend (GpLineGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *positions, INT count); GpStatus WINGDIPAPI GdipGetLineBlend (GpLineGradient *brush, REAL *blend, REAL *positions, INT count); GpStatus WINGDIPAPI GdipSetLineGammaCorrection (GpLineGradient *brush, BOOL useGammaCorrection); GpStatus WINGDIPAPI GdipGetLineGammaCorrection (GpLineGradient *brush, BOOL *useGammaCorrection); GpStatus WINGDIPAPI GdipGetLinePresetBlendCount (GpLineGradient *brush, INT *count); GpStatus WINGDIPAPI GdipSetLinePresetBlend (GpLineGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *positions, INT count); GpStatus WINGDIPAPI GdipGetLinePresetBlend (GpLineGradient *brush, ARGB *blend, REAL *positions, INT count); GpStatus WINGDIPAPI GdipSetLineColors (GpLineGradient *brush, ARGB color1, ARGB color2); GpStatus WINGDIPAPI GdipGetLineColors (GpLineGradient *brush, ARGB *colors); GpStatus WINGDIPAPI GdipGetLineRectI (GpLineGradient *brush, GpRect *rect); GpStatus WINGDIPAPI GdipGetLineRect (GpLineGradient * brush, GpRectF *rect); GpStatus WINGDIPAPI GdipSetLineTransform (GpLineGradient *brush, GDIPCONST GpMatrix *matrix); GpStatus WINGDIPAPI GdipGetLineTransform (GpLineGradient *brush, GpMatrix *matrix); GpStatus WINGDIPAPI GdipSetLineWrapMode (GpLineGradient *brush, GpWrapMode wrapMode); GpStatus WINGDIPAPI GdipGetLineWrapMode (GpLineGradient *brush, GpWrapMode *wrapMode); GpStatus WINGDIPAPI GdipSetLineLinearBlend (GpLineGradient *brush, REAL focus, REAL scale); GpStatus WINGDIPAPI GdipSetLineSigmaBlend (GpLineGradient *brush, REAL focus, REAL scale); GpStatus WINGDIPAPI GdipMultiplyLineTransform (GpLineGradient *brush, GpMatrix *matrix, GpMatrixOrder order); GpStatus WINGDIPAPI GdipResetLineTransform (GpLineGradient *brush); GpStatus WINGDIPAPI GdipRotateLineTransform (GpLineGradient *brush, REAL angle, GpMatrixOrder order); GpStatus WINGDIPAPI GdipScaleLineTransform (GpLineGradient *brush, REAL sx, REAL sy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipTranslateLineTransform (GpLineGradient *brush, REAL dx, REAL dy, GpMatrixOrder order); #endif libgdiplus-6.0.4+dfsg/src/font.c0000644000175000017500000010621513545154626017237 0ustar directhexdirecthex/* * Copyright (c) 2004 Ximian * Copyright (c) 2004-2007 Novell, 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. * * Authors: * Jordi Mas i Hernandez , 2004-2006 * Peter Dennis Bartok * Sebastien Pouliot * Jeffrey Stedfast */ #ifdef WIN32 #include "win32-private.h" #endif #include #include "gdiplus-private.h" #include "font-private.h" #include "fontcollection-private.h" #include "fontfamily-private.h" #include "general-private.h" #include "graphics-private.h" /* Generic fonts families */ #if GLIB_CHECK_VERSION(2,32,0) static GMutex generic; #else static GStaticMutex generic = G_STATIC_MUTEX_INIT; #endif static GpFontFamily *familySerif = NULL; static GpFontFamily *familySansSerif = NULL; static GpFontFamily *familyMonospace = NULL; static int ref_familySerif = 0; static int ref_familySansSerif = 0; static int ref_familyMonospace = 0; /* Family and collections font functions */ static void gdip_fontfamily_init (GpFontFamily *fontFamily) { fontFamily->collection = NULL; fontFamily->height = -1; fontFamily->linespacing = -1; fontFamily->celldescent = -1; fontFamily->cellascent = -1; fontFamily->pattern = NULL; fontFamily->allocated = FALSE; } static GpFontFamily * gdip_fontfamily_new () { GpFontFamily *result = (GpFontFamily *) GdipAlloc (sizeof (GpFontFamily)); if (result) gdip_fontfamily_init (result); return result; } static void gdip_font_init (GpFont *font) { font->sizeInPixels = 0; font->style = FontStyleRegular; font->face = NULL; font->family = NULL; font->emSize = 0; font->unit = UnitPixel; #ifdef USE_PANGO_RENDERING font->pango = NULL; #else font->cairofnt = NULL; #endif } static GpFont * gdip_font_new () { GpFont *result = (GpFont *) GdipAlloc (sizeof (GpFont)); if (result) gdip_font_init (result); return result; } static GpFontCollection *system_fonts = NULL; void gdip_delete_system_fonts (void) { GdipDeletePrivateFontCollection(&system_fonts); } // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipNewInstalledFontCollection (GpFontCollection **fontCollection) { if (!fontCollection) return InvalidParameter; /* * Ensure we leak this data only a single time, because: * (a) there is no API to free it; * (b) other libgdiplus structures depends on that allocated data; */ if (!system_fonts) { FcObjectSet *os = FcObjectSetBuild (FC_FAMILY, FC_FOUNDRY, NULL); FcPattern *pat = FcPatternCreate (); FcValue val; FcFontSet *col; /* Only Scalable fonts for now */ val.type = FcTypeBool; val.u.b = FcTrue; FcPatternAdd (pat, FC_SCALABLE, val, TRUE); FcObjectSetAdd (os, FC_SCALABLE); col = FcFontList (0, pat, os); FcPatternDestroy (pat); FcObjectSetDestroy (os); system_fonts = (GpFontCollection *) GdipAlloc (sizeof (GpFontCollection)); if (!system_fonts) return OutOfMemory; system_fonts->fontset = col; system_fonts->config = NULL; #if USE_PANGO_RENDERING system_fonts->pango_font_map = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT); #endif } *fontCollection = system_fonts; return Ok; } // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipNewPrivateFontCollection (GpFontCollection **fontCollection) { GpFontCollection *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!fontCollection) return InvalidParameter; result = (GpFontCollection *) GdipAlloc (sizeof (GpFontCollection)); if (!result) return OutOfMemory; result->fontset = NULL; result->config = FcConfigCreate (); #if USE_PANGO_RENDERING result->pango_font_map = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT); pango_fc_font_map_set_config ((PangoFcFontMap *)result->pango_font_map, result->config); #endif *fontCollection = result; return Ok; } // coverity[+free : arg-0] GpStatus GdipDeletePrivateFontCollection (GpFontCollection **fontCollection) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!fontCollection) return InvalidParameter; if (*fontCollection) { #if USE_PANGO_RENDERING if ((*fontCollection)->pango_font_map != NULL) { g_object_unref ((*fontCollection)->pango_font_map); (*fontCollection)->pango_font_map = NULL; } #endif if ((*fontCollection)->fontset != NULL) { FcFontSetDestroy ((*fontCollection)->fontset); (*fontCollection)->fontset = NULL; } if ((*fontCollection)->config != NULL) { FcConfigDestroy ((*fontCollection)->config); (*fontCollection)->config = NULL; } GdipFree (*fontCollection); } *fontCollection = NULL; return Ok; } GpStatus WINGDIPAPI GdipPrivateAddFontFile (GpFontCollection *fontCollection, GDIPCONST WCHAR *filename) { BYTE *file; FILE *fileHandle; if (!fontCollection || !filename) return InvalidParameter; file = (BYTE*) utf16_to_utf8 ((const gunichar2 *)filename, -1); if (!file) return OutOfMemory; fileHandle = fopen ((char *)file, "r"); if (!fileHandle) { GdipFree (file); return FileNotFound; } fclose (fileHandle); FcConfigAppFontAddFile (fontCollection->config, file); GdipFree (file); return Ok; } GpStatus WINGDIPAPI GdipCloneFontFamily (GpFontFamily *fontFamily, GpFontFamily **clonedFontFamily) { GpFontFamily *result; if (!fontFamily || !clonedFontFamily) return InvalidParameter; result = gdip_fontfamily_new (); if (!result) return OutOfMemory; result->collection = fontFamily->collection; result->height = fontFamily->height; result->linespacing = fontFamily->linespacing; result->celldescent = fontFamily->celldescent; result->cellascent = fontFamily->cellascent; if (fontFamily->pattern) { result->pattern = FcPatternDuplicate (fontFamily->pattern); result->allocated = TRUE; } *clonedFontFamily = result; return Ok; } GpStatus WINGDIPAPI GdipDeleteFontFamily (GpFontFamily *fontFamily) { BOOL delete = TRUE; if (!fontFamily) return InvalidParameter; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_lock (&generic); #else g_static_mutex_lock (&generic); #endif if (fontFamily == familySerif) { ref_familySerif--; if (ref_familySerif) delete = FALSE; else familySerif = NULL; } if (fontFamily == familySansSerif) { ref_familySansSerif--; if (ref_familySansSerif) delete = FALSE; else familySansSerif = NULL; } if (fontFamily == familyMonospace) { ref_familyMonospace--; if (ref_familyMonospace) delete = FALSE; else familyMonospace = NULL; } #if GLIB_CHECK_VERSION(2,32,0) g_mutex_unlock (&generic); #else g_static_mutex_unlock (&generic); #endif if (delete) { if (fontFamily->allocated) { FcPatternDestroy (fontFamily->pattern); fontFamily->pattern = NULL; } GdipFree (fontFamily); } return Ok; } static void gdip_createPrivateFontSet (GpFontCollection *font_collection) { FcObjectSet *os = FcObjectSetBuild (FC_FAMILY, FC_FOUNDRY, FC_FILE, NULL); FcPattern *pat = FcPatternCreate (); FcFontSet *col = FcFontList (font_collection->config, pat, os); if (font_collection->fontset) FcFontSetDestroy (font_collection->fontset); FcPatternDestroy (pat); FcObjectSetDestroy (os); font_collection->fontset = col; } GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount (GpFontCollection *fontCollection, INT *numFound) { if (!fontCollection || !numFound) return InvalidParameter; if (fontCollection->config) gdip_createPrivateFontSet (fontCollection); if (fontCollection->fontset) *numFound = fontCollection->fontset->nfont; else *numFound = 0; return Ok; } GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList (GpFontCollection *fontCollection, INT numSought, GpFontFamily *gpfamilies[], INT *numFound) { int i; if (!fontCollection || !gpfamilies || !numFound) return InvalidParameter; if (fontCollection->config) gdip_createPrivateFontSet (fontCollection); for (i = 0; i < numSought && i < fontCollection->fontset->nfont; i++) { gpfamilies[i] = gdip_fontfamily_new (); if (!gpfamilies[i]) { while (--i >= 0) { GdipFree (gpfamilies[i]); gpfamilies[i] = NULL; } return OutOfMemory; } gpfamilies[i]->collection = fontCollection; gpfamilies[i]->pattern = fontCollection->fontset->fonts[i]; gpfamilies[i]->allocated = FALSE; } *numFound = i; return Ok; } static GpStatus gdip_status_from_fontconfig (FcResult result) { switch (result) { case FcResultMatch: return Ok; case FcResultNoMatch: case FcResultTypeMismatch: case FcResultNoId: return FontFamilyNotFound; default: return GenericError; } } /* note: MUST be executed inside a lock because FcConfig isn't thread-safe */ static FcPattern* create_pattern_from_name (char* name) { FcValue val; /* FcResult must be initialized because it's changed only in error conditions */ FcResult rlt = FcResultMatch; FcPattern *full_pattern = NULL; FcPattern *name_pattern = FcPatternCreate (); if (!name_pattern) return NULL; /* find the family we want */ val.type = FcTypeString; val.u.s = (BYTE*)name; if (!FcPatternAdd (name_pattern, FC_FAMILY, val, TRUE)) { FcPatternDestroy (name_pattern); return NULL; } if (!FcConfigSubstitute (0, name_pattern, FcMatchPattern)) { FcPatternDestroy (name_pattern); return NULL; } FcDefaultSubstitute (name_pattern); full_pattern = FcFontMatch (0, name_pattern, &rlt); if (gdip_status_from_fontconfig (rlt) == Ok) { if (full_pattern == NULL) { full_pattern = name_pattern; } else { FcPatternDestroy (name_pattern); } } else { FcPatternDestroy (name_pattern); if (full_pattern) { FcPatternDestroy (full_pattern); full_pattern = NULL; } } return full_pattern; } #if GLIB_CHECK_VERSION(2,32,0) static GMutex patterns_mutex; #else static GStaticMutex patterns_mutex = G_STATIC_MUTEX_INIT; #endif static GHashTable *patterns_hashtable = NULL; static GpStatus create_fontfamily_from_name (char* name, GpFontFamily **fontFamily) { GpStatus status; GpFontFamily *ff = NULL; FcPattern *pat = NULL; GpFontCollection *font_collection; status = GdipNewInstalledFontCollection (&font_collection); if (status != Ok) { return status; } status = FontFamilyNotFound; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_lock (&patterns_mutex); #else g_static_mutex_lock (&patterns_mutex); #endif if (patterns_hashtable) { pat = (FcPattern*) g_hash_table_lookup (patterns_hashtable, name); } else { patterns_hashtable = g_hash_table_new (g_str_hash, g_str_equal); } if (!pat) { pat = create_pattern_from_name (name); if (pat) { /* create the pattern and store it for further usage */ g_hash_table_insert (patterns_hashtable, g_strdup (name), pat); } } if (pat) { ff = gdip_fontfamily_new (); if (ff) { ff->pattern = pat; ff->allocated = FALSE; ff->collection = font_collection; status = Ok; } else status = OutOfMemory; } *fontFamily = ff; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_unlock (&patterns_mutex); #else g_static_mutex_unlock (&patterns_mutex); #endif return status; } static BOOL free_cached_pattern (gpointer key, gpointer value, gpointer user) { g_free (key); FcPatternDestroy ((FcPattern*) value); return TRUE; } void gdip_font_clear_pattern_cache (void) { #if GLIB_CHECK_VERSION(2,32,0) g_mutex_lock (&patterns_mutex); #else g_static_mutex_lock (&patterns_mutex); #endif if (patterns_hashtable) { g_hash_table_foreach_remove (patterns_hashtable, free_cached_pattern, NULL); g_hash_table_destroy (patterns_hashtable); } #if GLIB_CHECK_VERSION(2,32,0) g_mutex_unlock (&patterns_mutex); #else g_static_mutex_unlock (&patterns_mutex); #endif } static GpStatus create_fontfamily_from_collection (char* name, GpFontCollection *font_collection, GpFontFamily **fontFamily) { /* note: fontset can be NULL when we supply an empty private collection */ if (font_collection->fontset) { int i; FcChar8 *str; FcPattern **gpfam = font_collection->fontset->fonts; for (i=0; i < font_collection->fontset->nfont; gpfam++, i++) { FcResult rlt = FcPatternGetString (*gpfam, FC_FAMILY, 0, &str); GpStatus status = gdip_status_from_fontconfig (rlt); if (status != Ok) return status; if (strcmp ((char *)name, (const char *)str) == 0) { GpFontFamily *result = gdip_fontfamily_new (); if (!result) return OutOfMemory; result->pattern = *gpfam; result->allocated = FALSE; result->collection = font_collection; *fontFamily = result; return Ok; } } } return FontFamilyNotFound; } // coverity[+alloc : arg-*2] GpStatus WINGDIPAPI GdipCreateFontFamilyFromName (GDIPCONST WCHAR *name, GpFontCollection *font_collection, GpFontFamily **fontFamily) { GpStatus status; char *string; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!name || !fontFamily) return InvalidParameter; string = (char*)utf16_to_utf8 ((const gunichar2 *)name, -1); if (!string) return OutOfMemory; if (font_collection) { if (font_collection->config) gdip_createPrivateFontSet (font_collection); status = create_fontfamily_from_collection (string, font_collection, fontFamily); } else { status = create_fontfamily_from_name (string, fontFamily); } GdipFree (string); return status; } GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *family, WCHAR name[LF_FACESIZE], LANGID language) { GpStatus status; FcChar8 *fc_str; FcResult r; if (!family) return InvalidParameter; if (!name) return Ok; r = FcPatternGetString (family->pattern, FC_FAMILY, 0, &fc_str); status = gdip_status_from_fontconfig (r); if (status != Ok) return status; utf8_to_ucs2((const gchar *)fc_str, (gunichar2 *)name, LF_FACESIZE); return Ok; } // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif (GpFontFamily **nativeFamily) { const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ', 'S','e','r','i','f', 0}; GpStatus status = Ok; if (!nativeFamily) return InvalidParameter; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_lock (&generic); #else g_static_mutex_lock (&generic); #endif if (ref_familySansSerif == 0) status = GdipCreateFontFamilyFromName (MSSansSerif, NULL, &familySansSerif); if (status == Ok) ref_familySansSerif++; else familySansSerif = NULL; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_unlock (&generic); #else g_static_mutex_unlock (&generic); #endif *nativeFamily = familySansSerif; return status; } // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif (GpFontFamily **nativeFamily) { const WCHAR Serif[] = {'S','e','r','i','f', 0}; GpStatus status = Ok; if (!nativeFamily) return InvalidParameter; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_lock (&generic); #else g_static_mutex_lock (&generic); #endif if (ref_familySerif == 0) status = GdipCreateFontFamilyFromName (Serif, NULL, &familySerif); if (status == Ok) ref_familySerif++; else familySerif = NULL; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_unlock (&generic); #else g_static_mutex_unlock (&generic); #endif *nativeFamily = familySerif; return status; } // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace (GpFontFamily **nativeFamily) { const WCHAR Monospace[] = {'C','o','u','r','i', 'e', 'r', ' ', 'N', 'e', 'w', 0}; GpStatus status = Ok; if (!nativeFamily) return InvalidParameter; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_lock (&generic); #else g_static_mutex_lock (&generic); #endif if (ref_familyMonospace == 0) status = GdipCreateFontFamilyFromName (Monospace, NULL, &familyMonospace); if (status == Ok) ref_familyMonospace++; else familyMonospace = NULL; #if GLIB_CHECK_VERSION(2,32,0) g_mutex_unlock (&generic); #else g_static_mutex_unlock (&generic); #endif *nativeFamily = familyMonospace; return status; } /* OpenType's OS/2 fsSelection Table: * * http://www.microsoft.com/typography/otspec/os2.htm#fss */ enum fsSelection { fsSelectionItalic = (1 << 0), fsSelectionUnderscore = (1 << 1), fsSelectionNegative = (1 << 2), fsSelectionOutlined = (1 << 3), fsSelectionStrikeout = (1 << 4), fsSelectionBold = (1 << 5), fsSelectionRegular = (1 << 6), fsSelectionUseTypoMetrics = (1 << 7), fsSelectionWWS = (1 << 8), fsSelectionOblique = (1 << 9), }; #if defined(PANGO_VERSION_CHECK) #if PANGO_VERSION_CHECK(1,44,0) #define PANGO_DEPRECATED_FREETYPE_DEPENDENCY #endif #endif #if !defined(USE_PANGO_RENDERING) || !defined (PANGO_DEPRECATED_FREETYPE_DEPENDENCY) static void gdip_get_fontfamily_details_from_freetype (GpFontFamily *family, FT_Face face) { if (FT_IS_SFNT (face)) { TT_HoriHeader *hhea = FT_Get_Sfnt_Table (face, ft_sfnt_hhea); TT_OS2 *os2 = FT_Get_Sfnt_Table (face, ft_sfnt_os2); if (os2 && (os2->fsSelection & fsSelectionUseTypoMetrics)) { /* Use the typographic Ascender, Descender, and LineGap values for everything. */ family->linespacing = os2->sTypoAscender - os2->sTypoDescender + os2->sTypoLineGap; family->celldescent = -os2->sTypoDescender; family->cellascent = os2->sTypoAscender; } else { /* Calculate the LineSpacing for both the hhea table and the OS/2 table. */ int hhea_linespacing = hhea->Ascender + abs (hhea->Descender) + hhea->Line_Gap; int os2_linespacing = os2 ? (os2->usWinAscent + os2->usWinDescent) : 0; /* The LineSpacing is the maximum of the two sumations. */ family->linespacing = MAX (hhea_linespacing, os2_linespacing); /* If the OS/2 table exists, use usWinDescent as the * CellDescent. Otherwise use hhea's Descender value. */ family->celldescent = os2 ? os2->usWinDescent : hhea->Descender; /* If the OS/2 table exists, use usWinAscent as the * CellAscent. Otherwise use hhea's Ascender value. */ family->cellascent = os2 ? os2->usWinAscent : hhea->Ascender; } } else { /* Fall back to using whatever FreeType2 provides. */ family->celldescent = -face->descender; family->cellascent = face->ascender; family->linespacing = face->height; } family->height = face->units_per_EM; } #endif #ifdef USE_PANGO_RENDERING PangoFontDescription* gdip_get_pango_font_description (GpFont *font) { if (!font->pango) { font->pango = pango_font_description_new (); pango_font_description_set_family (font->pango, (char *)font->face); float sizeInPoints = gdip_unit_conversion (font->unit, UnitPoint, gdip_get_display_dpi(), gtMemoryBitmap, font->emSize); pango_font_description_set_size (font->pango, sizeInPoints * PANGO_SCALE); if (font->style & FontStyleBold) pango_font_description_set_weight (font->pango, PANGO_WEIGHT_BOLD); if (font->style & FontStyleItalic) pango_font_description_set_style (font->pango, PANGO_STYLE_ITALIC); } return font->pango; } #ifdef PANGO_DEPRECATED_FREETYPE_DEPENDENCY static void gdip_get_fontfamily_details_from_harfbuzz (GpFontFamily *family, hb_font_t *font) { hb_font_extents_t font_extents; hb_font_get_extents_for_direction (font, HB_DIRECTION_LTR, &font_extents); family->celldescent = -font_extents.descender; family->cellascent = font_extents.ascender; family->linespacing = family->cellascent + family->celldescent + font_extents.line_gap; family->height = hb_face_get_upem (hb_font_get_face (font)); } #endif static GpStatus gdip_get_fontfamily_details (GpFontFamily *family, FontStyle style) { GpFont *font; GpStatus status = GdipCreateFont (family, 8.0f, style, UnitPoint, &font); if (status != Ok) return status; status = FontFamilyNotFound; PangoFontMap *map = family->collection->pango_font_map; #if PANGO_VERSION_CHECK(1,22,0) PangoContext *context = pango_font_map_create_context (PANGO_FONT_MAP (map)); #else PangoContext *context = pango_cairo_font_map_create_context ((PangoCairoFontMap*)map); #endif PangoFont *pf = pango_font_map_load_font (map, context, gdip_get_pango_font_description (font)); if (pf) { #ifdef PANGO_DEPRECATED_FREETYPE_DEPENDENCY hb_font_t *hb_font = pango_font_get_hb_font (pf); if (hb_font) { gdip_get_fontfamily_details_from_harfbuzz (family, hb_font); status = Ok; } #else FT_Face face = pango_fc_font_lock_face ((PangoFcFont*)pf); if (face) { gdip_get_fontfamily_details_from_freetype (family, face); pango_fc_font_unlock_face ((PangoFcFont*)pf); status = Ok; } #endif g_object_unref (pf); } g_object_unref (context); GdipDeleteFont (font); return status; } #else cairo_font_face_t* gdip_get_cairo_font_face (GpFont *font) { if (!font->cairofnt) { FcPattern *pattern = FcPatternBuild ( FcPatternDuplicate (font->family->pattern), FC_SLANT, FcTypeInteger, ((font->style & FontStyleItalic) ? FC_SLANT_ITALIC : FC_SLANT_ROMAN), FC_WEIGHT, FcTypeInteger, ((font->style & FontStyleBold) ? FC_WEIGHT_BOLD : FC_WEIGHT_MEDIUM), NULL); font->cairofnt = cairo_ft_font_face_create_for_pattern (pattern); cairo_font_face_reference (font->cairofnt); FcPatternDestroy (pattern); } return font->cairofnt; } static GpStatus gdip_get_fontfamily_details (GpFontFamily *family, FontStyle style) { GpFont *font; GpStatus status = GdipCreateFont (family, 0.1f, style, UnitPoint, &font); if (status != Ok) return status; cairo_scaled_font_t* scaled_ft; FT_Face face = NULL; cairo_matrix_t matrix1, matrix2; cairo_font_options_t *options = cairo_font_options_create (); cairo_font_face_t* cairofnt = gdip_get_cairo_font_face (font); cairo_matrix_init (&matrix1, 1, 0, 0, 1, 0, 0); cairo_matrix_init (&matrix2, 1, 0, 0, 1, 0, 0); scaled_ft = cairo_scaled_font_create (cairofnt, &matrix1, &matrix2, options); /* a missing fonts.conf will resuls in a NULL *scaled_ft (#78237) */ if (!scaled_ft) { static int flag = 0; if (flag == 0) { g_warning ("couldn't lock the font face. this may be due to a missing fonts.conf on the system."); flag = 1; } status = FontFamilyNotFound; } if (status == Ok) face = cairo_ft_scaled_font_lock_face (scaled_ft); cairo_font_options_destroy (options); if (face) { gdip_get_fontfamily_details_from_freetype (family, face); cairo_ft_scaled_font_unlock_face (scaled_ft); cairo_scaled_font_destroy (scaled_ft); } else { status = FontFamilyNotFound; } GdipDeleteFont (font); return status; } #endif GpStatus WINGDIPAPI GdipGetEmHeight (GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight) { GpStatus status; if (!family || !EmHeight) return InvalidParameter; if (family->height == -1) { status = gdip_get_fontfamily_details ((GpFontFamily *) family, style); if (status != Ok) return status; } *EmHeight = family->height; return Ok; } GpStatus WINGDIPAPI GdipGetCellAscent (GDIPCONST GpFontFamily *family, INT style, UINT16 *CellAscent) { GpStatus status; if (!family || !CellAscent) return InvalidParameter; if (family->cellascent == -1) { status = gdip_get_fontfamily_details ((GpFontFamily *) family, style); if (status != Ok) return status; } *CellAscent = family->cellascent; return Ok; } GpStatus WINGDIPAPI GdipGetCellDescent (GDIPCONST GpFontFamily *family, INT style, UINT16 *CellDescent) { GpStatus status; if (!family || !CellDescent) return InvalidParameter; if (family->celldescent == -1) { status = gdip_get_fontfamily_details ((GpFontFamily *) family, style); if (status != Ok) return status; } *CellDescent = family->celldescent; return Ok; } GpStatus WINGDIPAPI GdipGetLineSpacing (GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing) { GpStatus status; if (!family || !LineSpacing) return InvalidParameter; if (family->linespacing == -1) { status = gdip_get_fontfamily_details ((GpFontFamily *) family, style); if (status != Ok) return status; } *LineSpacing = family->linespacing; return Ok; } GpStatus WINGDIPAPI GdipIsStyleAvailable (GDIPCONST GpFontFamily *family, INT style, BOOL *IsStyleAvailable) { if (!family || !IsStyleAvailable) return InvalidParameter; *IsStyleAvailable = TRUE; return Ok; } /* Font functions */ GpStatus gdip_create_font_without_validation (GDIPCONST GpFontFamily *family, REAL emSize, INT style, Unit unit, GpFont **font) { GpStatus status; FcChar8* str; FcResult r; GpFont *result; REAL sizeInPixels; r = FcPatternGetString (family->pattern, FC_FAMILY, 0, &str); status = gdip_status_from_fontconfig (r); if (status != Ok) return status; sizeInPixels = gdip_unit_conversion (unit, UnitPixel, gdip_get_display_dpi(), gtMemoryBitmap, emSize); result = gdip_font_new (); if (!result) return OutOfMemory; result->sizeInPixels = sizeInPixels; result->face = GdipAlloc (strlen ((char *) str) + 1); if (!result->face) { GdipDeleteFont (result); return OutOfMemory; } memcpy (result->face, str, strlen ((char *) str) + 1); result->style = style; result->emSize = emSize; result->unit = unit; status = GdipCloneFontFamily ((GpFontFamily *) family, &result->family); if (status != Ok) { GdipDeleteFont (result); return OutOfMemory; } result->style = style; #ifndef USE_PANGO_RENDERING gdip_get_cairo_font_face (result); #endif *font = result; return Ok; } // coverity[+alloc : arg-*4] GpStatus GdipCreateFont (GDIPCONST GpFontFamily *family, REAL emSize, INT style, Unit unit, GpFont **font) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!family || !font || unit == UnitDisplay || unit < UnitWorld || unit > UnitCairoPoint || emSize <= 0) return InvalidParameter; return gdip_create_font_without_validation (family, emSize, style, unit, font); } GpStatus WINGDIPAPI GdipCloneFont (GpFont* font, GpFont** cloneFont) { GpFont *result; GpStatus status; if (!font || !cloneFont) return InvalidParameter; result = gdip_font_new (); if (!result) return OutOfMemory; result->sizeInPixels = font->sizeInPixels; result->style = font->style; result->emSize = font->emSize; result->unit = font->unit; result->face = (unsigned char *) g_strdup ((char *)font->face); if (!result->face) { GdipDeleteFont (result); return OutOfMemory; } status = GdipCloneFontFamily (font->family, &result->family); if (status != Ok) { GdipDeleteFont (result); return OutOfMemory; } #ifndef USE_PANGO_RENDERING gdip_get_cairo_font_face (result); #endif *cloneFont = result; return Ok; } GpStatus WINGDIPAPI GdipDeleteFont (GpFont* font) { if (!font) return InvalidParameter; if (font->family) { GdipDeleteFontFamily (font->family); font->family = NULL; } #ifdef USE_PANGO_RENDERING if (font->pango) { pango_font_description_free (font->pango); font->pango = NULL; } #else if (font->cairofnt) { cairo_font_face_destroy (font->cairofnt); font->cairofnt = NULL; } #endif if (font->face) { GdipFree (font->face); font->face = NULL; } GdipFree (font); return Ok; } GpStatus WINGDIPAPI GdipCreateFontFromDC (HDC hdc, GpFont **font) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!hdc || !font) return InvalidParameter; return NotImplemented; } static GpStatus gdip_logfont_from_font (GpFont *font, GpGraphics *graphics, void *lf, BOOL ucs2) { LOGFONTA *logFont; if (!lf) return InvalidParameter; logFont = (LOGFONTA *)lf; /* will be changed back to 1 inside System.Drawing */ logFont->lfCharSet = 0; if (!font || !graphics) { int size = (ucs2) ? 2 * LF_FACESIZE : LF_FACESIZE; memset (logFont->lfFaceName, 0, size); return InvalidParameter; } logFont->lfHeight = -(font->sizeInPixels); logFont->lfWidth = 0; logFont->lfEscapement = 0; // FIXME logFont->lfOrientation = logFont->lfEscapement; if (font->style & FontStyleBold) { logFont->lfWeight = 700; } else { logFont->lfWeight = 400; } if (font->style & FontStyleItalic) { logFont->lfItalic = 1; } else { logFont->lfItalic = 0; } if (font->style & FontStyleUnderline) { logFont->lfUnderline = 1; } else { logFont->lfUnderline = 0; } if (font->style & FontStyleStrikeout) { logFont->lfStrikeOut = 1; } else { logFont->lfStrikeOut = 0; } logFont->lfOutPrecision = 0; logFont->lfClipPrecision = 0; switch (graphics->text_mode) { case TextRenderingHintSystemDefault: { logFont->lfQuality = 0; break; } case TextRenderingHintSingleBitPerPixelGridFit: case TextRenderingHintSingleBitPerPixel: case TextRenderingHintAntiAliasGridFit: case TextRenderingHintAntiAlias: { logFont->lfQuality = 3; // ANTIALIASED_QUALITY; break; } case TextRenderingHintClearTypeGridFit: { logFont->lfQuality = 5; // CLEARTYPE_QUALITY break; } } logFont->lfPitchAndFamily = 0; if (ucs2) { utf8_to_ucs2 ((const gchar *) font->face, (gunichar2 *) logFont->lfFaceName, LF_FACESIZE); } else { int len = strlen ((char *) font->face); memset (logFont->lfFaceName, 0, LF_FACESIZE); memcpy (logFont->lfFaceName, font->face, len < LF_FACESIZE ? len : LF_FACESIZE - 1); } return Ok; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCreateFontFromHfontA (HFONT hfont, GpFont **font, void *lf) { GpStatus status; GpFont *src_font; GpFont *result; if (!gdiplusInitialized) return GdiplusNotInitialized; src_font = (GpFont *)hfont; result = gdip_font_new (); if (!result) return OutOfMemory; result->sizeInPixels = src_font->sizeInPixels; result->style = src_font->style; status = GdipCloneFontFamily (src_font->family, &result->family); if (!status) { GdipDeleteFont (result); return OutOfMemory; } result->style = src_font->style; result->emSize = src_font->emSize; result->unit = src_font->unit; result->face = GdipAlloc(strlen ((char *) src_font->face) + 1); if (!result->face) { GdipDeleteFont (result); return OutOfMemory; } memcpy(result->face, src_font->face, strlen((char *)src_font->face) + 1); *font = result; return gdip_logfont_from_font (result, NULL, lf, FALSE); } GpStatus WINGDIPAPI GdipGetLogFontW (GpFont *font, GpGraphics *graphics, LOGFONTW *logfontW) { return gdip_logfont_from_font (font, graphics, logfontW, TRUE); } GpStatus WINGDIPAPI GdipGetLogFontA (GpFont *font, GpGraphics *graphics, LOGFONTA *logfontA) { return gdip_logfont_from_font (font, graphics, logfontA, FALSE); } static GpStatus gdip_create_font_from_logfont (HDC hdc, void *lf, GpFont **font, BOOL ucs2) { GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!hdc || !lf || !font) return InvalidParameter; GpFont *result = gdip_font_new (); if (!result) return OutOfMemory; LOGFONTA *logfont = (LOGFONTA *)lf; if (logfont->lfHeight < 0) { result->sizeInPixels = abs (logfont->lfHeight); } else { result->sizeInPixels = logfont->lfHeight; // Fixme - convert units } result->style = 0; /* Fixme - this is wrong, but I don't know of a quick way to get the emSize */ result->emSize = result->sizeInPixels; result->unit = UnitWorld; if (logfont->lfItalic) { result->style |= FontStyleItalic; } if (logfont->lfWeight > 400) { result->style |= FontStyleBold; } if (logfont->lfUnderline) { result->style |= FontStyleUnderline; } if (logfont->lfStrikeOut) { result->style |= FontStyleStrikeout; } if (ucs2) { result->face = (BYTE*) utf16_to_utf8 ((WCHAR *) logfont->lfFaceName, -1); if (!result->face){ GdipDeleteFont (result); return OutOfMemory; } } else { result->face = GdipAlloc (LF_FACESIZE); if (!result->face){ GdipDeleteFont (result); return OutOfMemory; } memcpy(result->face, logfont->lfFaceName, LF_FACESIZE); result->face[LF_FACESIZE - 1] = '\0'; } status = create_fontfamily_from_name ((char *) result->face, &result->family); if (status == OutOfMemory) { GdipDeleteFont (result); return status; } *font = result; return Ok; } // coverity[+alloc : arg-*2] GpStatus GdipCreateFontFromLogfontA(HDC hdc, GDIPCONST LOGFONTA *logfont, GpFont **font) { return gdip_create_font_from_logfont (hdc, (void *)logfont, font, FALSE); } // coverity[+alloc : arg-*2] GpStatus GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font) { return gdip_create_font_from_logfont (hdc, (void *)logfont, font, TRUE); } GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length) { FcChar8 fontfile[256]; #ifdef WIN32 FILE *f; #else int f; #endif if (!fontCollection || !memory) return InvalidParameter; if (length <= 0) return InvalidParameter; #ifdef WIN32 f = CreateTempFile (fontfile); if (!f) return FileNotFound; if (fwrite(memory, sizeof(BYTE), length, f) != length) { fclose (f); return FileNotFound; } fclose (f); #else strcpy ((char *) fontfile, "/tmp/ffXXXXXX"); f = mkstemp ((char *) fontfile); if (f == -1) return FileNotFound; if (write (f, memory, length) != length) { close (f); return FileNotFound; } close (f); #endif FcConfigAppFontAddFile (fontCollection->config, fontfile); /* FIXME - May we delete our temporary font file or does FcConfigAppFontAddFile just reference our file? */ /* unlink(fontfile); */ return Ok; } GpStatus WINGDIPAPI GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height) { GpStatus status; UINT16 emHeight, lineSpacing; REAL emSize, h; if (!font || !height) return InvalidParameter; status = GdipGetEmHeight (font->family, font->style, &emHeight); if (status != Ok) return status; status = GdipGetLineSpacing (font->family, font->style, &lineSpacing); if (status != Ok) return status; /* Operations in display dpi's */ emSize = gdip_unit_conversion (font->unit, UnitPixel, gdip_get_display_dpi (), gtMemoryBitmap, font->emSize); h = lineSpacing * (emSize / emHeight); if (!graphics) *height = h; else *height = gdip_unit_conversion (UnitPixel, graphics->page_unit, gdip_get_display_dpi (), graphics->type, h); return Ok; } GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, REAL dpi, REAL *height) { GpStatus status; UINT16 emHeight, lineSpacing; REAL h; if (!font || !height) return InvalidParameter; status = GdipGetEmHeight (font->family, font->style, &emHeight); if (status != Ok) return status; status = GdipGetLineSpacing (font->family, font->style, &lineSpacing); if (status != Ok) return status; h = lineSpacing * (font->emSize / emHeight); *height = gdip_unit_conversion (font->unit, UnitInch, dpi, gtMemoryBitmap, h) * dpi; return Ok; } GpStatus WINGDIPAPI GdipGetFontSize (GpFont *font, REAL *size) { if (!font ||!size) return InvalidParameter; *size = font->emSize; return Ok; } GpStatus WINGDIPAPI GdipGetFontStyle (GpFont *font, INT *style) { if (!font || !style) return InvalidParameter; *style = font->style; return Ok; } GpStatus WINGDIPAPI GdipGetFontUnit (GpFont *font, Unit *unit) { if (!font || !unit) return InvalidParameter; *unit = font->unit; return Ok; } GpStatus WINGDIPAPI GdipGetFamily (GpFont *font, GpFontFamily **family) { if (!font || !family) return InvalidParameter; return GdipCloneFontFamily (font->family, family); } libgdiplus-6.0.4+dfsg/src/text-pango.c0000644000175000017500000006114213542674535020361 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "gdiplus-private.h" #ifdef USE_PANGO_RENDERING #include "text-pango-private.h" #include "graphics-private.h" #include "graphics-cairo-private.h" #include "brush-private.h" #include "font-private.h" #include "fontfamily-private.h" #include "fontcollection-private.h" int utf8_length_for_utf16_string (GDIPCONST WCHAR *stringUnicode, int offset, int length) { int utf8_length = 0; int end = offset + length; int i; for (i = offset; i < end; ++i) { unsigned short ch = (unsigned short)stringUnicode[i]; if (ch < 0x80) utf8_length += 1; else if (ch < 0x800) utf8_length += 2; else if (ch < 0xD800 || ch >= 0xE000) utf8_length += 3; else utf8_length += 4; } return utf8_length; } /* * NOTE: all parameter's validations are done inside text.c */ static PangoAttrList* gdip_get_layout_attributes (PangoLayout *layout) { PangoAttrList *list = pango_layout_get_attributes (layout); if (!list) list = pango_attr_list_new (); else pango_attr_list_ref (list); return list; } void gdip_set_array_values (int *array, int value, int num) { int i; for (i = 0; i < num; i++) array [i] = value; } static GString * gdip_process_string (gchar *text, int length, int removeAccelerators, int trimSpace, PangoAttrList *list, int **charsRemoved) { int c, j, r; int nonws = 0; gchar *iter; gchar *iter2; gunichar ch; GString *res = g_string_sized_new (length); /* fast version: just check for final newline and remove */ if (!removeAccelerators && !trimSpace) { j = length; if (j > 0 && text [j-1] == '\n') { j--; if (j > 0 && text [j-1] == '\r') j--; } g_string_append_len (res, text, j); if (j == 0 && length > 0) { g_string_append_c (res, ' '); j++; } if (charsRemoved && *charsRemoved) { int prevj = (g_utf8_prev_char (res->str + j) - res->str); gdip_set_array_values (*charsRemoved + prevj, length - j, j - prevj); } return res; } iter = text; // c: Characters handled in the inner loop, that might be removed. j = 0; // Index in output r = 0; // Characters removed while (iter - text < length) { ch = g_utf8_get_char (iter); if (ch == GDIP_WINDOWS_ACCELERATOR && removeAccelerators && (iter - text < length - 1)) { nonws = 1; iter2 = g_utf8_next_char (iter); iter = iter2; r++; ch = g_utf8_get_char (iter); /* add an attribute on the next character */ if (list && (iter - text < length) && (ch != GDIP_WINDOWS_ACCELERATOR)) { PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_LOW); attr->start_index = j; attr->end_index = j + g_utf8_next_char (iter) - iter; pango_attr_list_insert (list, attr); } } else if (!g_unichar_isspace (ch)) { nonws = 1; } else if (trimSpace && ch != '\r' && ch != '\n') { /* unless specified we don't consider the trailing spaces, unless there is just one space (#80680) */ c = 1; for (iter2 = g_utf8_next_char (iter); iter2 - text < length; iter2 = g_utf8_next_char (iter2)) { ch = g_utf8_get_char (iter2); if (ch == '\r' || ch == '\n') break; if (!g_unichar_isspace (ch)) { c = 0; g_string_append_len (res, iter, iter2 - iter); if (charsRemoved && *charsRemoved) gdip_set_array_values ((*charsRemoved)+j, r, iter2 - iter); j += iter2 - iter; break; } c++; } r += c; iter = iter2; continue; } else if ((ch == '\r' && (iter - text == length - 2) && (*g_utf8_next_char (iter) == '\n')) || (ch == '\n' && iter - text == length - 1)) { /* in any case, ignore a final newline as pango will add an extra line to the measurement while gdi+ does not */ r += length - (iter - text); break; } iter2 = g_utf8_next_char (iter); g_string_append_len (res, iter, iter2 - iter); /* save these for string lengths later */ if (charsRemoved && *charsRemoved) gdip_set_array_values ((*charsRemoved)+j, r, iter2 - iter); j += iter2 - iter; iter = iter2; } /* always ensure that at least one space is measured */ if (!nonws && trimSpace && length > 0) { iter = text; iter2 = g_utf8_next_char (iter); g_string_append_len (res, iter, iter2 - iter); j += iter2 - iter; r--; } if (charsRemoved && *charsRemoved && j > 0) { int prevj = (g_utf8_prev_char (res->str + j) - res->str); gdip_set_array_values (*charsRemoved + prevj, r, j - prevj); } return res; } PangoLayout* gdip_pango_setup_layout (cairo_t *cr, GDIPCONST WCHAR *stringUnicode, int length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, RectF *box, PointF *box_offset, GDIPCONST GpStringFormat *format, int **charsRemoved) { GpStringFormat *fmt; PangoLayout *layout; PangoContext *context; PangoRectangle logical; /* logical size of text (used for alignment) */ PangoRectangle ink; /* ink size of text (to pixel boundaries) */ PangoAttrList *list = NULL; GString *ftext; PangoTabArray *tabs; PangoLayoutIter *iter; int i; int FrameWidth; /* rc->Width (or rc->Height if vertical) */ int FrameHeight; /* rc->Height (or rc->Width if vertical) */ //int FrameX; /* rc->X (or rc->Y if vertical) */ //int FrameY; /* rc->Y (or rc->X if vertical) */ int y0; /* y0,y1,clipNN used for checking line positions vs. clip rectangle */ int y1; int trimSpace; /* whether or not to trim the space */ BOOL use_horizontal_layout; gchar *text = utf16_to_utf8 (stringUnicode, length); if (!text) return NULL; length = strlen(text); if (charsRemoved) { (*charsRemoved) = GdipAlloc (sizeof (int) * length); if (!*charsRemoved) { GdipFree (text); return NULL; } memset (*charsRemoved, 0, sizeof (int) * length); } /* TODO - Digit substitution */ // g_warning ("layout >%s< (%d) [x %g, y %g, w %g, h %g] [font %s, %g points]", text, length, rc->X, rc->Y, rc->Width, rc->Height, font->face, font->emSize); /* a NULL format is valid, it means get the generic default values (and free them later) */ if (!format) { GpStatus status = GdipStringFormatGetGenericDefault ((GpStringFormat **)&fmt); if (status != Ok) { GdipFree (text); return NULL; } } else { fmt = (GpStringFormat *)format; } context = pango_font_map_create_context (font->family->collection->pango_font_map); pango_cairo_update_context (cr, context); layout = pango_layout_new (context); g_object_unref (context); pango_layout_set_font_description (layout, gdip_get_pango_font_description ((GpFont*) font)); if (fmt->formatFlags & StringFormatFlagsDirectionVertical) { FrameWidth = MAKE_SAFE_FOR_PANGO (SAFE_FLOAT_TO_UINT32 (rc->Height)); FrameHeight = MAKE_SAFE_FOR_PANGO (SAFE_FLOAT_TO_UINT32 (rc->Width)); //FrameX = SAFE_FLOAT_TO_UINT32 (rc->Y); //FrameY = SAFE_FLOAT_TO_UINT32 (rc->X); } else { FrameWidth = MAKE_SAFE_FOR_PANGO (SAFE_FLOAT_TO_UINT32 (rc->Width)); FrameHeight = MAKE_SAFE_FOR_PANGO (SAFE_FLOAT_TO_UINT32 (rc->Height)); //FrameX = SAFE_FLOAT_TO_UINT32 (rc->X); //FrameY = SAFE_FLOAT_TO_UINT32 (rc->Y); } //g_warning("FW: %d\tFH: %d", FrameWidth, FrameHeight); if ((FrameWidth <= 0) || (fmt->formatFlags & StringFormatFlagsNoWrap)) { pango_layout_set_width (layout, -1); use_horizontal_layout = FALSE; //g_warning ("Setting width: %d", -1); } else { pango_layout_set_width (layout, FrameWidth * PANGO_SCALE); use_horizontal_layout = TRUE; //g_warning ("Setting width: %d", FrameWidth * PANGO_SCALE); } /* with GDI+ the API not the renderer makes the direction decision */ pango_layout_set_auto_dir (layout, FALSE); if (fmt->formatFlags & StringFormatFlagsDirectionRightToLeft) { pango_context_set_base_dir (context, PANGO_DIRECTION_WEAK_RTL); pango_layout_context_changed (layout); /* horizontal alignment */ if (use_horizontal_layout) { switch (fmt->alignment) { case StringAlignmentNear: pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT); break; case StringAlignmentCenter: pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER); break; case StringAlignmentFar: pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT); break; } } } else { /* pango default base dir is WEAK_LTR, which is what we want */ /* horizontal alignment */ if (use_horizontal_layout) { switch (fmt->alignment) { case StringAlignmentNear: pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT); break; case StringAlignmentCenter: pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER); break; case StringAlignmentFar: pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT); break; } } } #ifdef PANGO_VERSION_CHECK #if PANGO_VERSION_CHECK(1,16,0) if (fmt->formatFlags & StringFormatFlagsDirectionVertical) { if (fmt->formatFlags & StringFormatFlagsDirectionRightToLeft) { cairo_rotate (cr, M_PI/2.0); cairo_translate (cr, 0, -FrameHeight); pango_cairo_update_context (cr, context); } else { cairo_rotate (cr, 3.0*M_PI/2.0); cairo_translate (cr, -FrameWidth, 0); pango_cairo_update_context (cr, context); } /* only since Pango 1.16 */ pango_context_set_base_gravity (context, PANGO_GRAVITY_AUTO); pango_context_set_gravity_hint (context, PANGO_GRAVITY_HINT_LINE); pango_layout_context_changed (layout); } #endif #endif /* TODO - StringFormatFlagsDisplayFormatControl scan and replace them ??? */ /* Trimming options seem to apply only to the end of the string - gdi+ will still wrap * with preference to word first, then character. Unfortunately, pango doesn't have * any way to differentiate wrapping behavior from trimming behavior that I could find */ pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR); switch (fmt->trimming) { case StringTrimmingNone: pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE); break; case StringTrimmingCharacter: pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE); break; case StringTrimmingWord: pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE); break; case StringTrimmingEllipsisCharacter: pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); if (!(fmt->formatFlags & StringFormatFlagsNoWrap)) pango_layout_set_height (layout, FrameHeight == 0 ? G_MAXINT32 : FrameHeight * PANGO_SCALE); break; case StringTrimmingEllipsisWord: pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); if (!(fmt->formatFlags & StringFormatFlagsNoWrap)) pango_layout_set_height (layout, FrameHeight == 0 ? G_MAXINT32 : FrameHeight * PANGO_SCALE); break; case StringTrimmingEllipsisPath: pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_MIDDLE); if (!(fmt->formatFlags & StringFormatFlagsNoWrap)) pango_layout_set_height (layout, FrameHeight == 0 ? G_MAXINT32 : FrameHeight * PANGO_SCALE); break; } /* some stuff can only be done by manipulating the attributes (but we can avoid this most of the time) */ if ((fmt->formatFlags & StringFormatFlagsNoFontFallback) || (font->style & (FontStyleUnderline | FontStyleStrikeout))) { list = gdip_get_layout_attributes (layout); /* StringFormatFlagsNoFontFallback */ if (fmt->formatFlags & StringFormatFlagsNoFontFallback) { PangoAttribute *attr = pango_attr_fallback_new (FALSE); attr->start_index = 0; attr->end_index = length; pango_attr_list_insert (list, attr); } if (font->style & FontStyleUnderline) { PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE); attr->start_index = 0; attr->end_index = length; pango_attr_list_insert (list, attr); } if (font->style & FontStyleStrikeout) { PangoAttribute *attr = pango_attr_strikethrough_new (TRUE); attr->start_index = 0; attr->end_index = length; pango_attr_list_insert (list, attr); } } if (fmt->numtabStops > 0) { float tabPosition; tabs = pango_tab_array_new (fmt->numtabStops, FALSE); tabPosition = fmt->firstTabOffset; for (i = 0; i < fmt->numtabStops; i++) { tabPosition += fmt->tabStops[i]; pango_tab_array_set_tab (tabs, i, PANGO_TAB_LEFT, (gint)min (tabPosition, PANGO_MAX) * PANGO_SCALE); } pango_layout_set_tabs (layout, tabs); pango_tab_array_free (tabs); } //g_warning ("length before ws removal: %d", length); trimSpace = (fmt->formatFlags & StringFormatFlagsMeasureTrailingSpaces) == 0; switch (fmt->hotkeyPrefix) { case HotkeyPrefixHide: /* we need to remove any accelerator from the string */ ftext = gdip_process_string (text, length, 1, trimSpace, NULL, charsRemoved); break; case HotkeyPrefixShow: /* optimization: is seems that we never see the hotkey when using an underline font */ if (font->style & FontStyleUnderline) { /* so don't bother drawing it (and simply add the '&' character) */ ftext = gdip_process_string (text, length, 1, trimSpace, NULL, charsRemoved); } else { /* find accelerator and add attribute to the next character (unless it's the prefix too) */ if (!list) list = gdip_get_layout_attributes (layout); ftext = gdip_process_string (text, length, 1, trimSpace, list, charsRemoved); } break; default: ftext = gdip_process_string (text, length, 0, trimSpace, NULL, charsRemoved); break; } length = ftext->len; //g_warning ("length after ws removal: %d", length); if (list) { pango_layout_set_attributes (layout, list); pango_attr_list_unref (list); } // g_warning("\tftext>%s< (%d)", ftext->str, -1); pango_layout_set_text (layout, ftext->str, ftext->len); GdipFree (text); g_string_free(ftext, TRUE); /* Trim the text after the last line for ease of counting lines/characters */ /* Also prevents drawing whole lines outside the boundaries if NoClip was specified */ /* In case of pre-existing clipping, use smaller of clip rectangle or our specified height */ if (FrameHeight > 0) { iter = pango_layout_get_iter (layout); do { if (iter == NULL) break; pango_layout_iter_get_line_yrange (iter, &y0, &y1); //g_warning("yrange: %d %d FrameHeight: %f", y0 / PANGO_SCALE, y1 / PANGO_SCALE, FrameHeight); /* StringFormatFlagsLineLimit */ if (((fmt->formatFlags & StringFormatFlagsLineLimit) && y1 / PANGO_SCALE > FrameHeight) || (y0 / PANGO_SCALE >= FrameHeight)) { PangoLayoutLine *line = pango_layout_iter_get_line_readonly (iter); pango_layout_set_text (layout, pango_layout_get_text (layout), line->start_index); break; } } while (pango_layout_iter_next_line (iter)); pango_layout_iter_free (iter); } pango_layout_get_pixel_extents (layout, &ink, &logical); //g_warning ("\tlogical\t[x %d, y %d, w %d, h %d][x %d, y %d, w %d, h %d]", logical.x, logical.y, logical.width, logical.height, ink.x, ink.y, ink.width, ink.height); if ((fmt->formatFlags & StringFormatFlagsNoFitBlackBox) == 0) { /* By default don't allow overhang - ink space may be larger than logical space */ box->X = min (ink.x, logical.x); box->Y = min (ink.y, logical.y); box->Height = max (ink.height, logical.height); box->Width = max (ink.width, logical.width); } else { /* Allow overhang */ box->X = logical.x; box->Y = logical.y; box->Height = logical.height; box->Width = logical.width; } //g_warning ("\tbox\t[x %g, y %g, w %g, h %g]", box->X, box->Y, box->Width, box->Height); box_offset->X = 0; box_offset->Y = 0; switch (fmt->lineAlignment) { case StringAlignmentNear: break; case StringAlignmentCenter: box_offset->Y += (FrameHeight - box->Height) * 0.5; break; case StringAlignmentFar: box_offset->Y += (FrameHeight - box->Height); break; } if (!use_horizontal_layout) { switch (fmt->alignment) { case StringAlignmentNear: if (fmt->formatFlags & StringFormatFlagsDirectionRightToLeft) box_offset->X += (FrameWidth - box->Width); break; case StringAlignmentCenter: box_offset->X += (FrameWidth - box->Width) * 0.5; break; case StringAlignmentFar: if (!(fmt->formatFlags & StringFormatFlagsDirectionRightToLeft)) box_offset->X += (FrameWidth - box->Width); break; } } box->X += box_offset->X; box->Y += box_offset->Y; if (fmt->formatFlags & StringFormatFlagsDirectionVertical) { float tmp = box->X; box->X = box->Y; box->Y = tmp; tmp = box->Width; box->Width = box->Height; box->Height = tmp; tmp = box_offset->X; box_offset->X = box_offset->Y; box_offset->Y = tmp; } box->X += rc->X; box->Y += rc->Y; //g_warning ("va-box\t[x %g, y %g, w %g, h %g]", box->X, box->Y, box->Width, box->Height); pango_cairo_update_layout (cr, layout); return layout; } GpStatus pango_DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, GpBrush *brush) { PangoLayout *layout; RectF box; PointF box_offset; /* Setup cairo */ if (brush) { gdip_brush_setup (graphics, brush); } else { cairo_set_source_rgb (graphics->ct, 0., 0., 0.); } cairo_save (graphics->ct); layout = gdip_pango_setup_layout (graphics->ct, stringUnicode, length, font, rc, &box, &box_offset, format, NULL); if (!layout) { cairo_restore (graphics->ct); return OutOfMemory; } if ((rc->Width != 0) && (rc->Height != 0) && (format == NULL || (format->formatFlags & StringFormatFlagsNoClip) == 0)) { // g_warning ("\tclip [%g %g %g %g]", rc->X, rc->Y, rc->Width, rc->Height); /* We do not call cairo_reset_clip because we want to take previous clipping into account */ /* Use rc instead of frame variables because this is pre-transform */ gdip_cairo_rectangle (graphics, rc->X, rc->Y, rc->Width, rc->Height, TRUE); cairo_clip (graphics->ct); } gdip_cairo_move_to (graphics, rc->X + box_offset.X, rc->Y + box_offset.Y, FALSE, TRUE); pango_cairo_show_layout (graphics->ct, layout); g_object_unref (layout); cairo_restore (graphics->ct); return Ok; } GpStatus pango_MeasureString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, RectF *boundingBox, INT *codepointsFitted, INT *linesFilled) { PangoLayout *layout; PangoLayoutLine *line; PangoRectangle logical; PangoLayoutIter *iter; PointF box_offset; int *charsRemoved = NULL; cairo_save (graphics->ct); layout = gdip_pango_setup_layout (graphics->ct, stringUnicode, length, font, rc, boundingBox, &box_offset, format, &charsRemoved); if (!layout) { cairo_restore (graphics->ct); return OutOfMemory; } if (codepointsFitted || linesFilled) { int charsFitted; int lines = 0; int lastIndex; int y0; int y1; int len; double min_x; double max_x; double max_y; const char *layoutText; if (format && (format->formatFlags & StringFormatFlagsDirectionVertical)) { min_x = 0; max_x = rc->Height; max_y = rc->Width; } else { min_x = 0; max_x = rc->Width; max_y = rc->Height; } lastIndex = 0; iter = pango_layout_get_iter (layout); do { if (iter == NULL) break; pango_layout_iter_get_line_yrange (iter, &y0, &y1); if ((format && (format->formatFlags & StringFormatFlagsLineLimit) && y1 / PANGO_SCALE > max_y) || y0 / PANGO_SCALE >= max_y) break; lines++; if (pango_layout_iter_at_last_line (iter)) { do { pango_layout_iter_get_char_extents (iter, &logical); /* check both max and min to catch right-to-left text, also width may be negative */ if ((logical.x / PANGO_SCALE > max_x || (logical.x + logical.width) / PANGO_SCALE > max_x) || (logical.x / PANGO_SCALE < min_x || (logical.x + logical.width) / PANGO_SCALE < min_x)) break; lastIndex = pango_layout_iter_get_index (iter); } while (pango_layout_iter_next_char (iter)); break; } else { line = pango_layout_iter_get_line_readonly (iter); lastIndex = line->start_index + line->length - 1; } } while (pango_layout_iter_next_line (iter)); pango_layout_iter_free (iter); if (codepointsFitted) { layoutText = pango_layout_get_text (layout); if (lines > 0) len = strlen (layoutText); if (lines > 0 && len > 0) { /* this can happen when the string ends in a newline */ if (lastIndex >= len) { lastIndex = g_utf8_prev_char(layoutText + len) - layoutText; } /* Add back in any & characters removed and the final newline characters (if any) */ charsFitted = g_utf8_strlen (layoutText, g_utf8_next_char (layoutText + lastIndex) - layoutText) + charsRemoved [lastIndex]; //g_warning("lastIndex: %d\t\tcharsRemoved: %d", lastIndex, charsRemoved[lastIndex]); /* safe because of null termination */ switch (layoutText [lastIndex + 1]) { case '\r': charsFitted++; if (layoutText [lastIndex + 2] == '\n') charsFitted++; break; case '\n': charsFitted++; break; } } else { // Nothing was fitted. Most likely either the input length was zero or LineLimit prevented fitting any lines (the height of the first line is greater than the height of the bounding box). charsFitted = 0; } *codepointsFitted = charsFitted; } if (linesFilled) { *linesFilled = lines; } } GdipFree (charsRemoved); g_object_unref (layout); cairo_restore (graphics->ct); return Ok; } GpStatus pango_MeasureCharacterRanges (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST GpRectF *layoutRect, GDIPCONST GpStringFormat *format, INT regionCount, GpRegion **regions) { PangoLayout *layout; GpStatus status = Ok; int i, j; GpRectF boundingBox; GpPointF box_offset; if (layoutRect->Width <= 0.0 && layoutRect->Height < 0.0) { /* special case only if BOTH values are negative */ for (i = 0; i < format->charRangeCount; i++) GdipSetInfinite (regions [i]); return Ok; } cairo_save (graphics->ct); layout = gdip_pango_setup_layout (graphics->ct, stringUnicode, length, font, layoutRect, &boundingBox, &box_offset, format, NULL); if (!layout) { cairo_restore (graphics->ct); return OutOfMemory; } /* Create a region for every char range */ for (i = 0; i < format->charRangeCount; i++) { int start, end; CharacterRange range = format->charRanges [i]; GdipSetEmpty (regions [i]); if (range.Length > 0) start = range.First; else start = range.First + range.Length; end = start + range.Length; /* sanity check on charRange. negative lengths are allowed */ if (range.First < 0) { status = InvalidParameter; goto cleanup; } if ((start < 0) || (end > length)) { status = InvalidParameter; goto cleanup; } /* calculate the initial UTF-8 index */ int idxUtf8 = utf8_length_for_utf16_string (stringUnicode, 0, start); /* calculate the regions */ for (j = start; j < end; j++) { PangoRectangle box; GpRectF charRect; pango_layout_index_to_pos (layout, idxUtf8, &box); if (format->formatFlags & StringFormatFlagsDirectionVertical) { charRect.X = (float)box.y / PANGO_SCALE; charRect.Y = (float)box.x / PANGO_SCALE; charRect.Width = (float)box.height / PANGO_SCALE; charRect.Height = (float)box.width / PANGO_SCALE; } else { charRect.X = (float)box.x / PANGO_SCALE; charRect.Y = (float)box.y / PANGO_SCALE; charRect.Width = (float)box.width / PANGO_SCALE; charRect.Height = (float)box.height / PANGO_SCALE; } /* Normalize values (width/height can be negative) */ if (charRect.Width < 0) { charRect.Width = -charRect.Width; charRect.X -= charRect.Width; } if (charRect.Height < 0) { charRect.Height = -charRect.Height; charRect.Y -= charRect.Height; } charRect.X += box_offset.X + layoutRect->X; charRect.Y += box_offset.Y + layoutRect->Y; // g_warning ("[%d] [%d : %d-%d] %c [x %g y %g w %g h %g]", i, j, start, end, (char)stringUnicode[j], charRect.X, charRect.Y, charRect.Width, charRect.Height); status = GdipCombineRegionRect (regions [i], &charRect, CombineModeUnion); if (status != Ok) break; // update the UTF-8 index idxUtf8 += utf8_length_for_utf16_string (stringUnicode, j, 1); } if (status != Ok) break; } cleanup: g_object_unref (layout); cairo_restore (graphics->ct); return status; } #endif libgdiplus-6.0.4+dfsg/src/gdi32.c0000644000175000017500000000360312377405421017170 0ustar directhexdirecthex// Authors: // Francis Fisher (frankie@terrorise.me.uk) // // (C) Francis Fisher 2013 // // 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. #include "graphics-private.h" #include "graphics-cairo-private.h" #include #define NO_CAIRO_AA #define MAX_GRAPHICS_STATE_STACK 512 #define SRCCOPY (DWORD)0x00CC0020 BOOL BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) { if (dwRop != SRCCOPY) return FALSE; GpGraphics *src = (GpGraphics *) hdcSrc; GpGraphics *dest = (GpGraphics *) hdcDest; cairo_t *cr = dest->ct; cairo_surface_t *src_surface = cairo_get_target(src->ct); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_surface (cr, src_surface, nXDest - nXSrc, nYDest - nYSrc); cairo_rectangle (cr, nXDest, nYDest, nWidth, nHeight); cairo_fill (cr); return TRUE; } libgdiplus-6.0.4+dfsg/src/pathgradientbrush-private.h0000644000175000017500000000466613542672033023465 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __PATHGRADIENTBRUSH_PRIVATE_H__ #define __PATHGRADIENTBRUSH_PRIVATE_H__ #include "gdiplus-private.h" #include "brush-private.h" #include "matrix-private.h" /* _N: normalize to 0.0 .. 1.0 */ #define ARGB_ALPHA_N(argb) ((double)((argb >> 24) & 0xff) / 255.0) #define ARGB_RED_N(argb) ((double)((argb >> 16) & 0xff) / 255.0) #define ARGB_GREEN_N(argb) ((double)((argb >> 8) & 0xff) / 255.0) #define ARGB_BLUE_N(argb) ((double)((argb) & 0xff) / 255.0) struct _PathGradient { GpBrush base; GpPath *boundary; ARGB *boundaryColors; int boundaryColorsCount; GpPointF center; ARGB centerColor; GpPointF focusScales; GpRectF rectangle; Blend *blend; InterpolationColors *presetColors; GpWrapMode wrapMode; cairo_matrix_t transform; cairo_pattern_t *pattern; BOOL useGammaCorrection; }; #include "pathgradientbrush.h" #endif libgdiplus-6.0.4+dfsg/src/wmfcodec.c0000644000175000017500000003000213542674535020051 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "wmfcodec.h" /* Codecinfo related data*/ GUID gdip_wmf_image_format_guid = {0xb96b3cadU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; static ImageCodecInfo wmf_codec; static const WCHAR wmf_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'W', 'M', 'F', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in WMF Codec */ static const WCHAR wmf_extension[] = {'*','.','W', 'M', 'F', 0}; /* *.WMF */ static const WCHAR wmf_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'x', '-', 'w', 'm', 'f', 0}; /* image/x-wmf */ static const WCHAR wmf_format[] = {'W', 'M', 'F', 0}; /* WMF */ static const BYTE wmf_sig_pattern[] = { 0xD7, 0xCD, 0xC6, 0x9A }; static const BYTE wmf_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF }; //#define DEBUG_WMF_ALL #ifdef DEBUG_WMF_ALL #define DEBUG_WMF #define DEBUG_WMF_2 #define DEBUG_WMF_3 #define DEBUG_WMF_NOTIMPLEMENTED #endif ImageCodecInfo* gdip_getcodecinfo_wmf () { wmf_codec.Clsid = (CLSID) { 0x557cf404, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; wmf_codec.FormatID = gdip_wmf_image_format_guid; wmf_codec.CodecName = (const WCHAR*) wmf_codecname; wmf_codec.DllName = NULL; wmf_codec.FormatDescription = (const WCHAR*) wmf_format; wmf_codec.FilenameExtension = (const WCHAR*) wmf_extension; wmf_codec.MimeType = (const WCHAR*) wmf_mimetype; wmf_codec.Flags = ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; wmf_codec.Version = 1; wmf_codec.SigCount = 1; wmf_codec.SigSize = 4; wmf_codec.SigPattern = wmf_sig_pattern; wmf_codec.SigMask = wmf_sig_mask; return &wmf_codec; } #if DEBUG_WMF #define GetParam(x,y) GetWORD((6 + ((x) << 1)), (y)) static WORD GetWORD (int position, BYTE *data) { WORD *value = (WORD*)(data + position); #if G_BYTE_ORDER != G_LITTLE_ENDIAN return GUINT16_FROM_LE (*value); #else return *value; #endif } #endif static DWORD GetColor (WORD w1, WORD w2) { DWORD color = (w2 << 16) | w1; BYTE *p = (BYTE*)&color; BYTE temp = p[0]; p[0] = p[2]; p[2] = temp; return color; } #if G_BYTE_ORDER == G_LITTLE_ENDIAN #define GETW(x) (*(WORD*)(data + (x))) #else #define GETW(x) (GUINT16_FROM_LE(*(WORD*)(data + (x)))) #endif #if G_BYTE_ORDER == G_LITTLE_ENDIAN #define GETS(x) (*(SHORT*)(data + (x))) #else #define GETS(x) (GINT16_FROM_LE(*(SHORT*)(data + (x)))) #endif /* http://wvware.sourceforge.net/caolan/Polygon.html */ static GpStatus Polygon (MetafilePlayContext *context, BYTE *data, int len) { GpPointF *points, *pt; GpStatus status; int p; /* variable number of parameters */ SHORT num = GETS(WP1); /* len (in WORDs) = num (WORD) + num * (x WORD + y WORD) */ if (num > len + 1) return InvalidParameter; #ifdef DEBUG_WMF printf ("Polygon %d points", num); #endif points = (GpPointF*) GdipAlloc (num * sizeof (GpPointF)); if (!points) return OutOfMemory; int n = 2; for (p = 0, pt = points; p < num; p++, pt++) { pt->X = GETS(WP(n)); n++; pt->Y = GETS(WP(n)); n++; #ifdef DEBUG_WMF printf ("\n\tpoly to %g,%g", pt->X, pt->Y); #endif } status = gdip_metafile_Polygon (context, points, num); GdipFree (points); return status; } /* http://wvware.sourceforge.net/caolan/Polyline.html */ static GpStatus Polyline (MetafilePlayContext *context, BYTE *data) { GpStatus status; int p; /* variable number of parameters */ SHORT num = GETS(WP1); #ifdef DEBUG_WMF printf ("Polyline %d points", num); #endif SHORT x1 = GETS(WP2); SHORT y1 = GETS(WP3); int n = 4; for (p = 1; p < num; p++) { SHORT x2 = GETS(WP(n)); n++; SHORT y2 = GETS(WP(n)); n++; #ifdef DEBUG_WMF_2 printf ("\n\tdraw from %d,%d to %d,%d", x1, y1, x2, y2); #endif GpPen *pen = gdip_metafile_GetSelectedPen (context); status = GdipDrawLine (context->graphics, pen, x1, y1, x2, y2); if (status != Ok) return status; x1 = x2; y1 = y2; } return Ok; } /* http://wvware.sourceforge.net/caolan/PolyPolygon.html */ /* storage isn't very efficient, # of polygons, size of each polygon, data for each polygon */ static GpStatus PolyPolygon (MetafilePlayContext *context, BYTE *data) { GpStatus status = Ok; /* variable number of parameters */ int poly_num = GETW(WP1); int i, j; PointFList *list = GdipAlloc (poly_num * sizeof (PointFList)); if (!list) { return OutOfMemory; } PointFList *current = list; #ifdef DEBUG_WMF printf ("PolyPolygon has %d polygons", poly_num); #endif int n = 2; /* read size of each polygon and allocate the required memory */ for (i = 0; i < poly_num; i++) { current->num = GETW(WP(n)); n++; current->points = (GpPointF*) GdipAlloc (current->num * sizeof (GpPointF)); if (!current->points) { for (j = 0; j < i; j++) { GdipFree (list[j].points); } GdipFree (list); return OutOfMemory; } #ifdef DEBUG_WMF_2 printf ("\n\tSub Polygon #%d has %d points", i, current->num); #endif current++; } /* read the points for each polygons */ current = list; for (i = 0; i < poly_num; i++) { GpPointF *pt = current->points; int p; for (p = 0; p < current->num; p++) { pt->X = GETW(WP(n)); n++; pt->Y = GETW(WP(n)); n++; #ifdef DEBUG_WMF_3 printf ("\n\t\tpoly to %g,%g", pt->X, pt->Y); #endif pt++; } GpStatus s = gdip_metafile_Polygon (context, current->points, current->num); if (s != Ok) status = s; /* free points */ GdipFree (current->points); current++; } /* all points were freed, after being drawn, so we just have to free the polygon list*/ GdipFree (list); return status; } GpStatus gdip_metafile_play_wmf (MetafilePlayContext *context) { GpStatus status = Ok; GpMetafile *metafile = context->metafile; BYTE *data = metafile->data; BYTE *end = data + metafile->length; #ifdef DEBUG_WMF int i = 1, j; #endif /* reality check - each record is, at minimum, 6 bytes long (4 size + 2 function) */ while (data < end - WMF_MIN_RECORD_SIZE) { DWORD size = GETDW(RECORDSIZE); WORD func = GETW(FUNCTION); int params = size - (WMF_MIN_RECORD_SIZE / sizeof (WORD)); #ifdef DEBUG_WMF printf ("\n[#%d] size %d ", i++, size); #endif /* reality check - enough data available to read all parameters ? (params is in WORD) */ if ((params << 1) > (long)(end - data)) { status = InvalidParameter; goto cleanup; } /* Notes: * - The previous check doesn't mean we have all required parameters (only the one encoded) * - sometimes there are extra (undocumented?, buggy?) parameters for some functions */ switch (func) { case META_SAVEDC: WMF_CHECK_PARAMS(0); status = gdip_metafile_SaveDC (context); break; case META_SETBKMODE: WMF_CHECK_PARAMS(1); status = gdip_metafile_SetBkMode (context, GETW(WP1)); break; case META_SETMAPMODE: WMF_CHECK_PARAMS(1); status = gdip_metafile_SetMapMode (context, GETW(WP1)); break; case META_SETROP2: WMF_CHECK_PARAMS(1); status = gdip_metafile_SetROP2 (context, GETW(WP1)); break; case META_SETRELABS: WMF_CHECK_PARAMS(1); status = gdip_metafile_SetRelabs (context, GETW(WP1)); break; case META_SETPOLYFILLMODE: WMF_CHECK_PARAMS(1); status = gdip_metafile_SetPolyFillMode (context, GETW(WP1)); break; case META_SETSTRETCHBLTMODE: WMF_CHECK_PARAMS(1); /* 2 but second is unused (32bits?) */ status = gdip_metafile_SetStretchBltMode (context, GETW(WP1)); break; case META_RESTOREDC: WMF_CHECK_PARAMS(0); status = gdip_metafile_RestoreDC (context); break; case META_SELECTOBJECT: WMF_CHECK_PARAMS(1); status = gdip_metafile_SelectObject (context, GETW(WP1)); break; case META_SETTEXTALIGN: WMF_CHECK_PARAMS(1); status = gdip_metafile_SetTextAlign (context, GETW(WP1)); break; case META_DELETEOBJECT: WMF_CHECK_PARAMS(1); status = gdip_metafile_DeleteObject (context, GETW(WP1)); break; case META_SETBKCOLOR: WMF_CHECK_PARAMS(2); status = gdip_metafile_SetBkColor (context, GetColor (GETW(WP1), GETW(WP2))); break; case META_SETWINDOWORG: WMF_CHECK_PARAMS(2); status = gdip_metafile_SetWindowOrg (context, GETS(WP1), GETS(WP2)); break; case META_SETWINDOWEXT: WMF_CHECK_PARAMS(2); status = gdip_metafile_SetWindowExt (context, GETS(WP1), GETS(WP2)); break; case META_LINETO: WMF_CHECK_PARAMS(2); status = gdip_metafile_LineTo (context, GETS(WP1), GETS(WP2)); break; case META_MOVETO: WMF_CHECK_PARAMS(2); status = gdip_metafile_MoveTo (context, GETS(WP1), GETS(WP2)); break; case META_CREATEPENINDIRECT: /* note: documented with only 4 parameters, LOGPEN use a POINT to specify width, so y (3) is unused) */ WMF_CHECK_PARAMS(5); status = gdip_metafile_CreatePenIndirect (context, GETW(WP1), GETW(WP2), GetColor (GETW(WP4), GETW(WP5))); break; case META_CREATEBRUSHINDIRECT: WMF_CHECK_PARAMS(4); status = gdip_metafile_CreateBrushIndirect (context, GETW(WP1), GetColor (GETW(WP2), GETW(WP3)), GETW(WP4)); break; case META_POLYGON: status = Polygon (context, data, params); break; case META_POLYLINE: status = Polyline (context, data); break; case META_POLYPOLYGON: status = PolyPolygon (context, data); break; case META_ARC: WMF_CHECK_PARAMS(8); status = gdip_metafile_Arc (context, GETS(WP1), GETS(WP2), GETS(WP3), GETS(WP4), GETS(WP5), GETS(WP6), GETS(WP7), GETS(WP8)); break; case META_RECTANGLE: WMF_CHECK_PARAMS (4); status = gdip_metafile_Rectangle (context, GETS (WP1), GETS (WP2), GETS (WP3), GETS (WP4)); break; case META_SETPIXEL: WMF_CHECK_PARAMS (4); status = gdip_metafile_SetPixel (context, GetColor (GETW (WP1), GETW (WP2)), GETW (WP4), GETW (WP3)); break; case META_STRETCHDIB: { WMF_CHECK_PARAMS(14); BITMAPINFO *bmi = (BITMAPINFO*) (data + 14 * sizeof (WORD)); void* bits = (void*) (bmi + GETDW(WP12)); status = gdip_metafile_StretchDIBits (context, GETS(WP11), GETS(WP10), GETS(WP9), GETS(WP8), GETS(WP7), GETS(WP6), GETS(WP5), GETS(WP4), bits, bmi, GETW(WP3), GETDW(WP1)); break; } case META_DIBSTRETCHBLT: { WMF_CHECK_PARAMS(12); BITMAPINFO *bmi = (BITMAPINFO*) (data + 13 * sizeof (WORD)); void* bits = (void*) (bmi + GETDW(WP11)); status = gdip_metafile_StretchDIBits (context, GETS(WP10), GETS(WP9), GETS(WP8), GETS(WP7), GETS(WP6), GETS(WP5), GETS(WP4), GETS(WP3), bits, bmi, 0, GETDW(WP1)); break; } default: /* unprocessed records, ignore the data */ /* 3 for size (DWORD) == 2 * SHORT + function == 1 SHORT */ #ifdef DEBUG_WMF printf ("Unimplemented_%X (", func); for (j = 0; j < params; j++) { printf (" %d", GetParam (j, data)); } printf (" )"); #endif break; } if (status != Ok) { g_warning ("Parsing interupted, status %d returned from function %d.", status, func); goto cleanup; } data += size * 2; } cleanup: return status; } GpStatus gdip_load_wmf_image_from_file (FILE *fp, GpImage **image) { return gdip_get_metafile_from ((void*)fp, (GpMetafile**)image, File); } GpStatus gdip_load_wmf_image_from_stream_delegate (dstream_t *loader, GpImage **image) { return gdip_get_metafile_from ((void *)loader, (GpMetafile**)image, DStream); } libgdiplus-6.0.4+dfsg/src/graphics-pathiterator.c0000644000175000017500000002247513542674535022605 0ustar directhexdirecthex/* * graphics-pathiterator.c * * Copyright (C) 2004,2006-2007 Novell 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. * * * Author: Ravindra (rkumar@novell.com) * */ #include "graphics-pathiterator-private.h" #include "general-private.h" #include "graphics-path-private.h" #include "font.h" // coverity[+alloc : arg-*0] GpStatus GdipCreatePathIter (GpPathIterator **iterator, GpPath *path) { GpPath *clone = NULL; GpPathIterator *iter; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!iterator) return InvalidParameter; iter = (GpPathIterator *) GdipAlloc (sizeof (GpPathIterator)); if (iter == NULL) return OutOfMemory; /* supplying a path isn't required */ if (path) { status = GdipClonePath (path, &clone); if (status != Ok) { GdipFree (iter); if (clone) GdipDeletePath (clone); return status; } } iter->path = clone; iter->markerPosition = 0; iter->subpathPosition = 0; iter->pathTypePosition = 0; *iterator = iter; return Ok; } GpStatus GdipPathIterGetCount (GpPathIterator *iterator, int *count) { if (!iterator || !count) return InvalidParameter; if (iterator->path) *count = iterator->path->count; else *count = 0; return Ok; } GpStatus GdipPathIterGetSubpathCount (GpPathIterator *iterator, int *count) { int numSubpaths = 0; if (!iterator || !count) return InvalidParameter; if (iterator->path) { int i; BYTE type; /* Number of subpaths = Number of starting points */ for (i = 0; i < iterator->path->count; i++) { type = iterator->path->types[i]; if (type == PathPointTypeStart) numSubpaths++; } } *count = numSubpaths; return Ok; } GpStatus GdipDeletePathIter (GpPathIterator *iterator) { if (!iterator) return InvalidParameter; if (iterator->path) { GdipDeletePath (iterator->path); iterator->path = NULL; } GdipFree (iterator); return Ok; } GpStatus GdipPathIterCopyData (GpPathIterator *iterator, int *resultCount, GpPointF *points, BYTE *types, int startIndex, int endIndex) { if (!iterator || !resultCount || !points || !types) return InvalidParameter; if (!iterator->path || (startIndex >= iterator->path->count) || (startIndex > endIndex) || (endIndex >= iterator->path->count) || (startIndex < 0) || (endIndex < 0)) { *resultCount = 0; return Ok; } memcpy (points, iterator->path->points + startIndex, (endIndex - startIndex + 1) * sizeof (GpPointF)); memcpy (types, iterator->path->types + startIndex, (endIndex - startIndex + 1) * sizeof (BYTE)); *resultCount = endIndex - startIndex + 1; return Ok; } GpStatus GdipPathIterEnumerate (GpPathIterator *iterator, int *resultCount, GpPointF *points, BYTE *types, int count) { int i = 0; if (!iterator || !resultCount || !points || !types) return InvalidParameter; if (iterator->path) { for (; i < count && i < iterator->path->count; i++) { points [i] = iterator->path->points[i]; types [i] = iterator->path->types[i]; } } *resultCount = i; return Ok; } GpStatus GdipPathIterHasCurve (GpPathIterator *iterator, BOOL *curve) { if (!iterator || !curve) return InvalidParameter; *curve = gdip_path_has_curve (iterator->path); return Ok; } GpStatus GdipPathIterNextMarkerPath (GpPathIterator *iterator, int *resultCount, GpPath *path) { int start, end; GpStatus status; status = GdipPathIterNextMarker (iterator, resultCount, &start, &end); if (status == Ok && *resultCount > 0) { GdipResetPath (path); gdip_path_ensure_size (path, *resultCount); memcpy (path->types, iterator->path->types + start, sizeof (BYTE) * *resultCount); memcpy (path->points, iterator->path->points + start, sizeof (GpPointF) * *resultCount); path->count = *resultCount; } return status; } GpStatus GdipPathIterNextMarker (GpPathIterator *iterator, int *resultCount, int *startIndex, int *endIndex) { int index = 0; BYTE type; if (!iterator || !resultCount || !startIndex || !endIndex) return InvalidParameter; /* There are no markers or we are done with all the markers */ if (!iterator->path || (iterator->path->count == 0) || (iterator->markerPosition >= iterator->path->count)) { /* we don't touch startIndex and endIndex in this case */ *resultCount = 0; return Ok; } /* Check for next marker */ for (index = iterator->markerPosition; index < iterator->path->count; index++) { type = iterator->path->types[index]; if (type & PathPointTypePathMarker) { index++; break; } } *startIndex = iterator->markerPosition; *endIndex = index - 1; *resultCount = (*endIndex) - (*startIndex) + 1; iterator->markerPosition = index; return Ok; } GpStatus GdipPathIterNextPathType (GpPathIterator *iterator, int *resultCount, BYTE *pathType, int *startIndex, int *endIndex) { int index; BYTE currentType; BYTE lastTypeSeen; if (!iterator || !resultCount || !pathType || !startIndex || !endIndex) return InvalidParameter; /* There are no subpaths or we are done with all the subpaths */ if (!iterator->path || (iterator->path->count == 0) || (iterator->subpathPosition == 0)) { /* we don't touch pathType, startIndex and endIndex in this case */ *resultCount = 0; return Ok; } /* Pathtype position lags behind subpath position */ else if (iterator->pathTypePosition < iterator->subpathPosition) { lastTypeSeen = iterator->path->types[iterator->pathTypePosition + 1]; /* Mask the flags */ lastTypeSeen &= PathPointTypePathTypeMask; /* Check for the change in type */ for (index = iterator->pathTypePosition + 2; index < iterator->subpathPosition; index++) { currentType = iterator->path->types[index]; currentType &= PathPointTypePathTypeMask; if (currentType != lastTypeSeen) break; } *startIndex = iterator->pathTypePosition; *endIndex = index - 1; *resultCount = (*endIndex) - (*startIndex) + 1; *pathType = lastTypeSeen; /* If lastTypeSeen is a line, it becomes the starting point for the next * path type. We get this when we have connected figures. We need to step * back in that case. We don't need to step back if we are finished with * current subpath. */ if ((lastTypeSeen == PathPointTypeLine) && (index != iterator->subpathPosition)) iterator->pathTypePosition = index - 1; else iterator->pathTypePosition = index; } /* If pathtype position and subpath position coincide we return the resultCount = 0 */ else *resultCount = 0; return Ok; } GpStatus GdipPathIterNextSubpathPath (GpPathIterator *iterator, int *resultCount, GpPath *path, BOOL *isClosed) { int start, end; GpStatus status; status = GdipPathIterNextSubpath (iterator, resultCount, &start, &end, isClosed); if (status == Ok && *resultCount > 0) { GdipResetPath (path); gdip_path_ensure_size (path, *resultCount); memcpy (path->types, iterator->path->types + start, sizeof (BYTE) * *resultCount); memcpy (path->points, iterator->path->points + start, sizeof (GpPointF) * *resultCount); path->count = *resultCount; } return status; } GpStatus GdipPathIterNextSubpath (GpPathIterator *iterator, int *resultCount, int *startIndex, int *endIndex, BOOL *isClosed) { int index = 0; BYTE currentType; if (!iterator || !resultCount || !startIndex || !endIndex || !isClosed) return InvalidParameter; /* There are no subpaths or we are done with all the subpaths */ if (!iterator->path || (iterator->path->count == 0) || (iterator->subpathPosition == iterator->path->count)) { /* we don't touch startIndex and endIndex in this case */ *resultCount = 0; *isClosed = TRUE; return Ok; } /* Check for next start point */ for (index = iterator->subpathPosition + 1; index < iterator->path->count; index++) { currentType = iterator->path->types[index]; if (currentType == PathPointTypeStart) break; } *startIndex = iterator->subpathPosition; *endIndex = index - 1; *resultCount = (*endIndex) - (*startIndex) + 1; /* set positions for next iteration */ iterator->pathTypePosition = iterator->subpathPosition; iterator->subpathPosition = index; /* check if last subpath was closed */ currentType = iterator->path->types[index - 1]; if (currentType & PathPointTypeCloseSubpath) *isClosed = TRUE; else *isClosed = FALSE; return Ok; } GpStatus GdipPathIterRewind (GpPathIterator *iterator) { if (!iterator) return InvalidParameter; /* Reset the marker and subpath positions */ iterator->markerPosition = 0; iterator->subpathPosition = 0; iterator->pathTypePosition = 0; return Ok; } libgdiplus-6.0.4+dfsg/src/text-pango-private.h0000644000175000017500000000547013542674535022040 0ustar directhexdirecthex/* * 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. * * Authors: * Sebastien Pouliot * * Copyright (C) 2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __TEXT_PANGO_PRIVATE_H__ #define __TEXT_PANGO_PRIVATE_H__ #include "gdiplus-private.h" #ifdef USE_PANGO_RENDERING #include #include #include "graphics-private.h" #include "stringformat-private.h" #define PANGO_MAX (G_MAXINT / PANGO_SCALE) #define MAKE_SAFE_FOR_PANGO(x) ((x) == G_MAXINT32 ? 0 :((x) > G_MAXINT/PANGO_SCALE ? G_MAXINT/PANGO_SCALE : ((x) < G_MININT/PANGO_SCALE ? G_MININT/PANGO_SCALE : (x)))) #define GDIP_WINDOWS_ACCELERATOR '&' #define text_DrawString pango_DrawString #define text_MeasureString pango_MeasureString #define text_MeasureCharacterRanges pango_MeasureCharacterRanges PangoLayout* gdip_pango_setup_layout (cairo_t *cr, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, RectF *box, PointF *box_offset, GDIPCONST GpStringFormat *format, INT **charsRemoved); GpStatus pango_DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, GpBrush *brush) GDIP_INTERNAL; GpStatus pango_MeasureString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, RectF *boundingBox, INT *codepointsFitted, INT *linesFilled) GDIP_INTERNAL; GpStatus pango_MeasureCharacterRanges (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST GpRectF *layout, GDIPCONST GpStringFormat *format, INT regionCount, GpRegion **regions) GDIP_INTERNAL; #endif #endif libgdiplus-6.0.4+dfsg/src/tiffcodec.h0000644000175000017500000000275213542672033020217 0ustar directhexdirecthex/* * tiffcodec.h : Contains function declarations for encoding decoding tiff images * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * * Copyright (C) 2003-2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef _TIFFCODEC_H #define _TIFFCODEC_H #include "bitmap-private.h" #include "bmpcodec.h" GpStatus gdip_load_tiff_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_tiff_image_from_stream_delegate (GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage **image) GDIP_INTERNAL; GpStatus gdip_save_tiff_image_to_file (unsigned char *filename, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; GpStatus gdip_save_tiff_image_to_stream_delegate (GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpImage *image, GDIPCONST EncoderParameters *params) GDIP_INTERNAL; ImageCodecInfo* gdip_getcodecinfo_tiff () GDIP_INTERNAL; GpStatus gdip_fill_encoder_parameter_list_tiff (EncoderParameters *buffer, UINT size) GDIP_INTERNAL; typedef struct { UINT count; EncoderParameter compression; EncoderParameter colorDepth; EncoderParameter saveFlag; EncoderParameter saveAsCYMK; LONG compressionData[5]; LONG colorDepthData[5]; LONG saveFlagValue; LONG saveAsCYMKValue; } TiffEncoderParameters; #endif /* _TIFFCODEC_H */ libgdiplus-6.0.4+dfsg/src/gdip.h0000644000175000017500000000260212377405421017206 0ustar directhexdirecthex/* * gdip.h - THIS FILE IS DEPRECATED - please use the new GdiPlusFlat.h header file * * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #warning The file gdip.h will eventually disappear, please directly include GdiPlusFlat.h instead #include "GdiPlusFlat.h" libgdiplus-6.0.4+dfsg/src/emfplus.c0000644000175000017500000001301613542672033017732 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "emfplus.h" //#define DEBUG_EMFPLUS_ALL #ifdef DEBUG_EMFPLUS_ALL #define DEBUG_EMFPLUS #define DEBUG_EMFPLUS_2 #define DEBUG_EMFPLUS_3 #define DEBUG_EMFPLUS_NOTIMPLEMENTED #endif /* http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/Header.html */ static GpStatus EmfPlusHeader (MetafilePlayContext *context, WORD flags, BYTE* data, int size) { #ifdef DEBUG_EMFPLUS /* if flags == 1, EmfPlusDual (GDI and GDI+), else EmfPlusOnly (GDI+) */ printf ("\nEmfPlusHeader flags %X", flags); printf ("\n\tData Size %d", GETDW(DWP1)); printf ("\n\tObject Header %X", GETDW(DWP2)); printf ("\n\tVersion %d", GETDW(DWP3)); printf ("\n\tHorizontal Resolution %d", GETDW(DWP4)); printf ("\n\tVertical Resolution %d", GETDW(DWP5)); #endif context->metafile->metafile_header.Type = (flags & 1) ? MetafileTypeEmfPlusDual : MetafileTypeEmfPlusOnly; /* ObjectHeader, not Version, is returned to be compatible with GDI+ */ context->metafile->metafile_header.Version = GETDW(DWP2); /* Horizontal and Vertical Resolution aren't reported correctly by GDI+ (generally 0) */ return Ok; } /* http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/EndOfFile.html */ static GpStatus EmfPlusEndOfFile (MetafilePlayContext *context, WORD flags, BYTE* data, int size) { #ifdef DEBUG_EMFPLUS printf ("EmfPlusRecordTypeEndOfFile flags %X", flags); #endif return Ok; } /* http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/FillRects.html */ static GpStatus EmfPlusFillRects (MetafilePlayContext *context, WORD flags, BYTE* data, int size) { GpStatus status = Ok; GpSolidFill *solid = NULL; GpBrush *brush = NULL; #ifdef DEBUG_EMFPLUS printf ("EmfPlusRecordTypeFillRects flags %X", flags, size); printf ("\n\tColor: 0x%X", GETDW(DWP2)); printf ("\n\t#rect: %d", GETDW(DWP3)); #endif BOOL use_int16 = (flags & 0x4000); BOOL use_color = (flags & 0x8000); DWORD num = GETDW(DWP3); int i = 0; int n = 3; if (use_color) { status = GdipCreateSolidFill (GETDW(DWP2), &solid); if (status != Ok) return status; brush = (GpBrush*)solid; } else { /* TODO - get brush from index */ } while ((i++ < num) && (status == Ok)) { float x, y, w, h; if (use_int16) { DWORD xy = GETDW(DWP(n)); n++; x = (xy >> 16); y = (WORD)xy; DWORD wh = GETDW(DWP(n)); n++; w = (wh >> 16); h = (WORD)wh; } else { x = (float) GETDW(DWP(n)); n++; y = (float) GETDW(DWP(n)); n++; w = (float) GETDW(DWP(n)); n++; h = (float) GETDW(DWP(n)); n++; } #ifdef DEBUG_EMFPLUS_2 printf ("\n\t\t%d - x %g, y %g, w %g, h %g", i, x, y, w, h); #endif status = GdipFillRectangle (context->graphics, brush, x, y, w, h); } if (solid) GdipDeleteBrush (brush); /* brush == a GpBrush* typecasted solid, if used */ return status; } GpStatus gdip_metafile_play_emfplus_block (MetafilePlayContext *context, BYTE* data, int length) { GpStatus status = Ok; BYTE *end = data + length; #ifdef DEBUG_EMFPLUS int i = 1, j; #endif /* special case to update the header informations (we're not really playing the metafile) */ if (!context->graphics) { DWORD record = GETDW(EMF_FUNCTION); WORD func = (WORD)record; if (func == EmfPlusRecordTypeHeader) { WORD flags = (record >> 16); DWORD size = GETDW(EMF_RECORDSIZE); return EmfPlusHeader (context, flags, data, size); } /* no header, continue */ return Ok; } /* reality check - each record is, at minimum, 8 bytes long (when size == 0) */ while (data < end - EMF_MIN_RECORD_SIZE) { DWORD record = GETDW(EMF_FUNCTION); WORD func = (WORD)record; WORD flags = (record >> 16); DWORD size = GETDW(EMF_RECORDSIZE); #ifdef DEBUG_EMFPLUS printf ("\n\tEMF+[#%d] size %d ", i++, size); #endif switch (func) { case EmfPlusRecordTypeHeader: status = EmfPlusHeader (context, flags, data, size); break; case EmfPlusRecordTypeEndOfFile: return EmfPlusEndOfFile (context, flags, data, size); case EmfPlusRecordTypeFillRects: status = EmfPlusFillRects (context, flags, data, size); break; default: /* unprocessed records, ignore the data */ #ifdef DEBUG_EMFPLUS_NOTIMPLEMENTED printf ("Unimplemented_%d (", func); for (j = 0; j < params; j++) { printf (" %d", GETDW(DWP(j))); } printf (" )"); #endif break; } if (status != Ok) { g_warning ("EMF+ parsing interupted, status %d returned from function %d.", status, func); goto cleanup; } data += size; } cleanup: return status; } libgdiplus-6.0.4+dfsg/src/gdipluspixelformats.h0000644000175000017500000001131013542674535022375 0ustar directhexdirecthex/* * 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. */ #ifndef __GDIPLUSPIXELFORMATS_H__ #define __GDIPLUSPIXELFORMATS_H__ #include "win32structs.h" typedef DWORD ARGB; typedef DWORDLONG ARGB64; #define ALPHA_SHIFT 24 #define RED_SHIFT 16 #define GREEN_SHIFT 8 #define BLUE_SHIFT 0 #define ALPHA_MASK ((ARGB) 0xff << ALPHA_SHIFT) /* The pixel format spec is: * [0-7 format index] [8-15 pixel size, bits] [16-23 flags] [24-31 reserved] * so, * (ID | (bpp << 8) | flags) */ typedef INT PixelFormat; #define PixelFormatIndexed 0x00010000 // Indexes into a palette #define PixelFormatGDI 0x00020000 // Is a GDI-supported format #define PixelFormatAlpha 0x00040000 // Has an alpha component #define PixelFormatPAlpha 0x00080000 // Pre-multiplied alpha #define PixelFormatExtended 0x00100000 // Extended color 16 bits/channel #define PixelFormatCanonical 0x00200000 #define PixelFormatUndefined 0 #define PixelFormatDontCare 0 #define PixelFormat1bppIndexed (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI) #define PixelFormat4bppIndexed (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI) #define PixelFormat8bppIndexed (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI) #define PixelFormat16bppGrayScale (4 | (16 << 8) | PixelFormatExtended) #define PixelFormat16bppRGB555 (5 | (16 << 8) | PixelFormatGDI) #define PixelFormat16bppRGB565 (6 | (16 << 8) | PixelFormatGDI) #define PixelFormat16bppARGB1555 (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI) #define PixelFormat24bppRGB (8 | (24 << 8) | PixelFormatGDI) #define PixelFormat32bppRGB (9 | (32 << 8) | PixelFormatGDI) #define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical) #define PixelFormat32bppPARGB (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI) #define PixelFormat48bppRGB (12 | (48 << 8) | PixelFormatExtended) #define PixelFormat64bppARGB (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended) #define PixelFormat64bppPARGB (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended) #define PixelFormat32bppCMYK (15 | (32 << 8)) #define PixelFormatMax 16 inline UINT GetPixelFormatSize(PixelFormat pixfmt) { return (pixfmt >> 8) & 0xff; } inline BOOL IsIndexedPixelFormat(PixelFormat pixfmt) { return (pixfmt & PixelFormatIndexed) != 0; } inline BOOL IsAlphaPixelFormat(PixelFormat pixfmt) { return (pixfmt & PixelFormatAlpha) != 0; } inline BOOL IsExtendedPixelFormat(PixelFormat pixfmt) { return (pixfmt & PixelFormatExtended) != 0; } inline BOOL IsCanonicalPixelFormat(PixelFormat pixfmt) { return (pixfmt & PixelFormatCanonical) != 0; } #if (GDIPVER >= 0x0110) typedef enum { PaletteTypeCustom = 0, PaletteTypeOptimal = 1, PaletteTypeFixedBW = 2, PaletteTypeFixedHalftone8 = 3, PaletteTypeFixedHalftone27 = 4, PaletteTypeFixedHalftone64 = 5, PaletteTypeFixedHalftone125 = 6, PaletteTypeFixedHalftone216 = 7, PaletteTypeFixedHalftone252 = 8, PaletteTypeFixedHalftone256 = 9, } PaletteType; typedef enum { DitherTypeNone = 0, DitherTypeSolid = 1, DitherTypeOrdered4x4 = 2, DitherTypeOrdered8x8 = 3, DitherTypeOrdered16x16 = 4, DitherTypeSpiral4x4 = 5, DitherTypeSpiral8x8 = 6, DitherTypeDualSpiral4x4 = 7, DitherTypeDualSpiral8x8 = 8, DitherTypeErrorDiffusion = 9, DitherTypeMax = 10 } #endif //(GDIPVER >= 0x0110) typedef enum { PaletteFlagsHasAlpha = 0x0001, PaletteFlagsGrayScale = 0x0002, PaletteFlagsHalftone = 0x0004 } PaletteFlags; typedef struct { UINT Flags; UINT Count; ARGB Entries[1]; } ColorPalette; #endif libgdiplus-6.0.4+dfsg/src/carbon-private.h0000644000175000017500000000244213542672033021201 0ustar directhexdirecthex/* * 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. * * Authors: * Geoff Norton (gnorton@novell.com) * * Copyright (C) 2008 Novell, Inc (http://www.novell.com) */ #ifndef __CARBON_PRIVATE_H__ #define __CARBON_PRIVATE_H__ void gdip_get_display_dpi_carbon (float *h_dpi, float *v_dpi); #endif libgdiplus-6.0.4+dfsg/src/bitmap-private.h0000644000175000017500000002064313545154626021222 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __BITMAP_PRIVATE_H__ #define __BITMAP_PRIVATE_H__ #include "gdiplus-private.h" #include "image-private.h" #define COLOR_PALETTE_FLAGS_DEFAULT 0 #define COLOR_PALETTE_FLAGS_HAS_ALPHA 1 #define COLOR_PALETTE_FLAGS_GREYSCALE 2 #define COLOR_PALETTE_FLAGS_HALFTONE 4 /* LockMode (reserved) flags */ #define GBD_OWN_SCAN0 (1<<8) #define GBD_WRITE_OK (1<<9) #define GBD_LOCKED (1<<10) #define GBD_TRUE24BPP (1<<11) #ifdef WORDS_BIGENDIAN #define set_pixel_bgra(pixel,index,b,g,r,a) do { \ ((unsigned char *)(pixel))[index] = a; \ ((unsigned char *)(pixel))[index+1] = r; \ ((unsigned char *)(pixel))[index+2] = g; \ ((unsigned char *)(pixel))[index+3] = b; \ } while (0) #else #define set_pixel_bgra(pixel,index,b,g,r,a) do { \ ((unsigned char *)(pixel))[index] = b; \ ((unsigned char *)(pixel))[index+1] = g; \ ((unsigned char *)(pixel))[index+2] = r; \ ((unsigned char *)(pixel))[index+3] = a; \ } while (0) #endif #define get_pixel_bgra(color, b, g, r, a) do { \ a = ((color & 0xff000000) >> 24); \ r = ((color & 0x00ff0000) >> 16); \ g = ((color & 0x0000ff00) >> 8); \ b = (color & 0x000000ff); \ } while(0) /* This structure is mirrored in System.Drawing.Imaging.BitmapData. Any changes here must also be made to BitmapData.cs */ typedef struct { unsigned int width; unsigned int height; int stride; PixelFormat pixel_format; BYTE *scan0; UINT_PTR reserved; /* the rest of the structure isn't part of MS GDI+ definition */ ColorPalette *palette; int property_count; /* Number of properties */ PropertyItem *property; /* Properties associated with image */ float dpi_horz; /* */ float dpi_vert; /* */ ImageFlags image_flags; /* Alpha, ColorSpace, etc. */ unsigned int left; /* left display coordinate of frame */ unsigned int top; /* top display coordinate of frame */ unsigned int x; /* LockBits: left coordinate of locked rectangle */ unsigned int y; /* LockBits: top coordinate of locked rectangle */ int transparent; /* Index of transparent color (<24bit only) */ } ActiveBitmapData; typedef struct { int count; /* Number of bitmaps contained in this frame */ ActiveBitmapData *bitmap; /* Bitmaps for this frame */ GUID frame_dimension; /* GUID describing the frame type */ } FrameData; typedef struct _Image { /* Image Description */ ImageType type; /* Undefined, Bitmap, MetaFile */ ImageFormat image_format; /* BMP, TIF, GIF, PNG, etc. */ /* Image Data */ int num_of_frames; /* Number of frames */ FrameData *frames; /* Array of frames (Page, Time, Resolution) for the image */ /* Tracking of active image */ int active_frame; /* Index of frame currently used */ int active_bitmap_no; /* Index of active bitmap in current frame */ ActiveBitmapData *active_bitmap; /* Pointer to active frame/bitmap; DO NOT free() */ /* Internal fields */ int cairo_format; cairo_surface_t *surface; } GpBitmap; void gdip_bitmap_init (GpBitmap *bitmap) GDIP_INTERNAL; GpBitmap *gdip_bitmap_new (void) GDIP_INTERNAL; GpBitmap *gdip_bitmap_new_with_frame (const GUID *dimension, BOOL add_bitmapdata) GDIP_INTERNAL; FrameData *gdip_frame_add(GpBitmap *bitmap, const GUID *dimension) GDIP_INTERNAL; ActiveBitmapData *gdip_frame_add_bitmapdata(FrameData *frame) GDIP_INTERNAL; GpStatus gdip_bitmap_dispose (GpBitmap *bitmap) GDIP_INTERNAL; GpStatus gdip_bitmap_clone (GpBitmap *bitmap, GpBitmap **clonedbitmap) GDIP_INTERNAL; GpStatus gdip_bitmap_setactive (GpBitmap *bitmap, const GUID *dimension, int index) GDIP_INTERNAL; GpStatus gdip_bitmapdata_clone (ActiveBitmapData *src, ActiveBitmapData **dest, int count) GDIP_INTERNAL; ColorPalette *gdip_palette_clone(ColorPalette *original) GDIP_INTERNAL; GpStatus gdip_property_get_short (int offset, void *value, unsigned short *result) GDIP_INTERNAL; GpStatus gdip_property_get_long (int offset, void *value, guint32 *result) GDIP_INTERNAL; GpStatus gdip_property_get_srational (int offset, void *value, unsigned short *numerator, unsigned short *denominator) GDIP_INTERNAL; GpStatus gdip_property_get_rational (int offset, void *value, guint32 *numerator, guint32 *denominator) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add (ActiveBitmapData *bitmap_data, PROPID id, ULONG length, WORD type, VOID *value) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add_byte (ActiveBitmapData *bitmap_data, PROPID id, BYTE value) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add_short (ActiveBitmapData *bitmap_data, PROPID id, unsigned short value) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add_long (ActiveBitmapData *bitmap_data, PROPID id, guint32 value) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add_ASCII (ActiveBitmapData *bitmap_data, PROPID id, unsigned char *value) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add_rational (ActiveBitmapData *bitmap_data, PROPID id, guint32 numerator, guint32 denominator) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_add_srational (ActiveBitmapData *bitmap_data, PROPID id, unsigned short numerator, unsigned short denominator) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_remove_id (ActiveBitmapData *bitmap_data, PROPID id) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_remove_index (ActiveBitmapData *bitmap_data, int index) GDIP_INTERNAL; GpStatus gdip_bitmapdata_property_find_id (ActiveBitmapData *bitmap_data, PROPID id, int *index) GDIP_INTERNAL; cairo_surface_t* gdip_bitmap_ensure_surface (GpBitmap *bitmap) GDIP_INTERNAL; void gdip_bitmap_flush_surface (GpBitmap *bitmap) GDIP_INTERNAL; void gdip_bitmap_invalidate_surface (GpBitmap *bitmap) GDIP_INTERNAL; GpBitmap* gdip_convert_indexed_to_rgb (GpBitmap *bitmap) GDIP_INTERNAL; BOOL gdip_bitmap_format_needs_premultiplication (GpBitmap *bitmap) GDIP_INTERNAL; BYTE* gdip_bitmap_get_premultiplied_scan0 (GpBitmap *bitmap) GDIP_INTERNAL; void gdip_bitmap_get_premultiplied_scan0_inplace (GpBitmap *bitmap, BYTE *premul) GDIP_INTERNAL; void gdip_bitmap_get_premultiplied_scan0_reverse (GpBitmap *bitmap, BYTE *premul) GDIP_INTERNAL; GpStatus gdip_process_bitmap_attributes (GpBitmap *bitmap, void **dest, GpImageAttributes* attr, BOOL *allocated) GDIP_INTERNAL; ColorPalette* gdip_create_greyscale_palette (int num_colors) GDIP_INTERNAL; typedef struct { Rect region; int x, y; /* the offset of the next byte that will be loaded, once the buffer is depleted */ unsigned short buffer; int p; /* index of pixel within 'buffer' that was returned by the last call to gdip_pixel_stream_get_next () */ int one_pixel_mask; int one_pixel_shift; int pixels_per_byte; /* a negative value is used to indicate a count of bytes per pixel for depths of more than 8 bits */ ActiveBitmapData *data; BYTE *scan; } StreamingState; GpStatus gdip_init_pixel_stream (StreamingState *state, ActiveBitmapData *data, int x, int y, int w, int h) GDIP_INTERNAL; unsigned int gdip_pixel_stream_get_next (StreamingState *state) GDIP_INTERNAL; #include "bitmap.h" #endif libgdiplus-6.0.4+dfsg/src/text-metafile-private.h0000644000175000017500000000307413542674535022520 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __TEXT_METAFILE_PRIVATE_H__ #define __TEXT_METAFILE_PRIVATE_H__ #include "gdiplus-private.h" GpStatus metafile_DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, GpBrush *brush) GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/metafile.h0000644000175000017500000001265013542674535020066 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __METAFILE_H__ #define __METAFILE_H__ /* function prototypes */ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf (HMETAFILE hWmf, BOOL deleteWmf, GDIPCONST WmfPlaceableFileHeader *wmfPlaceableFileHeader, GpMetafile **metafile); GpStatus WINGDIPAPI GdipCreateMetafileFromEmf (HENHMETAFILE hEmf, BOOL deleteEmf, GpMetafile **metafile); GpStatus WINGDIPAPI GdipCreateMetafileFromFile (GDIPCONST WCHAR *file, GpMetafile **metafile); GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile (GDIPCONST WCHAR *file, GDIPCONST WmfPlaceableFileHeader *wmfPlaceableFileHeader, GpMetafile **metafile); GpStatus WINGDIPAPI GdipCreateMetafileFromStream (void *stream, GpMetafile **metafile); GpStatus WINGDIPAPI GdipCreateMetafileFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, GpMetafile **metafile); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromWmf (HMETAFILE hWmf, GDIPCONST WmfPlaceableFileHeader *wmfPlaceableFileHeader, MetafileHeader *header); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf (HENHMETAFILE hEmf, MetafileHeader *header); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile (GDIPCONST WCHAR *filename, MetafileHeader *header); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream (void *stream, MetafileHeader *header); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, MetafileHeader *header); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile (GpMetafile *metafile, MetafileHeader *header); GpStatus WINGDIPAPI GdipGetHemfFromMetafile (GpMetafile *metafile, HENHMETAFILE *hEmf); GpStatus WINGDIPAPI GdipGetMetafileDownLevelRasterizationLimit (GpMetafile *metafile, UINT *metafileRasterizationLimitDpi); GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit (GpMetafile *metafile, UINT metafileRasterizationLimitDpi); GpStatus WINGDIPAPI GdipPlayMetafileRecord (GDIPCONST GpMetafile *metafile, EmfPlusRecordType recordType, UINT flags, UINT dataSize, GDIPCONST BYTE* data); GpStatus WINGDIPAPI GdipRecordMetafile (HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); GpStatus WINGDIPAPI GdipRecordMetafileI (HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); GpStatus WINGDIPAPI GdipRecordMetafileFileName (GDIPCONST WCHAR *fileName, HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); GpStatus WINGDIPAPI GdipRecordMetafileFileNameI (GDIPCONST WCHAR *fileName, HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); GpStatus WINGDIPAPI GdipRecordMetafileStream (void /* IStream */ *stream, HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); GpStatus WINGDIPAPI GdipRecordMetafileStreamI (void /* IStream */ *stream, HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); /* extra public (exported) functions in libgdiplus to replace the IStream (COM-based) ones available on Windows */ GpStatus WINGDIPAPI GdipRecordMetafileFromDelegate_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, HDC referenceHdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); GpStatus WINGDIPAPI GdipRecordMetafileFromDelegateI_linux (GetHeaderDelegate getHeaderFunc, GetBytesDelegate getBytesFunc, PutBytesDelegate putBytesFunc, SeekDelegate seekFunc, CloseDelegate closeFunc, SizeDelegate sizeFunc, HDC referenceHdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *description, GpMetafile **metafile); #endif libgdiplus-6.0.4+dfsg/src/graphics-metafile-private.h0000644000175000017500000001335513542674535023337 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __GRAPHICS_METAFILE_PRIVATE_H__ #define __GRAPHICS_METAFILE_PRIVATE_H__ #include "gdiplus-private.h" #include "matrix-private.h" GpStatus metafile_DrawArc (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) GDIP_INTERNAL; GpStatus metafile_DrawBeziers (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) GDIP_INTERNAL; GpStatus metafile_DrawClosedCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count, float tension) GDIP_INTERNAL; GpStatus metafile_FillClosedCurve2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, float tension, GpFillMode fillMode) GDIP_INTERNAL; GpStatus metafile_DrawCurve3 (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPointF *points, int count, int offset, int numOfSegments, float tension) GDIP_INTERNAL; GpStatus metafile_DrawEllipse (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height) GDIP_INTERNAL; GpStatus metafile_FillEllipse (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height) GDIP_INTERNAL; GpStatus metafile_DrawLines (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) GDIP_INTERNAL; GpStatus metafile_FillRectangle (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height) GDIP_INTERNAL; GpStatus metafile_DrawRectangles (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, int count) GDIP_INTERNAL; GpStatus metafile_FillRectangles (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, int count) GDIP_INTERNAL; GpStatus metafile_DrawPath (GpGraphics *graphics, GpPen *pen, GpPath *path) GDIP_INTERNAL; GpStatus metafile_FillPath (GpGraphics *graphics, GpBrush *brush, GpPath *path) GDIP_INTERNAL; GpStatus metafile_DrawPie (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) GDIP_INTERNAL; GpStatus metafile_FillPie (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height, float startAngle, float sweepAngle) GDIP_INTERNAL; GpStatus metafile_DrawPolygon (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) GDIP_INTERNAL; GpStatus metafile_FillPolygon (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, FillMode fillMode) GDIP_INTERNAL; GpStatus metafile_FillRegion (GpGraphics *graphics, GpBrush *brush, GpRegion *region) GDIP_INTERNAL; GpStatus metafile_GraphicsClear (GpGraphics *graphics, ARGB color) GDIP_INTERNAL; GpStatus metafile_SetCompositingMode (GpGraphics *graphics, CompositingMode compositingMode) GDIP_INTERNAL; GpStatus metafile_SetCompositingQuality (GpGraphics *graphics, CompositingQuality compositingQuality) GDIP_INTERNAL; GpStatus metafile_SetInterpolationMode (GpGraphics *graphics, InterpolationMode interpolationMode) GDIP_INTERNAL; GpStatus metafile_SetPixelOffsetMode (GpGraphics *graphics, PixelOffsetMode pixelOffsetMode) GDIP_INTERNAL; GpStatus metafile_SetRenderingOrigin (GpGraphics *graphics, int x, int y) GDIP_INTERNAL; GpStatus metafile_SetPageTransform (GpGraphics *graphics, GpUnit unit, float scale) GDIP_INTERNAL; GpStatus metafile_SetSmoothingMode (GpGraphics *graphics, SmoothingMode mode) GDIP_INTERNAL; GpStatus metafile_SetTextContrast (GpGraphics *graphics, UINT contrast) GDIP_INTERNAL; GpStatus metafile_SetTextRenderingHint (GpGraphics *graphics, TextRenderingHint mode) GDIP_INTERNAL; GpStatus metafile_ResetClip (GpGraphics *graphics) GDIP_INTERNAL; GpStatus metafile_SetClipPath (GpGraphics *graphics, GpPath *path, CombineMode combineMode) GDIP_INTERNAL; GpStatus metafile_SetClipRect (GpGraphics *graphics, float x, float y, float width, float height, CombineMode combineMode) GDIP_INTERNAL; GpStatus metafile_SetClipRegion (GpGraphics *graphics, GpRegion *region, CombineMode combineMode) GDIP_INTERNAL; GpStatus metafile_TranslateClip (GpGraphics *graphics, float dx, float dy) GDIP_INTERNAL; GpStatus metafile_ResetWorldTransform (GpGraphics *graphics) GDIP_INTERNAL; GpStatus metafile_SetWorldTransform (GpGraphics *graphics, GpMatrix *matrix) GDIP_INTERNAL; GpStatus metafile_MultiplyWorldTransform (GpGraphics *graphics, GpMatrix *matrix, GpMatrixOrder order) GDIP_INTERNAL; GpStatus metafile_RotateWorldTransform (GpGraphics *graphics, float angle, GpMatrixOrder order) GDIP_INTERNAL; GpStatus metafile_ScaleWorldTransform (GpGraphics *graphics, float sx, float sy, GpMatrixOrder order) GDIP_INTERNAL; GpStatus metafile_TranslateWorldTransform (GpGraphics *graphics, float dx, float dy, GpMatrixOrder order) GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/icocodec.h0000644000175000017500000000357712377405421020047 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __ICOCODEC_H__ #define __ICOCODEC_H__ #include "bitmap-private.h" #include "bmpcodec.h" /* Information about the icon format can be found @ http://www.daubnet.com/formats/ICO.html */ typedef struct { BYTE bWidth; BYTE bHeight; BYTE bColorCount; BYTE bReserved; WORD wPlanes; WORD wBitCount; DWORD dwBytesInRes; DWORD dwImageOffset; } ICONDIRENTRY; #define gdip_read_ico_data gdip_read_bmp_data GpStatus gdip_load_ico_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_ico_image_from_stream_delegate (dstream_t *loader, GpImage **image) GDIP_INTERNAL; /* no save functions as the ICO "codec" is a decoder only */ ImageCodecInfo* gdip_getcodecinfo_ico () GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/pen.c0000644000175000017500000006125013545154623017047 0ustar directhexdirecthex/* * pen.c * * Copyright (c) 2003 Alexandre Pigolkine * Copyright (C) 2006 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine(pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Ravindra (rkumar@novell.com) * */ #include "pen-private.h" #include "solidbrush-private.h" #include "matrix-private.h" #include "general-private.h" #include "graphics-private.h" #include "customlinecap-private.h" static void gdip_pen_init (GpPen *pen) { pen->color = 0; pen->brush = NULL; pen->own_brush = FALSE; pen->width = 1; pen->miter_limit = 10; pen->line_join = LineJoinMiter; pen->dash_style = DashStyleSolid; pen->line_cap = LineCapFlat; pen->end_cap = LineCapFlat; /* ignored, Cairo only support a single start/end line cap */ pen->dash_cap = DashCapFlat; /* ignored */ pen->mode = PenAlignmentCenter; pen->dash_offset = 0; pen->dash_count = 0; pen->own_dash_array = FALSE; pen->dash_array = NULL; pen->compound_count = 0; pen->compound_array = NULL; pen->unit = UnitWorld; pen->changed = TRUE; pen->custom_start_cap = NULL; pen->custom_end_cap = NULL; cairo_matrix_init_identity (&pen->matrix); } static GpPen* gdip_pen_new (void) { GpPen *result = (GpPen *) GdipAlloc (sizeof (GpPen)); if (result) gdip_pen_init (result); return result; } static cairo_line_join_t convert_line_join (GpLineJoin join) { switch (join) { case LineJoinMiter: return CAIRO_LINE_JOIN_MITER; case LineJoinBevel: return CAIRO_LINE_JOIN_BEVEL; case LineJoinRound: return CAIRO_LINE_JOIN_ROUND; case LineJoinMiterClipped: default: return CAIRO_LINE_JOIN_MITER; } } static cairo_line_cap_t convert_line_cap (GpPen *pen) { switch (pen->line_cap) { /* HACK - this keeps SWF (mostly) happy with results very similar to GDI+ * (under those specific cases) and also keeps the pen's functionalities * on par with GDI+ */ case LineCapFlat: if (pen->dash_array || (pen->width > 1.0)) return CAIRO_LINE_CAP_BUTT; else return CAIRO_LINE_CAP_SQUARE; case LineCapSquare: return CAIRO_LINE_CAP_SQUARE; case LineCapRound: return CAIRO_LINE_CAP_ROUND; case LineCapTriangle: case LineCapNoAnchor: case LineCapSquareAnchor: case LineCapRoundAnchor: case LineCapDiamondAnchor: case LineCapArrowAnchor: case LineCapCustom: default: return CAIRO_LINE_CAP_BUTT; } } static double * convert_dash_array (float *f, double width, int count) { double *retval = GdipAlloc (sizeof (double) * count); if (!retval) return NULL; int i; for (i = 0; i < count; i++) { retval[i] = (double) f[i] * width; } return retval; } GpStatus gdip_pen_setup (GpGraphics *graphics, GpPen *pen) { GpStatus status; cairo_matrix_t product; double widthx; if (!graphics || !pen) return InvalidParameter; status = gdip_brush_setup (graphics, pen->brush); if (status != Ok) return status; cairo_matrix_init_identity (&product); /* Here we use product of pen->matrix and graphics->copy_of_ctm. * This gives us absolute results with respect to graphics. We * do following irrespective of the pen->changed state since graphics * has its own matrix and we need to multiply that with pen->matrix * every time we perform stroke operations. Graphics matrix gets * reset to its own state after stroking. */ cairo_matrix_multiply (&product, &pen->matrix, graphics->copy_of_ctm); /* Pen scaling by 0 are supported by MS GDI+ but would error in Cairo, see bug #338233 */ if (gdip_near_zero (product.xx) || gdip_near_zero (product.yy)) { /* *both* X and Y are affected if either is 0 */ product.xx = product.yy = 0.0001f; } gdip_cairo_set_matrix (graphics, &product); /* Don't need to setup, if pen is the same as the cached pen and * it is not changed. Just comparing pointers may not be sufficient * to say that the pens are same. It is possible to have different * pen on the same memory, but probability is very low. We would * need a function to check the equality of the pens in that case. */ if (pen == graphics->last_pen && !pen->changed) return Ok; if (pen->width < 1.0) { /* we draw a pixel wide line if width is < 1.0 */ double widthy = 1.0; widthx = 1.0; cairo_device_to_user_distance (graphics->ct, &widthx, &widthy); } else { widthx = (double) pen->width; } cairo_set_line_width (graphics->ct, widthx); cairo_set_miter_limit (graphics->ct, (double) pen->miter_limit); cairo_set_line_join (graphics->ct, convert_line_join (pen->line_join)); cairo_set_line_cap (graphics->ct, convert_line_cap (pen)); if (pen->dash_count > 0) { double *dash_array; /* note: pen->width may be different from what was used to call cairo_set_line_width, e.g. 0.0 (#78742) */ dash_array = convert_dash_array (pen->dash_array, widthx, pen->dash_count); if (!dash_array) return OutOfMemory; cairo_set_dash (graphics->ct, dash_array, pen->dash_count, pen->dash_offset); GdipFree (dash_array); } else /* Clear the dashes, if set in previous calls */ cairo_set_dash (graphics->ct, NULL, 0, 0); /* We are done with using all the changes in the pen. */ pen->changed = FALSE; graphics->last_pen = pen; return gdip_get_status (cairo_status (graphics->ct)); } GpStatus gdip_pen_draw_custom_start_cap (GpGraphics *graphics, GpPen *pen, float x1, float y1, float x2, float y2) { if (!graphics || !pen) return InvalidParameter; if (pen->custom_start_cap) { /* Draw the end cap */ gdip_linecap_draw (graphics, pen, pen->custom_start_cap, x1, y1, x2, y2); } return gdip_get_status (cairo_status (graphics->ct)); } GpStatus gdip_pen_draw_custom_end_cap (GpGraphics *graphics, GpPen *pen, float x1, float y1, float x2, float y2) { if (!graphics || !pen) return InvalidParameter; if (pen->custom_end_cap) { /* Draw the end cap */ gdip_linecap_draw (graphics, pen, pen->custom_end_cap, x1, y1, x2, y2); } return gdip_get_status (cairo_status (graphics->ct)); } // coverity[+alloc : arg-*3] GpStatus WINGDIPAPI GdipCreatePen1 (ARGB argb, REAL width, GpUnit unit, GpPen **pen) { GpStatus status; GpPen *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!pen || unit > UnitCairoPoint || unit == UnitDisplay) return InvalidParameter; result = gdip_pen_new (); if (!result) { *pen = NULL; return OutOfMemory; } result->color = argb; result->width = width; result->unit = unit; result->own_brush = TRUE; status = GdipCreateSolidFill (argb, (GpSolidFill **) &result->brush); if (status != Ok) { GdipDeletePen (result); *pen = NULL; return status; } *pen = result; return Ok; } // coverity[+alloc : arg-*3] GpStatus WINGDIPAPI GdipCreatePen2 (GpBrush *brush, REAL width, GpUnit unit, GpPen **pen) { GpPen *result; GpStatus status; GpBrushType type; ARGB color; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!brush || !pen || unit > UnitCairoPoint || unit == UnitDisplay) return InvalidParameter; result = gdip_pen_new (); if (!result) { *pen = NULL; return OutOfMemory; } result->width = width; result->unit = unit; result->own_brush = TRUE; /* The user supplied brush can be disposed, we must clone it to ensure * it's valid when we need to set the pen. */ status = GdipCloneBrush (brush, &result->brush); if (status != Ok) { GdipDeletePen (result); *pen = NULL; return status; } GdipGetBrushType (brush, &type); if (type == BrushTypeSolidColor) { GdipGetSolidFillColor ((GpSolidFill *) brush, &color); result->color = color; } *pen = result; return Ok; } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipClonePen (GpPen *pen, GpPen **clonepen) { GpPen *result; if (!pen || !clonepen) return InvalidParameter; result = gdip_pen_new (); if (!result) { *clonepen = NULL; return OutOfMemory; } result->own_brush = pen->own_brush; result->color = pen->color; result->width = pen->width; result->miter_limit = pen->miter_limit; result->line_join = pen->line_join; result->dash_style = pen->dash_style; result->line_cap = pen->line_cap; result->end_cap = pen->end_cap; result->mode = pen->mode; result->dash_offset = pen->dash_offset; result->dash_count = pen->dash_count; result->own_dash_array = pen->own_dash_array; result->compound_count = pen->compound_count; result->unit = pen->unit; gdip_cairo_matrix_copy (&result->matrix, &pen->matrix); result->changed = pen->changed; /* Make a copy of dash array only if it is owned by the pen - i.e. it is not * a global array. */ if (pen->dash_count > 0 && pen->own_dash_array) { result->dash_array = (float *) GdipAlloc (pen->dash_count * sizeof (float)); if (!result->dash_array) goto error; memcpy (result->dash_array, pen->dash_array, pen->dash_count * sizeof (float)); } else result->dash_array = pen->dash_array; if (pen->compound_count > 0) { result->compound_array = (float *) GdipAlloc (pen->compound_count * sizeof (float)); if (!result->compound_array) goto error; memcpy (result->compound_array, pen->compound_array, pen->compound_count * sizeof (float)); } if (pen->custom_start_cap) { GpStatus status = GdipCloneCustomLineCap (pen->custom_start_cap, &result->custom_start_cap); if (status != Ok) goto error; } if (pen->custom_end_cap) { GpStatus status = GdipCloneCustomLineCap (pen->custom_end_cap, &result->custom_end_cap); if (status != Ok) goto error; } if (pen->own_brush) { GpSolidFill *oldBrush = (GpSolidFill *) pen->brush; GpStatus status = GdipCreateSolidFill (oldBrush->color, (GpSolidFill **) &result->brush); if (status != Ok) goto error; } else { result->brush = pen->brush; } *clonepen = result; return Ok; error: GdipDeletePen (result); *clonepen = NULL; return OutOfMemory; } GpStatus WINGDIPAPI GdipDeletePen (GpPen *pen) { if (!pen) return InvalidParameter; if (pen->dash_count != 0 && pen->own_dash_array) { GdipFree (pen->dash_array); pen->dash_count = 0; pen->dash_array = NULL; } if (pen->own_brush && pen->brush) { GdipDeleteBrush (pen->brush); pen->brush = NULL; } if (pen->compound_count != 0) { GdipFree (pen->compound_array); pen->compound_array = NULL; pen->compound_count = 0; } if (pen->custom_start_cap != NULL) { GdipDeleteCustomLineCap (pen->custom_start_cap); pen->custom_start_cap = NULL; } if (pen->custom_end_cap != NULL) { GdipDeleteCustomLineCap (pen->custom_end_cap); pen->custom_end_cap = NULL; } GdipFree (pen); return Ok; } GpStatus WINGDIPAPI GdipSetPenWidth (GpPen *pen, REAL width) { if (!pen) return InvalidParameter; if (pen->width != width) { pen->width = width; pen->changed = TRUE; } return Ok; } GpStatus WINGDIPAPI GdipGetPenWidth (GpPen *pen, REAL *width) { if (!pen || !width) return InvalidParameter; *width = pen->width; return Ok; } GpStatus WINGDIPAPI GdipSetPenBrushFill (GpPen *pen, GpBrush *brush) { GpBrushType type; if (!pen || !brush) return InvalidParameter; GdipGetBrushType (brush, &type); if (type == BrushTypeSolidColor) GdipGetSolidFillColor ((GpSolidFill *) brush, &pen->color); else pen->color = 0; if (pen->own_brush && pen->brush) GdipDeleteBrush (pen->brush); pen->brush = brush; pen->changed = TRUE; pen->own_brush = FALSE; return Ok; } GpStatus WINGDIPAPI GdipGetPenBrushFill (GpPen *pen, GpBrush **brush) { if (!pen) return InvalidParameter; return GdipCloneBrush (pen->brush, brush); } GpStatus WINGDIPAPI GdipGetPenFillType (GpPen *pen, GpPenType *type) { if (!pen || !type) return InvalidParameter; if (pen->brush) return GdipGetBrushType (pen->brush, (GpBrushType *) type); *type = PenTypeSolidColor; return Ok; } GpStatus WINGDIPAPI GdipSetPenColor (GpPen *pen, ARGB argb) { GpStatus status; GpSolidFill *brush; GpBrushType type; if (!pen) return InvalidParameter; GdipGetBrushType (pen->brush, &type); if (type == BrushTypeSolidColor) { ARGB brushColor; GdipGetSolidFillColor ((GpSolidFill *) pen->brush, &brushColor); // Nothing to do. if (brushColor == argb) return Ok; } // Override the brush and set it to a solid fill. status = GdipCreateSolidFill (argb, &brush); if (status != Ok) return status; pen->color = argb; pen->brush = (GpBrush *) brush; pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPenColor (GpPen *pen, ARGB *argb) { if (!pen || !argb) return InvalidParameter; if(pen->brush->vtable->type != BrushTypeSolidColor) return InvalidParameter; *argb = pen->color; return Ok; } GpStatus WINGDIPAPI GdipSetPenMiterLimit (GpPen *pen, REAL miterLimit) { if (!pen) return InvalidParameter; if (miterLimit < 1.0f) miterLimit = 1.0f; if (pen->miter_limit != miterLimit) { pen->miter_limit = miterLimit; pen->changed = TRUE; } return Ok; } GpStatus WINGDIPAPI GdipGetPenMiterLimit (GpPen *pen, REAL *miterLimit) { if (!pen || !miterLimit) return InvalidParameter; *miterLimit = pen->miter_limit; return Ok; } GpStatus WINGDIPAPI GdipSetPenLineJoin (GpPen *pen, GpLineJoin lineJoin) { if (!pen) return InvalidParameter; if (pen->line_join != lineJoin) { pen->line_join = lineJoin; pen->changed = TRUE; } return Ok; } GpStatus WINGDIPAPI GdipGetPenLineJoin (GpPen *pen, GpLineJoin *lineJoin) { if (!pen || !lineJoin) return InvalidParameter; *lineJoin = pen->line_join; return Ok; } GpStatus WINGDIPAPI GdipSetPenLineCap197819 (GpPen *pen, GpLineCap startCap, GpLineCap endCap, GpDashCap dashCap) { if (!pen) return InvalidParameter; /* FIXME: * Cairo supports only one cap for a line. We use startcap for that. * Use end cap and dash cap when Cairo supports different caps for the * line ends and dashcap. */ pen->line_cap = startCap; pen->end_cap = endCap; /* any invalid value is changed to DashCapFlat */ if ((dashCap == DashCapRound) || (dashCap == DashCapTriangle)) pen->dash_cap = dashCap; else pen->dash_cap = DashCapFlat; /* default */ pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetPenMode (GpPen *pen, GpPenAlignment penMode) { if (!pen) return InvalidParameter; if (penMode == PenAlignmentInset && pen->compound_count > 0) return NotImplemented; if (pen->mode != penMode) { pen->mode = penMode; pen->changed = TRUE; } return Ok; } GpStatus WINGDIPAPI GdipGetPenMode (GpPen *pen, GpPenAlignment *penMode) { if (!pen || !penMode) return InvalidParameter; *penMode = pen->mode; return Ok; } GpStatus WINGDIPAPI GdipGetPenUnit (GpPen *pen, GpUnit *unit) { if (!pen || !unit) return InvalidParameter; *unit = pen->unit; return Ok; } GpStatus WINGDIPAPI GdipSetPenUnit (GpPen *pen, GpUnit unit) { if (!pen || unit < UnitWorld || unit > UnitCairoPoint || unit == UnitDisplay) return InvalidParameter; if (unit != pen->unit) { pen->unit = unit; pen->changed = TRUE; } return Ok; } GpStatus WINGDIPAPI GdipSetPenTransform (GpPen *pen, GpMatrix *matrix) { BOOL invertible; if (!pen || !matrix) return InvalidParameter; /* the matrix MUST be invertible to be used */ GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; gdip_cairo_matrix_copy (&pen->matrix, matrix); pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPenTransform (GpPen *pen, GpMatrix *matrix) { if (!pen || !matrix) return InvalidParameter; gdip_cairo_matrix_copy (matrix, &pen->matrix); return Ok; } GpStatus WINGDIPAPI GdipResetPenTransform (GpPen *pen) { if (!pen) return InvalidParameter; cairo_matrix_init_identity (&pen->matrix); pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipMultiplyPenTransform (GpPen *pen, GpMatrix *matrix, GpMatrixOrder order) { BOOL invertible; if (!pen) return InvalidParameter; if (!matrix) return Ok; /* the matrix MUST be invertible to be used */ GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; if (order == MatrixOrderPrepend) cairo_matrix_multiply (&pen->matrix, matrix, &pen->matrix); else cairo_matrix_multiply (&pen->matrix, &pen->matrix, matrix); pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipTranslatePenTransform (GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order) { GpStatus status; if (!pen) return InvalidParameter; status = GdipTranslateMatrix (&pen->matrix, dx, dy, order); if (status != Ok) return status; pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipScalePenTransform (GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order) { GpStatus status; if (!pen) return InvalidParameter; status = GdipScaleMatrix (&pen->matrix, sx, sy, order); if (status != Ok) return status; pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipRotatePenTransform (GpPen *pen, REAL angle, GpMatrixOrder order) { GpStatus status; if (!pen) return InvalidParameter; status = GdipRotateMatrix (&pen->matrix, angle, order); if (status != Ok) return status; pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPenDashStyle (GpPen *pen, GpDashStyle *dashstyle) { if (!pen || !dashstyle) return InvalidParameter; *dashstyle = pen->dash_style; return Ok; } static float Dot [] = { 1.0, 1.0 }; static float Dash [] = { 3.0, 1.0 }; static float DashDot [] = { 3.0, 1.0, 1.0, 1.0 }; static float DashDotDot [] = { 3.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; GpStatus WINGDIPAPI GdipSetPenDashStyle (GpPen *pen, GpDashStyle dashstyle) { if (!pen) return InvalidParameter; switch (dashstyle) { case DashStyleSolid: pen->dash_array = NULL; pen->dash_count = 0; break; case DashStyleDashDot: pen->dash_array = DashDot; pen->dash_count = 4; break; case DashStyleDashDotDot: pen->dash_array = DashDotDot; pen->dash_count = 6; break; case DashStyleDot: pen->dash_array = Dot; pen->dash_count = 2; break; case DashStyleDash: pen->dash_array = Dash; pen->dash_count = 2; break; case DashStyleCustom: /* we keep the current assigned value when switching to Custom */ /* other special stuff happens in System.Drawing (but not here) */ break; default: /* GDI+ does nothing if the dash style is invalid */ return Ok; } pen->dash_style = dashstyle; pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPenDashOffset (GpPen *pen, REAL *offset) { if (!pen || !offset) return InvalidParameter; *offset = pen->dash_offset; return Ok; } GpStatus WINGDIPAPI GdipSetPenDashOffset (GpPen *pen, REAL offset) { if (!pen) return InvalidParameter; if (pen->dash_offset != offset) { pen->dash_offset = offset; pen->changed = TRUE; } return Ok; } GpStatus WINGDIPAPI GdipGetPenDashCount (GpPen *pen, INT *count) { if (!pen || !count) return InvalidParameter; *count = pen->dash_count; return Ok; } GpStatus WINGDIPAPI GdipGetPenDashArray (GpPen *pen, REAL *dash, INT count) { if (!pen || !dash || count > pen->dash_count) return InvalidParameter; if (!pen->dash_array) return OutOfMemory; if (count < 0) return OutOfMemory; memcpy (dash, pen->dash_array, count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipSetPenDashArray (GpPen *pen, GDIPCONST REAL *dash, INT count) { float *dash_array; REAL sum = 0; if (!pen || !dash || (count <= 0)) return InvalidParameter; for(int i = 0; i < count; i++) { sum += dash[i]; if(dash[i] < 0.0) return InvalidParameter; } if (sum == 0.0) return InvalidParameter; if (pen->dash_count != count || !pen->own_dash_array) { dash_array = (float *) GdipAlloc (count * sizeof (float)); if (!dash_array) return OutOfMemory; /* free the existing values, if we own them */ if (pen->dash_count != 0 && pen->own_dash_array) GdipFree (pen->dash_array); pen->dash_array = dash_array; pen->dash_count = count; pen->own_dash_array = TRUE; } memcpy (pen->dash_array, dash, pen->dash_count * sizeof (float)); pen->dash_style = DashStyleCustom; pen->changed = TRUE; return Ok; } /* * MonoTODO: Find out what the difference is between CompoundArray and DashArray */ GpStatus WINGDIPAPI GdipGetPenCompoundCount (GpPen *pen, INT *count) { if (!pen || !count) return InvalidParameter; *count = pen->compound_count; return Ok; } GpStatus WINGDIPAPI GdipSetPenCompoundArray (GpPen *pen, GDIPCONST REAL *compound, INT count) { float minValue = 0.0f; float *compound_array; if (!pen || !compound || count <= 0 || count % 2 == 1) return InvalidParameter; if (pen->mode == PenAlignmentInset) return NotImplemented; /* All values have to be in ascending order and be between 0 and 1. */ for (int i = 0; i < count; i++) { float value = compound[i]; if (value < minValue || value > 1.0f) return InvalidParameter; minValue = value; } if (pen->compound_count != count) { compound_array = (float *) GdipAlloc (count * sizeof (float)); if (!compound_array) return OutOfMemory; /* free the existing values */ if (pen->compound_count) GdipFree (pen->compound_array); pen->compound_array = compound_array; pen->compound_count = count; } memcpy (pen->compound_array, compound, pen->compound_count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipGetPenCompoundArray (GpPen *pen, REAL *compound, INT count) { if (!pen || !compound || count > pen->compound_count) return InvalidParameter; /* GDI+ does nothing if count <= 0. */ if (count <= 0) return Ok; memcpy (compound, pen->compound_array, count * sizeof (float)); return Ok; } GpStatus WINGDIPAPI GdipSetPenStartCap (GpPen *pen, GpLineCap startCap) { if (!pen) return InvalidParameter; GdipDeleteCustomLineCap (pen->custom_start_cap); pen->custom_start_cap = NULL; pen->line_cap = startCap; pen->changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetPenStartCap (GpPen *pen, GpLineCap *startCap) { if (!pen || !startCap) return InvalidParameter; *startCap = pen->line_cap; return Ok; } /* MonoTODO - ignored (always same as start cap) */ GpStatus WINGDIPAPI GdipSetPenEndCap (GpPen *pen, GpLineCap endCap) { if (!pen) return InvalidParameter; /* * This is currently ignored, as Cairo does not support * having a different start and end Cap */ GdipDeleteCustomLineCap (pen->custom_end_cap); pen->custom_end_cap = NULL; pen->end_cap = endCap; pen->changed = TRUE; return Ok; } /* MonoTODO - ignored (always same as start cap) */ GpStatus WINGDIPAPI GdipGetPenEndCap (GpPen *pen, GpLineCap *endCap) { if (!pen || !endCap) return InvalidParameter; *endCap = pen->end_cap; return Ok; } /* MonoTODO - ignored */ GpStatus WINGDIPAPI GdipSetPenDashCap197819 (GpPen *pen, GpDashCap dashCap) { if (!pen) return InvalidParameter; /* Any invalid value is changed to DashCapFlat. */ if (dashCap == DashCapRound || dashCap == DashCapTriangle) pen->dash_cap = dashCap; else pen->dash_cap = DashCapFlat; return Ok; } /* MonoTODO - ignored */ GpStatus WINGDIPAPI GdipGetPenDashCap197819 (GpPen *pen, GpDashCap *dashCap) { if (!pen || !dashCap) return InvalidParameter; *dashCap = pen->dash_cap; return Ok; } GpStatus WINGDIPAPI GdipSetPenCustomStartCap (GpPen *pen, GpCustomLineCap *customCap) { GpStatus status; GpCustomLineCap *clonedCap; if (!pen) return InvalidParameter; status = GdipCloneCustomLineCap (customCap, &clonedCap); if (status == Ok) { pen->custom_start_cap = clonedCap; pen->line_cap = LineCapCustom; } return status; } GpStatus WINGDIPAPI GdipGetPenCustomStartCap (GpPen *pen, GpCustomLineCap **customCap) { if (!pen || !customCap) return InvalidParameter; if (!pen->custom_start_cap) { *customCap = NULL; return Ok; } return GdipCloneCustomLineCap (pen->custom_start_cap, customCap); } GpStatus WINGDIPAPI GdipSetPenCustomEndCap (GpPen *pen, GpCustomLineCap *customCap) { GpStatus status; GpCustomLineCap *clonedCap; if (!pen) return InvalidParameter; status = GdipCloneCustomLineCap (customCap, &clonedCap); if (status == Ok) { pen->custom_end_cap = clonedCap; pen->end_cap = LineCapCustom; } return status; } GpStatus WINGDIPAPI GdipGetPenCustomEndCap (GpPen *pen, GpCustomLineCap **customCap) { if (!pen || !customCap) return InvalidParameter; if (!pen->custom_end_cap) { *customCap = NULL; return Ok; } return GdipCloneCustomLineCap (pen->custom_end_cap, customCap); } libgdiplus-6.0.4+dfsg/src/region-bitmap.h0000644000175000017500000000614713542674535021041 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __REGION_BITMAP_H__ #define __REGION_BITMAP_H__ #include "gdiplus-private.h" #include "bitmap-private.h" /* * REGION_MAX_BITMAP_SIZE defines the size limit of the region bitmap we keep * in memory. The current value is 2 megabits which should be enough for any * on-screen region. Before changing this value remember that a "real", but * temporary, ARGB32 bitmap (32 times bigger, i.e. 8MB) may be allocated when * converting the path into the region bitmap. */ #define REGION_MAX_BITMAP_SIZE (2 * 1024 * 1024 >> 3) #define SHAPE_SIZE(shape) (((shape)->Width * (shape)->Height) >> 3) typedef struct { int X; int Y; int Width; int Height; unsigned char *Mask; BOOL reduced; } GpRegionBitmap; void gdip_region_bitmap_ensure (GpRegion *region) GDIP_INTERNAL; GpRegionBitmap* gdip_region_bitmap_from_path (GpPath *path) GDIP_INTERNAL; GpRegionBitmap* gdip_region_bitmap_clone (GpRegionBitmap *bitmap) GDIP_INTERNAL; void gdip_region_bitmap_free (GpRegionBitmap *bitmap) GDIP_INTERNAL; void gdip_region_bitmap_invalidate (GpRegion *region) GDIP_INTERNAL; BOOL gdip_region_bitmap_compare (GpRegionBitmap *shape1, GpRegionBitmap *shape2) GDIP_INTERNAL; BOOL gdip_region_bitmap_is_point_visible (GpRegionBitmap *bitmap, int x, int y) GDIP_INTERNAL; BOOL gdip_region_bitmap_is_rect_visible (GpRegionBitmap *bitmap, GpRect *rect) GDIP_INTERNAL; int gdip_region_bitmap_get_scans (GpRegionBitmap *bitmap, GpRectF *rect) GDIP_INTERNAL; void gdip_region_bitmap_get_smallest_rect (GpRegionBitmap *bitmap, GpRect *rect) GDIP_INTERNAL; void gdip_region_bitmap_shrink (GpRegionBitmap *bitmap, BOOL always_shrink) GDIP_INTERNAL; cairo_surface_t *gdip_region_bitmap_to_cairo_surface (GpRegionBitmap *bitmap) GDIP_INTERNAL; GpRegionBitmap* gdip_region_bitmap_combine (GpRegionBitmap *bitmap1, GpRegionBitmap* bitmap2, CombineMode combineMode) GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/graphics-path.c0000644000175000017500000014675413545154623021034 0ustar directhexdirecthex/* * graphics-path.c * * Copyright (C) 2003-2007, Novell Inc. (http://www.novell.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. * * Authors: * Duncan Mak (duncan@ximian.com) * Ravindra (rkumar@novell.com) * Sebastien Pouliot */ #include "graphics-path-private.h" #include "matrix-private.h" #include "font-private.h" #include "graphics-cairo-private.h" #include "fontfamily.h" #ifdef USE_PANGO_RENDERING #include "text-pango-private.h" #endif BOOL gdip_path_ensure_size (GpPath *path, int size) { BYTE *new_types; GpPointF *new_points; if (path->size < size) { if (size < path->size + 64) size = path->size + 64; new_types = gdip_realloc (path->types, size * sizeof (BYTE)); if (!new_types) return FALSE; path->types = new_types; new_points = gdip_realloc (path->points, size * sizeof (GpPointF)); if (!new_points) return FALSE; path->points = new_points; path->size = size; } return TRUE; } /* return TRUE if the specified path has (at least one) curves, FALSE otherwise */ BOOL gdip_path_has_curve (GpPath *path) { int i; if (!path) return FALSE; for (i = 0; i < path->count; i++) { if (path->types[i] == PathPointTypeBezier) return TRUE; } return FALSE; } BOOL gdip_path_closed (GpPath *path) { if (path->count < 1) { return FALSE; } PathPointType last_type = path->types[path->count - 1]; return (last_type & PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath; } /* * Return the correct point type when adding a new shape to the path. */ static PathPointType gdip_get_first_point_type (GpPath *path) { PathPointType type; /* check for a new figure flag or an empty path */ if (path->start_new_fig || (path->count == 0)) return PathPointTypeStart; /* check if the previous point is a closure */ type = path->types[path->count - 1]; if (type & PathPointTypeCloseSubpath) return PathPointTypeStart; else return PathPointTypeLine; } static VOID append (GpPath *path, float x, float y, PathPointType type, BOOL compress) { BYTE t = (BYTE) type; GpPointF pt; if (path->start_new_fig) { t = PathPointTypeStart; } else if (path->count > 0) { /* in some case we're allowed to compress identical points */ if (compress) { /* points (X, Y) must be identical */ GpPointF lastPoint = path->points[path->count - 1]; if ((lastPoint.X == x) && (lastPoint.Y == y)) { /* types need not be identical but must handle closed subpaths */ if (!gdip_path_closed (path)) { if ((type & PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) path->types[path->count - 1] |= PathPointTypeCloseSubpath; return; } } } /* if we closed a subpath, then start new figure and append */ type = path->types[path->count - 1]; if (type & PathPointTypeCloseSubpath) t = PathPointTypeStart; } pt.X = x; pt.Y = y; /* all external APIs resize the buffers beforehand and fail gracefully */ if (!gdip_path_ensure_size (path, path->count + 1)) g_assert(FALSE); path->points[path->count] = pt; path->types[path->count] = t; path->count++; path->start_new_fig = FALSE; } static VOID append_point (GpPath *path, GpPointF pt, PathPointType type, BOOL compress) { append (path, pt.X, pt.Y, type, compress); } static VOID append_bezier (GpPath *path, float x1, float y1, float x2, float y2, float x3, float y3) { append (path, x1, y1, PathPointTypeBezier3, FALSE); append (path, x2, y2, PathPointTypeBezier3, FALSE); append (path, x3, y3, PathPointTypeBezier3, FALSE); } static VOID append_curve (GpPath *path, const GpPointF *points, GpPointF *tangents, int offset, int length, _CurveType type) { int i; PathPointType ptype = ((type == CURVE_CLOSE) || (path->count == 0)) ? PathPointTypeStart : PathPointTypeLine; append_point (path, points [offset], ptype, TRUE); for (i = offset; i < offset + length; i++) { int j = i + 1; double x1 = points [i].X + tangents [i].X; double y1 = points [i].Y + tangents [i].Y; double x2 = points [j].X - tangents [j].X; double y2 = points [j].Y - tangents [j].Y; double x3 = points [j].X; double y3 = points [j].Y; append_bezier (path, x1, y1, x2, y2, x3, y3); } if (type == CURVE_CLOSE) { /* complete (close) the curve using the first point */ double x1 = points [i].X + tangents [i].X; double y1 = points [i].Y + tangents [i].Y; double x2 = points [0].X - tangents [0].X; double y2 = points [0].Y - tangents [0].Y; double x3 = points [0].X; double y3 = points [0].Y; append_bezier (path, x1, y1, x2, y2, x3, y3); GdipClosePathFigure (path); } } static BOOL gdip_validate_path_types (const BYTE *types, INT count) { const BYTE *currentType = types; INT remaining = count; if (count == 1) return TRUE; while (TRUE) { remaining--; currentType++; // No more. if (remaining == 0) return FALSE; // Already started. if ((*currentType & PathPointTypePathTypeMask) == PathPointTypeStart) return FALSE; do { if ((*currentType & PathPointTypePathTypeMask) == PathPointTypeLine) { // No validation needed for lines. Move to the next type. } else if ((*currentType & PathPointTypePathTypeMask) == PathPointTypeBezier) { // A bezier path requires a start point (already handled) followed by 3 bezier // points. remaining--; currentType++; if (remaining == 0 || (*currentType & PathPointTypePathTypeMask) != PathPointTypeBezier) return FALSE; remaining--; currentType++; if (remaining == 0 || (*currentType & PathPointTypePathTypeMask) != PathPointTypeBezier) return FALSE; } else { // Unknown type. return FALSE; } BOOL endOfPath = (*currentType & PathPointTypeCloseSubpath) != 0; remaining--; currentType++; // End of an open path. There are no more subpaths. if (remaining == 0) return TRUE; // End of a closed path. There may be additional subpaths. if (endOfPath) break; } while ((*currentType & PathPointTypePathTypeMask) != PathPointTypeStart); } return TRUE; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipCreatePath (FillMode fillMode, GpPath **path) { GpPath *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!path) return InvalidParameter; result = (GpPath *) GdipAlloc (sizeof (GpPath)); if (!result) return OutOfMemory; result->fill_mode = fillMode; result->size = 0; result->points = NULL; result->types = NULL; result->count = 0; result->start_new_fig = TRUE; *path = result; return Ok; } /* coverity[+alloc : arg-*4] */ GpStatus WINGDIPAPI GdipCreatePath2 (GDIPCONST GpPointF *points, GDIPCONST BYTE *types, INT count, FillMode fillMode, GpPath **path) { GpPath *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!path || !points || !types) return InvalidParameter; if (count <= 0 || fillMode > FillModeWinding) return OutOfMemory; // Match GDI+ behaviour and set the path to empty if it is invalid. if (!gdip_validate_path_types (types, count)) return GdipCreatePath (fillMode, path); result = (GpPath *) GdipAlloc (sizeof (GpPath)); if (!result) return OutOfMemory; result->fill_mode = fillMode; result->count = count; result->size = (count + 63) & ~63; result->points = GdipAlloc (sizeof (GpPointF) * result->size); if (!result->points) { GdipFree (result); return OutOfMemory; } result->types = GdipAlloc (sizeof (BYTE) * result->size); if (!result->types) { GdipFree (result->points); GdipFree (result); return OutOfMemory; } memcpy (result->points, points, sizeof (GpPointF) * count); memcpy (result->types, types, sizeof (BYTE) * count); // Match GDI+ behaviour by normalizing the start of the type array. result->types[0] = PathPointTypeStart; *path = result; return Ok; } /* coverity[+alloc : arg-*4] */ GpStatus WINGDIPAPI GdipCreatePath2I (GDIPCONST GpPoint *points, GDIPCONST BYTE *types, INT count, FillMode fillMode, GpPath **path) { GpPointF *pt; GpStatus s; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!points || !types || !path) return InvalidParameter; if (count < 0) return OutOfMemory; pt = convert_points (points, count); if (!pt) return OutOfMemory; s = GdipCreatePath2 (pt, types, count, fillMode, path); GdipFree (pt); return s; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipClonePath (GpPath *path, GpPath **clonePath) { GpPath *result; if (!path || !clonePath) return InvalidParameter; result = (GpPath *) GdipAlloc (sizeof (GpPath)); if (!result) return OutOfMemory; result->fill_mode = path->fill_mode; result->count = path->count; result->size = path->size; result->points = GdipAlloc (sizeof (GpPointF) * result->size); if (!result->points) { GdipFree (result); return OutOfMemory; } result->types = GdipAlloc (sizeof (BYTE) * result->size); if (!result->types) { GdipFree (result->points); GdipFree (result); return OutOfMemory; } memcpy (result->points, path->points, sizeof (GpPointF) * path->count); memcpy (result->types, path->types, sizeof (BYTE) * path->count); result->start_new_fig = path->start_new_fig; *clonePath = result; return Ok; } GpStatus WINGDIPAPI GdipDeletePath (GpPath *path) { if (path == NULL) return InvalidParameter; if (path->points != NULL) GdipFree (path->points); path->points = NULL; if (path->types != NULL) GdipFree (path->types); path->types = NULL; GdipFree (path); return Ok; } GpStatus WINGDIPAPI GdipResetPath (GpPath *path) { if (path == NULL) return InvalidParameter; path->count = 0; path->fill_mode = FillModeAlternate; path->start_new_fig = TRUE; path->size = 0; if (path->points != NULL) GdipFree (path->points); if (path->types != NULL) GdipFree (path->types); path->points = NULL; path->types = NULL; return Ok; } GpStatus WINGDIPAPI GdipGetPointCount (GpPath *path, int *count) { if (!path || !count) return InvalidParameter; *count = path->count; return Ok; } GpStatus WINGDIPAPI GdipGetPathTypes (GpPath *path, BYTE *types, INT count) { if (!path || !types || count <= 0) return InvalidParameter; if (count < path->count) return InsufficientBuffer; memcpy (types, path->types, path->count * sizeof (BYTE)); return Ok; } GpStatus WINGDIPAPI GdipGetPathPoints (GpPath *path, GpPointF *points, int count) { if (!path || !points || count <= 0) return InvalidParameter; if (count < path->count) return InsufficientBuffer; memcpy (points, path->points, path->count * sizeof (GpPointF)); return Ok; } GpStatus WINGDIPAPI GdipGetPathPointsI (GpPath *path, GpPoint *points, int count) { if (!path || !points || count <= 0) return InvalidParameter; if (count < path->count) return InsufficientBuffer; for (int i = 0; i < path->count; i++) gdip_Point_from_PointF (path->points + i, points + i); return Ok; } GpStatus WINGDIPAPI GdipGetPathFillMode (GpPath *path, FillMode *fillMode) { if (!path || !fillMode) return InvalidParameter; *fillMode = path->fill_mode; return Ok; } GpStatus WINGDIPAPI GdipSetPathFillMode (GpPath *path, FillMode fillMode) { if (!path) return InvalidParameter; path->fill_mode = fillMode; return Ok; } GpStatus WINGDIPAPI GdipGetPathData (GpPath *path, GpPathData *pathData) { if (!path || !pathData || !pathData->Points || !pathData->Types || pathData->Count < 0) return InvalidParameter; if (pathData->Count < path->count) return OutOfMemory; memcpy (pathData->Points, path->points, path->count * sizeof (GpPointF)); memcpy (pathData->Types, path->types, path->count * sizeof (BYTE)); pathData->Count = path->count; return Ok; } GpStatus WINGDIPAPI GdipStartPathFigure (GpPath *path) { if (!path) return InvalidParameter; path->start_new_fig = TRUE; return Ok; } GpStatus WINGDIPAPI GdipClosePathFigure (GpPath *path) { if (!path) return InvalidParameter; // Close the last figure. if (path->count > 1) path->types[path->count - 1] |= PathPointTypeCloseSubpath; // Start a new figure. path->start_new_fig = TRUE; return Ok; } GpStatus WINGDIPAPI GdipClosePathFigures (GpPath *path) { if (!path) return InvalidParameter; if (path->count > 1) { // Close the last figure. path->types[path->count - 1] |= PathPointTypeCloseSubpath; // Close each open figure. for (int index = 1; index < path->count; index++) { if (path->types[index] == PathPointTypeStart) { path->types[index - 1] |= PathPointTypeCloseSubpath; } } } // Start a new figure. path->start_new_fig = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetPathMarker (GpPath *path) { if (!path) return InvalidParameter; if (path->count > 1) path->types[path->count - 1] |= PathPointTypePathMarker; return Ok; } GpStatus WINGDIPAPI GdipClearPathMarkers (GpPath *path) { if (!path) return InvalidParameter; for (int i = 0; i < path->count; i++) path->types[i] &= ~PathPointTypePathMarker; return Ok; } /* * Append old_types[start, end] to new_types, adjusting flags. */ static void reverse_subpath_adjust_flags (int start, int end, BYTE *types, BOOL *prev_had_marker) { BYTE prev_last; /* Copy all but PathPointTypeStart */ if (end != start) memmove (types + start, types + start + 1, (end - start) * sizeof (BYTE)); /* Append PathPointTypeStart */ prev_last = types[end]; types[end] = PathPointTypeStart; /* Remove potential flags from our future start point */ if (end != start) types[end - 1] &= PathPointTypePathTypeMask; /* Set the flags on our to-be-last point */ types[start] |= prev_last & (PathPointTypeDashMode | PathPointTypeCloseSubpath); /* If the last point of the previous subpath had a marker, we inherit it */ if (*prev_had_marker) types[start] |= PathPointTypePathMarker; else types[start] &= ~PathPointTypePathMarker; *prev_had_marker = ((prev_last & PathPointTypePathMarker) == PathPointTypePathMarker); } GpStatus WINGDIPAPI GdipReversePath (GpPath *path) { int length, i; int start = 0; BOOL prev_had_marker = FALSE; if (!path) return InvalidParameter; length = path->count; /* shortcut */ if (length <= 1) return Ok; /* PathTypes reversal */ /* First adjust the flags for each subpath */ for (i = 1; i < length; i++) { BYTE t = path->types[i]; if ((t & PathPointTypePathTypeMask) == PathPointTypeStart) { reverse_subpath_adjust_flags (start, i - 1, path->types, &prev_had_marker); start = i; } } if (start < length - 1) reverse_subpath_adjust_flags (start, length - 1, path->types, &prev_had_marker); /* Then reverse the resulting array */ for (i = 0; i < (length >> 1); i++) { BYTE *a = path->types + i; BYTE *b = path->types + length - i - 1; BYTE temp = *a; *a = *b; *b = temp; } /* PathPoints reversal * note: if length is odd then the middle point doesn't need to switch side */ for (i = 0; i < (length >> 1); i++) { GpPointF *first = path->points + i; GpPointF *last = path->points + length - i - 1; GpPointF temp; temp.X = first->X; temp.Y = first->Y; first->X = last->X; first->Y = last->Y; last->X = temp.X; last->Y = temp.Y; } return Ok; } GpStatus WINGDIPAPI GdipGetPathLastPoint (GpPath *path, GpPointF *lastPoint) { if (!path || !lastPoint || (path->count <= 0)) return InvalidParameter; *lastPoint = path->points[path->count - 1]; return Ok; } GpStatus WINGDIPAPI GdipAddPathLine (GpPath *path, float x1, float y1, float x2, float y2) { if (!path) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + 2)) return OutOfMemory; /* only the first point can be compressed (i.e. removed if identical to previous) */ append (path, x1, y1, PathPointTypeLine, TRUE); append (path, x2, y2, PathPointTypeLine, FALSE); return Ok; } GpStatus WINGDIPAPI GdipAddPathLine2 (GpPath *path, const GpPointF *points, int count) { int i; GpPointF *tmp; if (!path || !points || (count < 0)) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + count)) return OutOfMemory; /* only the first point can be compressed (i.e. removed if identical to previous) */ for (i = 0, tmp = (GpPointF*) points; i < count; i++, tmp++) append (path, tmp->X, tmp->Y, PathPointTypeLine, (i == 0)); return Ok; } static VOID append_arc (GpPath *path, BOOL start, float x, float y, float width, float height, float startAngle, float endAngle) { float delta, bcp; double sin_alpha, sin_beta, cos_alpha, cos_beta; float rx = width / 2; float ry = height / 2; /* center */ float cx = x + rx; float cy = y + ry; /* angles in radians */ float alpha = startAngle * PI / 180; float beta = endAngle * PI / 180; /* adjust angles for ellipses */ alpha = atan2 (rx * sin (alpha), ry * cos (alpha)); beta = atan2 (rx * sin (beta), ry * cos (beta)); if (fabs (beta - alpha) > M_PI){ if (beta > alpha) beta -= 2 * PI; else alpha -= 2 * PI; } delta = beta - alpha; // http://www.stillhq.com/ctpfaq/2001/comp.text.pdf-faq-2001-04.txt (section 2.13) bcp = 4.0 / 3 * (1 - cos (delta / 2)) / sin (delta / 2); sin_alpha = sin (alpha); sin_beta = sin (beta); cos_alpha = cos (alpha); cos_beta = cos (beta); /* move to the starting point if we're not continuing a curve */ if (start) { /* starting point */ double sx = cx + rx * cos_alpha; double sy = cy + ry * sin_alpha; append (path, sx, sy, PathPointTypeLine, FALSE); } append_bezier (path, cx + rx * (cos_alpha - bcp * sin_alpha), cy + ry * (sin_alpha + bcp * cos_alpha), cx + rx * (cos_beta + bcp * sin_beta), cy + ry * (sin_beta - bcp * cos_beta), cx + rx * cos_beta, cy + ry * sin_beta); } static int count_arcs_points (GpPath *path, float x, float y, float width, float height, float startAngle, float sweepAngle) { int i; float drawn = 0; int increment; float endAngle; int count = 1; if (fabs (sweepAngle) >= 360) return 13; endAngle = startAngle + sweepAngle; increment = (endAngle < startAngle) ? -90 : 90; /* i is the number of sub-arcs drawn, each sub-arc can be at most 90 degrees.*/ /* there can be no more then 4 subarcs, ie. 90 + 90 + 90 + (something less than 90) */ for (i = 0; i < 4; i++) { float current = startAngle + drawn; float additional; additional = endAngle - current; /* otherwise, add the remainder */ if (fabs (additional) > 90) { additional = increment; } else { /* a near zero value will introduce bad artefact in the drawing (#78999) */ if (gdip_near_zero (additional)) return count; count += 3; return count; } count += 3; drawn += additional; } return count; } static VOID append_arcs (GpPath *path, float x, float y, float width, float height, float startAngle, float sweepAngle) { int i; float drawn = 0; int increment; float endAngle; BOOL enough = FALSE; if (fabs (sweepAngle) >= 360) { GdipAddPathEllipse (path, x, y, width, height); return; } endAngle = startAngle + sweepAngle; increment = (endAngle < startAngle) ? -90 : 90; /* i is the number of sub-arcs drawn, each sub-arc can be at most 90 degrees.*/ /* there can be no more then 4 subarcs, ie. 90 + 90 + 90 + (something less than 90) */ for (i = 0; i < 4; i++) { float current = startAngle + drawn; float additional; if (enough) return; additional = endAngle - current; /* otherwise, add the remainder */ if (fabs (additional) > 90) { additional = increment; } else { /* a near zero value will introduce bad artefact in the drawing (#78999) */ if (gdip_near_zero (additional)) return; enough = TRUE; } append_arc (path, (i == 0), /* only move to the starting pt in the 1st iteration */ x, y, width, height, /* bounding rectangle */ current, current + additional); drawn += additional; } } GpStatus WINGDIPAPI GdipAddPathArc (GpPath *path, float x, float y, float width, float height, float startAngle, float sweepAngle) { int point_count; if (!path) return InvalidParameter; if (width == 0 || height == 0) return InvalidParameter; point_count = count_arcs_points (path, x, y, width, height, startAngle, sweepAngle); if (!gdip_path_ensure_size (path, path->count + point_count)) return OutOfMemory; /* draw the arcs */ append_arcs (path, x, y, width, height, startAngle, sweepAngle); return Ok; } GpStatus WINGDIPAPI GdipAddPathBezier (GpPath *path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) { if (!path) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + 4)) return OutOfMemory; append (path, x1, y1, PathPointTypeLine, TRUE); append_bezier (path, x2, y2, x3, y3, x4, y4); return Ok; } GpStatus WINGDIPAPI GdipAddPathBeziers (GpPath *path, const GpPointF *points, int count) { int i; GpPointF *tmp = (GpPointF *) points; if (!path || !points) return InvalidParameter; /* first bezier requires 4 points, other 3 more points */ if ((count < 4) || ((count % 3) != 1)) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + count)) return OutOfMemory; append_point (path, *tmp, PathPointTypeLine, TRUE); tmp++; for (i = 1; i < count; i++, tmp++) append_point (path, *tmp, PathPointTypeBezier3, FALSE); return Ok; } GpStatus WINGDIPAPI GdipAddPathCurve (GpPath *path, const GpPointF *points, int count) { return GdipAddPathCurve2 (path, points, count, 0.5); } GpStatus WINGDIPAPI GdipAddPathCurve2 (GpPath *path, const GpPointF *points, int count, float tension) { GpPointF *tangents; /* special case, here we support a curve with 2 points */ if (!path || !points || (count < 2)) return InvalidParameter; tangents = gdip_open_curve_tangents (CURVE_MIN_TERMS, points, count, tension); if (!tangents) return OutOfMemory; if (!gdip_path_ensure_size (path, path->count + (3 * (count - 1)) + 1)) return OutOfMemory; append_curve (path, points, tangents, 0, count - 1, CURVE_OPEN); GdipFree (tangents); return Ok; } GpStatus WINGDIPAPI GdipAddPathCurve3 (GpPath *path, const GpPointF *points, int count, int offset, int numberOfSegments, float tension) { GpPointF *tangents; if (!path || !points || (numberOfSegments < 1)) return InvalidParameter; /* we need 3 points for the first curve, 2 more for each curves */ /* and it's possible to use a point prior to the offset (to calculate) */ if ((offset == 0) && (numberOfSegments == 1) && (count < 3)) return InvalidParameter; else if (numberOfSegments >= count - offset) return InvalidParameter; tangents = gdip_open_curve_tangents (CURVE_MIN_TERMS, points, count, tension); if (!tangents) return OutOfMemory; if (!gdip_path_ensure_size (path, path->count + (3 * numberOfSegments) + 1)) return OutOfMemory; append_curve (path, points, tangents, offset, numberOfSegments, CURVE_OPEN); GdipFree (tangents); return Ok; } GpStatus WINGDIPAPI GdipAddPathClosedCurve (GpPath *path, const GpPointF *points, int count) { return GdipAddPathClosedCurve2 (path, points, count, 0.5); } GpStatus WINGDIPAPI GdipAddPathClosedCurve2 (GpPath *path, const GpPointF *points, int count, float tension) { GpPointF *tangents; if (!path || !points || (count < 3)) return InvalidParameter; tangents = gdip_closed_curve_tangents (CURVE_MIN_TERMS, points, count, tension); if (!tangents) return OutOfMemory; if (!gdip_path_ensure_size (path, path->count + (3 * count) + 1)) return OutOfMemory; append_curve (path, points, tangents, 0, count - 1, CURVE_CLOSE); /* close the path */ GdipClosePathFigure (path); GdipFree (tangents); return Ok; } GpStatus WINGDIPAPI GdipAddPathRectangle (GpPath *path, float x, float y, float width, float height) { if (!path) return InvalidParameter; if ((width <= 0.0) || (height <= 0.0)) return Ok; if (!gdip_path_ensure_size (path, path->count + 4)) return OutOfMemory; append (path, x, y, PathPointTypeStart, FALSE); append (path, x + width, y, PathPointTypeLine, FALSE); append (path, x + width, y + height, PathPointTypeLine, FALSE); append (path, x, y + height, PathPointTypeLine | PathPointTypeCloseSubpath, FALSE); return Ok; } GpStatus WINGDIPAPI GdipAddPathRectangles (GpPath *path, const GpRectF *rects, int count) { int i; if (!path || !rects) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + (4 * count))) return OutOfMemory; for (i = 0; i < count; i++) { float x = rects[i].X; float y = rects[i].Y; float width = rects[i].Width; float height = rects[i].Height; GdipAddPathRectangle (path, x, y, width, height); } return Ok; } GpStatus WINGDIPAPI GdipAddPathEllipse (GpPath *path, float x, float y, float width, float height) { double rx = width / 2; double ry = height / 2; double cx = x + rx; double cy = y + ry; if (!path) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + 13)) return OutOfMemory; /* origin */ append (path, cx + rx, cy, PathPointTypeStart, FALSE); /* quadrant I */ append_bezier (path, cx + rx, cy - C1 * ry, cx + C1 * rx, cy - ry, cx, cy - ry); /* quadrant II */ append_bezier (path, cx - C1 * rx, cy - ry, cx - rx, cy - C1 * ry, cx - rx, cy); /* quadrant III */ append_bezier (path, cx - rx, cy + C1 * ry, cx - C1 * rx, cy + ry, cx, cy + ry); /* quadrant IV */ append_bezier (path, cx + C1 * rx, cy + ry, cx + rx, cy + C1 * ry, cx + rx, cy); /* close the path */ GdipClosePathFigure (path); return Ok; } GpStatus WINGDIPAPI GdipAddPathPie (GpPath *path, float x, float y, float width, float height, float startAngle, float sweepAngle) { int point_count; float sin_alpha, cos_alpha; if (width == 0 || height == 0) return InvalidParameter; float rx = width / 2; float ry = height / 2; /* center */ int cx = x + rx; int cy = y + ry; /* angles in radians */ float alpha = startAngle * PI / 180; /* adjust angle for ellipses */ alpha = atan2 (rx * sin (alpha), ry * cos (alpha)); sin_alpha = sin (alpha); cos_alpha = cos (alpha); if (!path) return InvalidParameter; point_count = count_arcs_points (path, x, y, width, height, startAngle, sweepAngle) + 1; if (fabs (sweepAngle) < 360) point_count += 2; if (!gdip_path_ensure_size (path, path->count + point_count)) return OutOfMemory; /* move to center */ append (path, cx, cy, PathPointTypeStart, FALSE); /* draw pie edge */ if (fabs (sweepAngle) < 360) append (path, cx + rx * cos_alpha, cy + ry * sin_alpha, PathPointTypeLine, FALSE); /* draw the arcs */ append_arcs (path, x, y, width, height, startAngle, sweepAngle); /* draw pie edge */ if (fabs (sweepAngle) < 360) append (path, cx, cy, PathPointTypeLine, FALSE); /* close the path */ return GdipClosePathFigure (path); } GpStatus WINGDIPAPI GdipAddPathPolygon (GpPath *path, const GpPointF *points, int count) { int i; GpPointF *tmp = (GpPointF *) points; if (!path || !points || (count < 3)) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + count + 1)) return OutOfMemory; /* note: polygon points are never compressed (i.e. removed if identical) */ append_point (path, *tmp, PathPointTypeStart, FALSE); tmp ++; for (i = 1; i < count; i++, tmp++) append_point (path, *tmp, PathPointTypeLine, FALSE); /* * Add a line from the last point back to the first point if * they're not the same */ if (points [0].X != points [count - 1].X && points [0].Y != points [count - 1].Y) append_point (path, points [0], PathPointTypeLine, FALSE); /* close the path */ return GdipClosePathFigure (path); } GpStatus WINGDIPAPI GdipAddPathPath (GpPath *path, GDIPCONST GpPath *addingPath, BOOL connect) { if (!path || !addingPath) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + addingPath->count)) return OutOfMemory; memcpy (path->types + path->count, addingPath->types, sizeof (BYTE) * addingPath->count); memcpy (path->points + path->count, addingPath->points, sizeof (GpPointF) * addingPath->count); /* We can connect only open figures. If first figure is closed * it can't be connected. */ path->types[path->count] = connect ? gdip_get_first_point_type (path) : PathPointTypeStart; path->start_new_fig = FALSE; path->count += addingPath->count; return Ok; } /* MonoTODO - deal with layoutRect, format... */ GpStatus WINGDIPAPI GdipAddPathString (GpPath *path, GDIPCONST WCHAR *string, int length, GDIPCONST GpFontFamily *family, int style, float emSize, GDIPCONST GpRectF *layoutRect, GDIPCONST GpStringFormat *format) { cairo_surface_t *cs; cairo_t *cr; cairo_path_t *cp; GpFont *font = NULL; GpStatus status; BYTE *utf8 = NULL; if (!path || !string || length < -1 || !family || !layoutRect) return InvalidParameter; if (length == 0) { return Ok; } else if (length == -1) { const WCHAR * ptr = string; length = 0; while (*ptr != 0) { length++; ptr++; } } if (emSize == 0) return GenericError; cs = cairo_recording_surface_create (CAIRO_CONTENT_COLOR_ALPHA, NULL); if (cairo_surface_status (cs) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (cs); return OutOfMemory; } cr = cairo_create (cs); if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { cairo_destroy (cr); cairo_surface_destroy (cs); return OutOfMemory; } status = gdip_create_font_without_validation (family, fabsf (emSize), style, UnitPixel, &font); if (status != Ok) { GdipFree (utf8); cairo_destroy (cr); cairo_surface_destroy (cs); return status; } #ifdef USE_PANGO_RENDERING { GpRectF box; GpPointF box_offset; PangoLayout* layout; GpStringFormat *string_format; if (format == NULL) { status = GdipCreateStringFormat (StringFormatFlagsNoClip, 0, &string_format); } else if (!(format->formatFlags & StringFormatFlagsNoClip)) { status = GdipCloneStringFormat (format, &string_format); if (status == Ok) string_format->formatFlags |= StringFormatFlagsNoClip; } else { status = Ok; string_format = (GpStringFormat *) format; } if (status != Ok) { GdipDeleteFont (font); GdipFree (utf8); cairo_destroy (cr); cairo_surface_destroy (cs); return status; } layout = gdip_pango_setup_layout (cr, string, length, font, layoutRect, &box, &box_offset, string_format, NULL); cairo_move_to (cr, layoutRect->X + box_offset.X, layoutRect->Y + box_offset.Y); pango_cairo_layout_path (cr, layout); g_object_unref (layout); if (string_format != format) GdipDeleteStringFormat (string_format); // If our Cairo context had a current point before laying out the path, Pango will have moved us back there. // We don't want that when we process the path below, so clear it if set. if (cairo_has_current_point(cr)) cairo_new_sub_path(cr); } #else { BYTE *utf8 = (BYTE*) utf16_to_utf8 (string, length); if (!utf8) { GdipDeleteFont (font); cairo_destroy (cr); cairo_surface_destroy (cs); return OutOfMemory; } cairo_move_to (cr, layoutRect->X, layoutRect->Y + font->sizeInPixels); cairo_set_font_face (cr, gdip_get_cairo_font_face (font)); cairo_set_font_size (cr, font->sizeInPixels); /* TODO - deal with layoutRect, format... ideally we would be calling a subset of GdipDrawString that already does everything *and* preserve the whole path */ cairo_text_path (cr, (const char *) utf8); GdipFree (utf8); } #endif /* get the font data from the cairo path and translate it as a gdi+ path */ status = Ok; cp = cairo_copy_path (cr); if (cp) { int i; int count = 0; for (i=0; i < cp->num_data; i += cp->data[i].header.length) { cairo_path_data_t *data = &cp->data[i]; switch (data->header.type) { case CAIRO_PATH_MOVE_TO: count++; break; case CAIRO_PATH_LINE_TO: count++; break; case CAIRO_PATH_CURVE_TO: count += 3; break; case CAIRO_PATH_CLOSE_PATH: break; } } if (gdip_path_ensure_size (path, path->count + count)) { for (i=0; i < cp->num_data; i += cp->data[i].header.length) { PathPointType type = PathPointTypeStart; int dataLength = cp->data[i].header.length; cairo_path_data_t *data = &cp->data[i]; if ((i < cp->num_data - dataLength) && (cp->data[i + dataLength].header.type == CAIRO_PATH_CLOSE_PATH)) type |= PathPointTypeCloseSubpath; switch (data->header.type) { case CAIRO_PATH_MOVE_TO: append (path, data[1].point.x, data[1].point.y, type, FALSE); break; case CAIRO_PATH_LINE_TO: append (path, data[1].point.x, data[1].point.y, type | PathPointTypeLine, FALSE); break; case CAIRO_PATH_CURVE_TO: append (path, data[1].point.x, data[1].point.y, PathPointTypeBezier, FALSE); append (path, data[2].point.x, data[2].point.y, PathPointTypeBezier, FALSE); append (path, data[3].point.x, data[3].point.y, type | PathPointTypeBezier, FALSE); break; case CAIRO_PATH_CLOSE_PATH: break; } } } else { status = OutOfMemory; } cairo_path_destroy (cp); } if (font) { GdipDeleteFont (font); } GdipFree (utf8); cairo_destroy (cr); cairo_surface_destroy (cs); return status; } GpStatus WINGDIPAPI GdipAddPathStringI (GpPath *path, GDIPCONST WCHAR *string, int length, GDIPCONST GpFontFamily *family, int style, float emSize, GDIPCONST GpRect *layoutRect, GDIPCONST GpStringFormat *format) { GpRectF rect; if (!layoutRect) return InvalidParameter; gdip_RectF_from_Rect (layoutRect, &rect); return GdipAddPathString (path, string, length, family, style, emSize, &rect, format); } GpStatus WINGDIPAPI GdipAddPathLineI (GpPath *path, int x1, int y1, int x2, int y2) { return GdipAddPathLine (path, x1, y1, x2, y2); } GpStatus WINGDIPAPI GdipAddPathLine2I (GpPath* path, const GpPoint *points, int count) { GpPoint *tmp; int i; if (!path || !points || (count < 0)) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + count)) return OutOfMemory; /* only the first point can be compressed (i.e. removed if identical to previous) */ for (i = 0, tmp = (GpPoint*) points; i < count; i++, tmp++) append (path, tmp->X, tmp->Y, PathPointTypeLine, (i == 0)); return Ok; } GpStatus WINGDIPAPI GdipAddPathArcI (GpPath *path, int x, int y, int width, int height, float startAngle, float sweepAngle) { return GdipAddPathArc (path, x, y, width, height, startAngle, sweepAngle); } GpStatus WINGDIPAPI GdipAddPathBezierI (GpPath *path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { return GdipAddPathBezier (path, x1, y1, x2, y2, x3, y3, x4, y4); } GpStatus WINGDIPAPI GdipAddPathBeziersI (GpPath *path, const GpPoint *points, int count) { GpPoint *tmp; int i; if (!path || !points) return InvalidParameter; /* first bezier requires 4 points, other 3 more points */ if ((count < 4) || ((count % 3) != 1)) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + count)) return OutOfMemory; tmp = (GpPoint*) points; append (path, tmp->X, tmp->Y, PathPointTypeLine, TRUE); tmp++; for (i = 1; i < count; i++, tmp++) append (path, tmp->X, tmp->Y, PathPointTypeBezier3, FALSE); return Ok; } GpStatus WINGDIPAPI GdipAddPathCurveI (GpPath *path, const GpPoint *points, int count) { return GdipAddPathCurve2I (path, points, count, 0.5); } GpStatus WINGDIPAPI GdipAddPathCurve2I (GpPath *path, const GpPoint *points, int count, float tension) { GpPointF *pt; GpStatus s; if (!points) return InvalidParameter; pt = convert_points (points, count); if (!pt) return OutOfMemory; /* here we must deal/accept curve with 2 points, GdipAddPathCurve3I doesn't */ s = GdipAddPathCurve2 (path, pt, count, tension); GdipFree (pt); return s; } GpStatus WINGDIPAPI GdipAddPathCurve3I (GpPath *path, const GpPoint *points, int count, int offset, int numberOfSegments, float tension) { GpPointF *pt; GpStatus s; if (!points) return InvalidParameter; pt = convert_points (points, count); if (!pt) return OutOfMemory; s = GdipAddPathCurve3 (path, pt, count, offset, numberOfSegments, tension); GdipFree (pt); return s; } GpStatus WINGDIPAPI GdipAddPathClosedCurveI (GpPath *path, const GpPoint *points, int count) { return GdipAddPathClosedCurve2I (path, points, count, 0.5); } GpStatus WINGDIPAPI GdipAddPathClosedCurve2I (GpPath *path, const GpPoint *points, int count, float tension) { GpPointF *pt; GpStatus s; if (!path || !points) return InvalidParameter; pt = convert_points (points, count); if (!pt) return OutOfMemory; s = GdipAddPathClosedCurve2 (path, pt, count, tension); GdipFree (pt); return s; } GpStatus WINGDIPAPI GdipAddPathRectangleI (GpPath *path, int x, int y, int width, int height) { return GdipAddPathRectangle (path, x, y, width, height); } GpStatus WINGDIPAPI GdipAddPathRectanglesI (GpPath *path, const GpRect *rects, int count) { int i; if (!path || !rects) return InvalidParameter; for (i = 0; i < count; i++) { float x = (float) rects[i].X; float y = (float) rects[i].Y; float width = (float) rects[i].Width; float height = (float) rects[i].Height; GdipAddPathRectangle (path, x, y, width, height); } return Ok; } GpStatus WINGDIPAPI GdipAddPathEllipseI (GpPath *path, int x, int y, int width, int height) { return GdipAddPathEllipse (path, x, y, width, height); } GpStatus WINGDIPAPI GdipAddPathPieI (GpPath *path, int x, int y, int width, int height, float startAngle, float sweepAngle) { return GdipAddPathPie (path, x, y, width, height, startAngle, sweepAngle); } GpStatus WINGDIPAPI GdipAddPathPolygonI (GpPath *path, const GpPoint *points, int count) { int i; GpPoint *tmp; if (!path || !points || (count < 3)) return InvalidParameter; if (!gdip_path_ensure_size (path, path->count + count + 1)) return OutOfMemory; /* note: polygon points are never compressed (i.e. removed if identical) */ tmp = (GpPoint *) points; append (path, tmp->X, tmp->Y, PathPointTypeStart, FALSE); tmp++; for (i = 1; i < count; i++, tmp++) append (path, tmp->X, tmp->Y, PathPointTypeLine, FALSE); /* * Add a line from the last point back to the first point if * they're not the same */ if (points [0].X != points [count - 1].X && points [0].Y != points [count - 1].Y) append (path, points [0].X, points [0].Y, PathPointTypeLine, FALSE); /* close the path */ return GdipClosePathFigure (path); } /* nr_curve_flatten comes from Sodipodi's libnr (public domain) available from http://www.sodipodi.com/ */ /* Mono changes: converted to float (from double), added recursion limit, use GArray */ static BOOL nr_curve_flatten (float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float flatness, int level, GpPath *flat_path) { float dx1_0, dy1_0, dx2_0, dy2_0, dx3_0, dy3_0, dx2_3, dy2_3, d3_0_2; float s1_q, t1_q, s2_q, t2_q, v2_q; float f2, f2_q; float x00t, y00t, x0tt, y0tt, xttt, yttt, x1tt, y1tt, x11t, y11t; dx1_0 = x1 - x0; dy1_0 = y1 - y0; dx2_0 = x2 - x0; dy2_0 = y2 - y0; dx3_0 = x3 - x0; dy3_0 = y3 - y0; dx2_3 = x3 - x2; dy2_3 = y3 - y2; f2 = flatness; d3_0_2 = dx3_0 * dx3_0 + dy3_0 * dy3_0; if (d3_0_2 < f2) { float d1_0_2, d2_0_2; d1_0_2 = dx1_0 * dx1_0 + dy1_0 * dy1_0; d2_0_2 = dx2_0 * dx2_0 + dy2_0 * dy2_0; if ((d1_0_2 < f2) && (d2_0_2 < f2)) { goto nosubdivide; } else { goto subdivide; } } f2_q = f2 * d3_0_2; s1_q = dx1_0 * dx3_0 + dy1_0 * dy3_0; t1_q = dy1_0 * dx3_0 - dx1_0 * dy3_0; s2_q = dx2_0 * dx3_0 + dy2_0 * dy3_0; t2_q = dy2_0 * dx3_0 - dx2_0 * dy3_0; v2_q = dx2_3 * dx3_0 + dy2_3 * dy3_0; if ((t1_q * t1_q) > f2_q) goto subdivide; if ((t2_q * t2_q) > f2_q) goto subdivide; if ((s1_q < 0.0) && ((s1_q * s1_q) > f2_q)) goto subdivide; if ((v2_q < 0.0) && ((v2_q * v2_q) > f2_q)) goto subdivide; if (s1_q >= s2_q) goto subdivide; nosubdivide: { append (flat_path, x3, y3, PathPointTypeLine, FALSE); return TRUE; } subdivide: /* things gets *VERY* memory intensive without a limit */ if (level >= FLATTEN_RECURSION_LIMIT) return FALSE; x00t = (x0 + x1) * 0.5; y00t = (y0 + y1) * 0.5; x0tt = (x0 + 2 * x1 + x2) * 0.25; y0tt = (y0 + 2 * y1 + y2) * 0.25; x1tt = (x1 + 2 * x2 + x3) * 0.25; y1tt = (y1 + 2 * y2 + y3) * 0.25; x11t = (x2 + x3) * 0.5; y11t = (y2 + y3) * 0.5; xttt = (x0tt + x1tt) * 0.5; yttt = (y0tt + y1tt) * 0.5; if (!nr_curve_flatten (x0, y0, x00t, y00t, x0tt, y0tt, xttt, yttt, flatness, level+1, flat_path)) return FALSE; if (!nr_curve_flatten (xttt, yttt, x1tt, y1tt, x11t, y11t, x3, y3, flatness, level+1, flat_path)) return FALSE; return TRUE; } static BOOL gdip_convert_bezier_to_lines (GpPath *path, int index, float flatness, GpPath *flat_path) { GpPointF start, first, second, end; int saved_count; if ((index <= 0) || (index + 2 >= path->count)) return FALSE; /* bad path data */ start = path->points[index - 1]; first = path->points[index]; second = path->points[index + 1]; end = path->points[index + 2]; if (!gdip_path_ensure_size (path, path->count + (1 << FLATTEN_RECURSION_LIMIT))) return FALSE; saved_count = flat_path->count; if (!nr_curve_flatten (start.X, start.Y, first.X, first.Y, second.X, second.Y, end.X, end.Y, flatness, 0, flat_path)) { /* curved path is too complex (i.e. would result in too many points) to render as a polygon */ flat_path->count = saved_count; return FALSE; } return TRUE; } GpStatus WINGDIPAPI GdipFlattenPath (GpPath *path, GpMatrix *matrix, float flatness) { GpStatus status = Ok; GpPath *flat_path; int i; if (!path) return InvalidParameter; /* apply matrix before flattening (as there's less points at this stage) */ if (matrix) { status = GdipTransformPath (path, matrix); if (status != Ok) return status; } /* if no bezier are present then the path doesn't need to be flattened */ if (!gdip_path_has_curve (path)) return status; status = GdipCreatePath (path->fill_mode, &flat_path); if (status != Ok) return status; /* Iterate the current path and replace each bezier with multiple lines */ for (i = 0; i < path->count; i++) { GpPointF point = path->points[i]; BYTE type = path->types[i]; /* PathPointTypeBezier3 has the same value as PathPointTypeBezier */ if ((type & PathPointTypeBezier) == PathPointTypeBezier) { if (!gdip_convert_bezier_to_lines (path, i, fabs (flatness), flat_path)) { /* uho, too much recursion - do not pass go, do not collect 200$ */ /* free the the partial flat */ GdipResetPath (flat_path); if (!gdip_path_ensure_size (flat_path, flat_path->count + 4)) { GdipDeletePath (flat_path); return OutOfMemory; } /* mimic MS behaviour when recursion becomes a problem */ /* note: it's not really an empty rectangle as the last point isn't closing */ append (flat_path, 0, 0, PathPointTypeStart, FALSE); append (flat_path, 0, 0, PathPointTypeLine, FALSE); append (flat_path, 0, 0, PathPointTypeLine, FALSE); append (flat_path, 0, 0, PathPointTypeLine, FALSE); break; } /* beziers have 4 points: the previous one, the current and the next two */ i += 2; } else { if (!gdip_path_ensure_size (flat_path, flat_path->count + 1)) { GdipDeletePath (flat_path); return OutOfMemory; } /* no change required, just copy the point */ append_point(flat_path, point, type, FALSE); } } /* free original path points and types */ if (path->points != NULL) GdipFree (path->points); if (path->types != NULL) GdipFree (path->types); /* transfer new path informations */ path->points = flat_path->points; path->types = flat_path->types; path->count = flat_path->count; path->size = flat_path->size; GdipFree (flat_path); /* note: no error code is given for excessive recursion */ return Ok; } static GpStatus gdip_prepare_path (GpPath *path, GpMatrix *matrix, float flatness) { /* convert any curve into lines */ if (gdip_path_has_curve (path)) { /* this will apply the matrix too (before flattening) */ return GdipFlattenPath (path, matrix, flatness); } else if (!gdip_is_matrix_empty (matrix)) { /* no curve, but we still have a matrix to apply... */ return GdipTransformPath (path, matrix); } /* no preparation required */ return Ok; } /* MonoTODO - doesn't seems to be exposed in System.Drawing.dll */ GpStatus WINGDIPAPI GdipWindingModeOutline (GpPath *path, GpMatrix *matrix, float flatness) { GpStatus status; if (!path) return InvalidParameter; /* quick out */ if (path->count == 0) return Ok; status = gdip_prepare_path (path, matrix, flatness); if (status != Ok) return status; /* TODO */ return NotImplemented; } /* MonoTODO */ GpStatus WINGDIPAPI GdipWidenPath (GpPath *nativePath, GpPen *pen, GpMatrix *matrix, float flatness) { static int called = 0; GpStatus status; if (!nativePath || !pen) return InvalidParameter; /* (0) is deal within System.Drawing */ /* (1) for compatibility with MS GDI+ (reported as FDBK49685) */ if (nativePath->count <= 1) return OutOfMemory; status = gdip_prepare_path (nativePath, matrix, flatness); if (status != Ok) return status; /* TODO inner path (same number of points as the prepared path) */ /* TODO outer path (twice the number of points as the prepared path) */ if (!called) { g_warning ("NOT IMPLEMENTED: GdipWidenPath"); called = 1; } return Ok; } /* MonoTODO */ GpStatus WINGDIPAPI GdipWarpPath (GpPath *path, GpMatrix *matrix, const GpPointF *points, int count, float srcx, float srcy, float srcwidth, float srcheight, WarpMode warpMode, float flatness) { static int called = 0; GpStatus status; if (!path || !points || (count < 1)) return InvalidParameter; /* quick out */ if (path->count == 0) return Ok; /* an invalid warp mode resets the current path */ /* a path with a single point will reset it too */ if (((warpMode != WarpModePerspective) && (warpMode != WarpModeBilinear)) || (path->count == 1)) return GdipResetPath (path); status = gdip_prepare_path (path, matrix, flatness); if (status != Ok) return status; /* TODO */ if (!called) { g_warning ("NOT IMPLEMENTED: GdipWarpPath"); called = 1; } return Ok; } GpStatus WINGDIPAPI GdipTransformPath (GpPath* path, GpMatrix *matrix) { if (!path) return InvalidParameter; if (path->count == 0) return Ok; /* GdipTransformMatrixPoints would fail */ /* avoid allocation/free/calculation for null/identity matrix */ if (gdip_is_matrix_empty (matrix)) return Ok; return GdipTransformMatrixPoints (matrix, path->points, path->count); } GpStatus WINGDIPAPI GdipGetPathWorldBounds (GpPath *path, GpRectF *bounds, const GpMatrix *matrix, const GpPen *pen) { GpStatus status; GpPath *workpath; GpPointF points; if (!path || !bounds) return InvalidParameter; // Paths with zero or one points are empty. if (path->count <= 1) { bounds->X = 0.0f; bounds->Y = 0.0f; bounds->Width = 0.0f; bounds->Height = 0.0f; return Ok; } status = GdipClonePath (path, &workpath); if (status != Ok) return status; /* We don't need a very precise flat value to get the bounds (GDI+ isn't, big time) - * however flattening helps by removing curves, making the rest of the algorithm a * lot simpler. */ /* note: only the matrix is applied if no curves are present in the path */ status = GdipFlattenPath (workpath, (GpMatrix*)matrix, 25.0f); if (status != Ok) { GdipDeletePath (workpath); return status; } points = workpath->points[0]; bounds->X = points.X; /* keep minimum X here */ bounds->Y = points.Y; /* keep minimum Y here */ if (workpath->count == 1) { /* special case #2 - Only one element */ bounds->Width = 0.0f; bounds->Height = 0.0f; GdipDeletePath (workpath); return Ok; } bounds->Width = points.X; /* keep maximum X here */ bounds->Height = points.Y; /* keep maximum Y here */ for (int i = 1; i < workpath->count; i++) { points = workpath->points[i]; if (points.X < bounds->X) bounds->X = points.X; if (points.Y < bounds->Y) bounds->Y = points.Y; if (points.X > bounds->Width) bounds->Width = points.X; if (points.Y > bounds->Height) bounds->Height = points.Y; } /* convert maximum values (width/height) as length */ bounds->Width -= bounds->X; bounds->Height -= bounds->Y; if (pen) { /* in calculation the pen's width is at least 1.0 */ float width = (pen->width < 1.0f) ? 1.0f : pen->width; float halfw = (width / 2); bounds->X -= halfw; bounds->Y -= halfw; bounds->Width += width; bounds->Height += width; } GdipDeletePath (workpath); return Ok; } GpStatus WINGDIPAPI GdipGetPathWorldBoundsI (GpPath *path, GpRect *bounds, const GpMatrix *matrix, const GpPen *pen) { GpRectF rect; GpStatus status; if (!path || !bounds) return InvalidParameter; status = GdipGetPathWorldBounds (path, &rect, matrix, pen); if (status != Ok) return status; bounds->X = (int) rect.X; bounds->Y = (int) rect.Y; bounds->Width = (int) rect.Width; bounds->Height = (int) rect.Height; return Ok; } GpStatus WINGDIPAPI GdipIsVisiblePathPoint (GpPath *path, float x, float y, GpGraphics *graphics, BOOL *result) { GpStatus status = Ok; cairo_surface_t* s = NULL; GpGraphics *g; GpUnit page_unit = UnitPixel; if (!path || !result) return InvalidParameter; if (graphics) { g = graphics; cairo_save (g->ct); page_unit = g->page_unit; } else { /* create a temporary context */ s = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1); g = gdip_graphics_new (s); } cairo_new_path (g->ct); /* unit tests shows that PageUnit isn't consireded (well x, y are probably considered to be the same unit format ) */ g->page_unit = UnitPixel; status = gdip_plot_path (g, path, FALSE); if (status == Ok) { cairo_set_fill_rule (g->ct, gdip_convert_fill_mode (path->fill_mode)); cairo_set_antialias (g->ct, CAIRO_ANTIALIAS_NONE); *result = cairo_in_fill (g->ct, x + 1.0 /* CAIRO_AA_OFFSET_X */, y + CAIRO_AA_OFFSET_Y); } else { *result = FALSE; } if (graphics) { /* restore GpGraphics to original state */ cairo_restore (graphics->ct); g->page_unit = page_unit; } else { /* delete temporary context */ cairo_surface_destroy (s); GdipDeleteGraphics (g); } return status; } GpStatus WINGDIPAPI GdipIsVisiblePathPointI (GpPath *path, int x, int y, GpGraphics *graphics, BOOL *result) { return GdipIsVisiblePathPoint (path, x, y, graphics, result); } GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint (GpPath *path, float x, float y, GpPen *pen, GpGraphics *graphics, BOOL *result) { GpStatus status = Ok; cairo_surface_t* s = NULL; GpGraphics *g; GpUnit page_unit = UnitPixel; if (!path || !pen || !result) return InvalidParameter; if (graphics) { g = graphics; cairo_save (graphics->ct); page_unit = g->page_unit; } else { /* create a temporary context */ s = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1); g = gdip_graphics_new (s); } cairo_new_path (g->ct); /* unit tests shows that PageUnit isn't consireded (well x, y are probably considered to be the same unit format ) */ g->page_unit = UnitPixel; status = gdip_plot_path (g, path, FALSE); if (status == Ok) { /* we must fight around cairo AA */ cairo_set_antialias (g->ct, CAIRO_ANTIALIAS_NONE); cairo_set_line_width (g->ct, pen->width - CAIRO_AA_OFFSET_Y); *result = cairo_in_stroke (g->ct, x, y); } else { *result = FALSE; } if (graphics) { /* restore GpGraphics to original state */ cairo_restore (graphics->ct); g->page_unit = page_unit; } else { /* delete temporary context */ cairo_surface_destroy (s); GdipDeleteGraphics (g); } return status; } GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI (GpPath *path, int x, int y, GpPen *pen, GpGraphics *graphics, BOOL *result) { return GdipIsOutlineVisiblePathPoint (path, x, y, pen, graphics, result); } libgdiplus-6.0.4+dfsg/src/bmpcodec.h0000644000175000017500000000445013542674535020053 0ustar directhexdirecthex/* * bmpcodec.h : Contains function declarations for encoding decoding bmp images * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Mark Steele (ms@rapidsys.com) * * Copyright (C) 2003-2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef _BMPCODEC_H #define _BMPCODEC_H #include "bitmap-private.h" //#include "codecs-private.h" #include "dstream.h" #define BITMAPINFOHEADER_SIZE 40 #define BITMAPCOREHEADER_SIZE 12 #ifndef __GNUC__ #pragma pack(2) #endif typedef struct #ifdef __GNUC__ __attribute__ ((packed)) #endif { WORD bfType; DWORD bfSize; WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; } BITMAPFILEHEADER, *PBITMAPFILEHEADER, *LPBITMAPFILEHEADER; #ifndef __GNUC__ #pragma pack() #endif #define BFT_BITMAP 0x4d42 typedef struct { DWORD bV3Size; LONG bV3Width; LONG bV3Height; WORD bV3Planes; WORD bV3BitCount; DWORD bV3Compression; DWORD bV3SizeImage; LONG bV3XPelsPerMeter; LONG bV3YPelsPerMeter; DWORD bV3ClrUsed; DWORD bV3ClrImportant; DWORD bV3RedMask; DWORD bV3GreenMask; DWORD bV3BlueMask; DWORD bV3AlphaMask; } BITMAPV3HEADER, *PBITMAPV3HEADER; #include "gdiplus-private.h" GpStatus gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source) GDIP_INTERNAL; GpStatus gdip_load_bmp_image_from_file (FILE *fp, GpImage **image) GDIP_INTERNAL; GpStatus gdip_load_bmp_image_from_stream_delegate (dstream_t *loader, GpImage **image) GDIP_INTERNAL; GpStatus gdip_save_bmp_image_to_file (FILE *fp, GpImage *image) GDIP_INTERNAL; GpStatus gdip_save_bmp_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image) GDIP_INTERNAL; ImageCodecInfo *gdip_getcodecinfo_bmp () GDIP_INTERNAL; /* Conversion functions */ ARGB gdip_getpixel_32bppARGB (BYTE *scan, INT x) GDIP_INTERNAL; void gdip_setpixel_32bppARGB (BYTE *scan, INT x, BYTE a, BYTE r, BYTE g, BYTE b) GDIP_INTERNAL; ARGB gdip_getpixel_16bppRGB555 (BYTE *scan, INT x) GDIP_INTERNAL; ARGB gdip_getpixel_16bppRGB565 (BYTE *scan, INT x) GDIP_INTERNAL; /* helper functions / shared with ICOn codec */ GpStatus gdip_read_BITMAPINFOHEADER (void *pointer, ImageSource source, BITMAPV5HEADER *bmi, BOOL *upsidedown) GDIP_INTERNAL; int gdip_read_bmp_data (void *pointer, BYTE *data, int size, ImageSource source) GDIP_INTERNAL; #endif /* _BMPCODEC_H */ libgdiplus-6.0.4+dfsg/src/texturebrush.c0000644000175000017500000005444713545154626021046 0ustar directhexdirecthex/* * texturebrush.c * * Copyright (C) 2003,2006-2007 Novell, Inc. http://www.novell.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. * * Authors: * Ravindra (rkumar@novell.com) * Sebastien Pouliot * * TODO * reduce duplication between draw_tile*_texture functions */ #include "texturebrush-private.h" #include "general-private.h" #include "graphics-private.h" #include "bitmap-private.h" #include "matrix-private.h" #include "metafile-private.h" static GpStatus gdip_texture_setup (GpGraphics *graphics, GpBrush *brush); static GpStatus gdip_texture_clone (GpBrush *brush, GpBrush **clonedBrush); static GpStatus gdip_texture_destroy (GpBrush *brush); /* * we have a single copy of vtable for * all instances of texturebrush. */ static BrushClass vtable = { BrushTypeTextureFill, gdip_texture_setup, gdip_texture_clone, gdip_texture_destroy }; static cairo_content_t from_cairoformat_to_content (cairo_format_t format) { switch (format) { case CAIRO_FORMAT_RGB24: return CAIRO_CONTENT_COLOR; case CAIRO_FORMAT_A8: return CAIRO_CONTENT_ALPHA; case CAIRO_FORMAT_ARGB32: default: return CAIRO_CONTENT_COLOR_ALPHA; } } static void gdip_texture_init (GpTexture *texture) { gdip_brush_init (&texture->base, &vtable); texture->wrapMode = WrapModeTile; texture->rectangle.X = 0; texture->rectangle.Y = 0; texture->rectangle.Width = 0; texture->rectangle.Height = 0; texture->pattern = NULL; cairo_matrix_init_identity (&texture->matrix); } static GpTexture* gdip_texture_new (void) { GpTexture *result = (GpTexture *) GdipAlloc (sizeof (GpTexture)); if (result) gdip_texture_init (result); return result; } /* * functions to create different wrapmodes. */ static GpStatus draw_tile_texture (cairo_t *ct, GpBitmap *bitmap, GpTexture *brush) { cairo_surface_t *texture; cairo_pattern_t *pat; GpStatus status; GpRect *rect = &brush->rectangle; cairo_t *ct2; if (!rect) return InvalidParameter; if (gdip_bitmap_ensure_surface (bitmap) == NULL) return OutOfMemory; /* Use the bitmap->surface as a pattern */ pat = cairo_pattern_create_for_surface (bitmap->surface); status = gdip_get_pattern_status (pat); if (status != Ok) { return status; } cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT); /* texture surface to be created */ texture = cairo_surface_create_similar ( bitmap->surface, from_cairoformat_to_content (bitmap->cairo_format), rect->Width, rect->Height); status = gdip_get_status (cairo_surface_status (texture)); if (status != Ok) { cairo_pattern_destroy (pat); return status; } /* Draw the texture */ ct2 = cairo_create (texture); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); cairo_destroy (ct2); brush->pattern = cairo_pattern_create_for_surface (texture); status = gdip_get_pattern_status (brush->pattern); if (status == Ok) cairo_pattern_set_extend (brush->pattern, CAIRO_EXTEND_REPEAT); cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return gdip_get_status (cairo_status (ct)); } static GpStatus draw_tile_flipX_texture (cairo_t *ct, GpBitmap *bitmap, GpTexture *brush) { cairo_surface_t *texture; cairo_pattern_t *pat; GpRect *rect = &brush->rectangle; GpStatus status; cairo_t *ct2; cairo_matrix_t tempMatrix; if (!rect) return InvalidParameter; if (gdip_bitmap_ensure_surface (bitmap) == NULL) return OutOfMemory; /* Use the bitmap->surface as a pattern */ pat = cairo_pattern_create_for_surface (bitmap->surface); status = gdip_get_pattern_status (pat); if (status != Ok) return status; cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT); /* texture surface to be created */ texture = cairo_surface_create_similar ( bitmap->surface, from_cairoformat_to_content (bitmap->cairo_format), 2 * rect->Width, rect->Height); status = gdip_get_status (cairo_surface_status (texture)); if (status != Ok) { cairo_pattern_destroy (pat); return status; } /* Draw left part of the texture */ ct2 = cairo_create (texture); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); /* Not sure if this is a bug, but using rect->Width - 1 avoids the seam. */ cairo_matrix_init_identity (&tempMatrix); cairo_matrix_translate (&tempMatrix, rect->Width - 1, 0); /* scale in -X direction to flip along X */ cairo_matrix_scale (&tempMatrix, -1.0, 1.0); cairo_pattern_set_matrix (pat, &tempMatrix); /* Draw right part of the texture */ cairo_set_source (ct2, pat); cairo_rectangle (ct2, rect->Width, 0, rect->Width, rect->Height); cairo_fill (ct2); cairo_destroy (ct2); brush->pattern = cairo_pattern_create_for_surface (texture); status = gdip_get_pattern_status (brush->pattern); if (status == Ok) cairo_pattern_set_extend (brush->pattern, CAIRO_EXTEND_REPEAT); cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return gdip_get_status (cairo_status (ct)); } static GpStatus draw_tile_flipY_texture (cairo_t *ct, GpBitmap *bitmap, GpTexture *brush) { cairo_surface_t *texture; cairo_pattern_t *pat; GpMatrix tempMatrix; GpRect *rect = &brush->rectangle; GpStatus status; cairo_t *ct2; if (!rect) return InvalidParameter; if (gdip_bitmap_ensure_surface (bitmap) == NULL) return OutOfMemory; /* Use the bitmap->surface as a pattern */ pat = cairo_pattern_create_for_surface (bitmap->surface); status = gdip_get_pattern_status (pat); if (status != Ok) return status; cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT); /* texture surface to be created */ texture = cairo_surface_create_similar ( bitmap->surface, from_cairoformat_to_content (bitmap->cairo_format), rect->Width, 2 * rect->Height); status = gdip_get_status (cairo_surface_status (texture)); if (status != Ok) { cairo_pattern_destroy (pat); return status; } /* Draw upper part of the texture */ ct2 = cairo_create (texture); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); /* Not sure if this is a bug, but using rect->Height - 1 avoids the seam. */ cairo_matrix_init_identity (&tempMatrix); cairo_matrix_translate (&tempMatrix, 0, rect->Height - 1); /* scale in -Y direction to flip along Y */ cairo_matrix_scale (&tempMatrix, 1.0, -1.0); cairo_pattern_set_matrix (pat, &tempMatrix); /* Draw lower part of the texture */ cairo_translate (ct2, 0, rect->Height); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); cairo_destroy(ct2); brush->pattern = cairo_pattern_create_for_surface (texture); status = gdip_get_pattern_status (brush->pattern); if (status != Ok) { cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return status; } cairo_pattern_set_extend (brush->pattern, CAIRO_EXTEND_REPEAT); cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return gdip_get_status (cairo_status (ct)); } static GpStatus draw_tile_flipXY_texture (cairo_t *ct, GpBitmap *bitmap, GpTexture *brush) { cairo_surface_t *texture; cairo_pattern_t *pat; GpMatrix tempMatrix; GpRect *rect = &brush->rectangle; GpStatus status; cairo_t *ct2; if (!rect) return InvalidParameter; if (gdip_bitmap_ensure_surface (bitmap) == NULL) return OutOfMemory; /* Use the original as a pattern */ pat = cairo_pattern_create_for_surface (bitmap->surface); status = gdip_get_pattern_status (pat); if (status != Ok) return status; cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT); /* texture surface to be created */ texture = cairo_surface_create_similar ( bitmap->surface, from_cairoformat_to_content (bitmap->cairo_format), 2 * rect->Width, 2 * rect->Height); status = gdip_get_status (cairo_surface_status (texture)); if (status != Ok) { cairo_pattern_destroy (pat); return status; } /* Draw upper left part of the texture */ ct2 = cairo_create (texture); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); /* Not sure if this is a bug, but using rect->Height - 1 avoids the seam. */ cairo_matrix_init_identity (&tempMatrix); cairo_matrix_translate (&tempMatrix, 0, rect->Height - 1); /* scale in -Y direction to flip along Y */ cairo_matrix_scale (&tempMatrix, 1.0, -1.0); cairo_pattern_set_matrix (pat, &tempMatrix); /* Draw lower left part of the texture */ cairo_translate (ct2, 0, rect->Height); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); /* Reset the pattern matrix and do fresh transformation */ cairo_matrix_init_identity (&tempMatrix); /* Not sure if this is a bug, but using rect->Width - 1 avoids the seam. */ cairo_matrix_translate (&tempMatrix, rect->Width - 1, 0); /* scale in -X direction to flip along X */ cairo_matrix_scale (&tempMatrix, -1.0, 1.0); cairo_pattern_set_matrix (pat, &tempMatrix); /* Draw upper right part of the texture */ cairo_translate (ct2, rect->Width, -rect->Height); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); /* Not sure if this is a bug, but using rect->Height - 1 avoids the seam. */ cairo_matrix_translate (&tempMatrix, 0, rect->Height - 1); /* scale in -Y direction to flip along Y */ cairo_matrix_scale (&tempMatrix, 1.0, -1.0); cairo_pattern_set_matrix (pat, &tempMatrix); /* Draw lower right part of the texture */ cairo_translate (ct2, 0, rect->Height); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); cairo_destroy(ct2); brush->pattern = cairo_pattern_create_for_surface (texture); status = gdip_get_pattern_status(brush->pattern); if (status != Ok) { cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return status; } cairo_pattern_set_extend (brush->pattern, CAIRO_EXTEND_REPEAT); cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return gdip_get_status (cairo_status (ct)); } static GpStatus draw_clamp_texture (cairo_t *ct, GpBitmap *bitmap, GpTexture *brush) { cairo_surface_t *texture; cairo_pattern_t *pat; GpRect *rect = &brush->rectangle; GpStatus status; cairo_t *ct2; /* Original image surface */ if (gdip_bitmap_ensure_surface (bitmap) == NULL) return OutOfMemory; /* Use the original as a pattern */ pat = cairo_pattern_create_for_surface (bitmap->surface); status = gdip_get_pattern_status (pat); if (status != Ok) { return status; } cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT); /* texture surface to be created */ texture = cairo_surface_create_similar ( bitmap->surface, from_cairoformat_to_content (bitmap->cairo_format), rect->Width, rect->Height); if (!texture) { cairo_pattern_destroy (pat); return OutOfMemory; } /* Draw the texture */ ct2 = cairo_create (texture); cairo_identity_matrix (ct2); cairo_set_source (ct2, pat); cairo_rectangle (ct2, 0, 0, rect->Width, rect->Height); cairo_fill (ct2); cairo_destroy(ct2); brush->pattern = cairo_pattern_create_for_surface (texture); status = gdip_get_pattern_status (brush->pattern); if (status != Ok) { cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return status; } cairo_pattern_destroy (pat); cairo_surface_destroy (texture); return gdip_get_status (cairo_status (ct)); } GpStatus gdip_texture_setup (GpGraphics *graphics, GpBrush *brush) { cairo_t *ct; cairo_pattern_t *pattern; GpTexture *texture; GpImage *img; GpStatus status = Ok; BOOL dispose_bitmap; if (!graphics || !brush || !graphics->ct) return InvalidParameter; texture = (GpTexture *) brush; img = texture->image; if (!img) return InvalidParameter; if (img->type != ImageTypeBitmap) return NotImplemented; if (gdip_is_an_indexed_pixelformat (img->active_bitmap->pixel_format)) { /* Unable to create a surface for the bitmap; it is an indexed image. * Instead, it will first be converted to 32-bit RGB. */ img = gdip_convert_indexed_to_rgb (img); if (!img) return OutOfMemory; if (gdip_bitmap_ensure_surface (img) == NULL) return OutOfMemory; dispose_bitmap = TRUE; } else { dispose_bitmap = FALSE; } ct = graphics->ct; /* We create the new pattern for brush, if the brush is changed * or if pattern has not been created yet. */ if (texture->base.changed || !texture->pattern) { if (texture->pattern) cairo_pattern_destroy (texture->pattern); switch (texture->wrapMode) { case WrapModeTile: status = draw_tile_texture (ct, img, texture); break; case WrapModeTileFlipX: status = draw_tile_flipX_texture (ct, img, texture); break; case WrapModeTileFlipY: status = draw_tile_flipY_texture (ct, img, texture); break; case WrapModeTileFlipXY: status = draw_tile_flipXY_texture (ct, img, texture); break; case WrapModeClamp: status = draw_clamp_texture (ct, img, texture); break; default: status = InvalidParameter; } } if (dispose_bitmap) { GdipDisposeImage((GpImage *)img); } if ((status != Ok) || (gdip_get_pattern_status(texture->pattern) != Ok)) { return GenericError; } pattern = texture->pattern; if (pattern != NULL) { /* got something to apply ? */ if (!gdip_is_matrix_empty (&texture->matrix)) { cairo_matrix_t product; gdip_cairo_matrix_copy (&product, &texture->matrix); cairo_matrix_invert (&product); cairo_pattern_set_matrix (pattern, &product); } cairo_set_source (ct, pattern); } return gdip_get_status (cairo_status (ct)); } GpStatus gdip_texture_clone (GpBrush *brush, GpBrush **clonedBrush) { GpTexture *result; GpTexture *texture; GpStatus status; if (!brush || !clonedBrush) return InvalidParameter; result = gdip_texture_new (); if (!result) return OutOfMemory; texture = (GpTexture *) brush; result->base = texture->base; result->wrapMode = texture->wrapMode; /* Let the clone create its own pattern. */ result->pattern = NULL; result->base.changed = TRUE; gdip_cairo_matrix_copy (&result->matrix, &texture->matrix); result->rectangle.X = texture->rectangle.X; result->rectangle.Y = texture->rectangle.Y; result->rectangle.Width = texture->rectangle.Width; result->rectangle.Height = texture->rectangle.Height; result->image = NULL; status = GdipCloneImage (texture->image, &result->image); if (status != Ok) { GdipDeleteBrush ((GpBrush *) result); *clonedBrush = NULL; return status; } else { cairo_surface_reference (result->image->surface); } *clonedBrush = (GpBrush *) result; return status; } GpStatus gdip_texture_destroy (GpBrush *brush) { /* a. the NULL check for brush is done by the caller, GdipDeleteBrush */ /* b. brush itself is freed by the caller */ GpTexture *texture = (GpTexture *) brush; if (texture->pattern) { cairo_pattern_destroy (texture->pattern); texture->pattern = NULL; } if (texture->image) { GdipDisposeImage (texture->image); texture->image = NULL; } return Ok; } static GpStatus gdip_texture_create_from_cloned_image (GpImage *image, GpWrapMode wrapMode, GpTexture **texture) { GpTexture *result; result = gdip_texture_new (); if (!result) return OutOfMemory; result->image = image; gdip_bitmap_ensure_surface (image); result->wrapMode = wrapMode; result->rectangle.X = 0; result->rectangle.Y = 0; result->rectangle.Width = result->image->active_bitmap->width; result->rectangle.Height = result->image->active_bitmap->height; *texture = result; return Ok; } /* coverity[+alloc : arg-*2] */ GpStatus WINGDIPAPI GdipCreateTexture (GpImage *image, GpWrapMode wrapmode, GpTexture **texture) { GpImage *textureImage; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!image || !texture) return InvalidParameter; if (wrapmode > WrapModeClamp) { *texture = NULL; return OutOfMemory; } switch (image->type) { case ImageTypeBitmap: status = GdipCloneImage (image, &textureImage); if (status != Ok) return status; break; case ImageTypeMetafile: status = gdip_get_bitmap_from_metafile ((GpMetafile *) image, 0, 0, &textureImage); if (status != Ok) return status; break; default: return GenericError; } return gdip_texture_create_from_cloned_image (textureImage, wrapmode, texture); } /* coverity[+alloc : arg-*6] */ GpStatus WINGDIPAPI GdipCreateTexture2 (GpImage *image, GpWrapMode wrapmode, REAL x, REAL y, REAL width, REAL height, GpTexture **texture) { if (!gdiplusInitialized) return GdiplusNotInitialized; return GdipCreateTexture2I (image, wrapmode, (INT) x, (INT) y, (INT) width, (INT) height, texture); } /* coverity[+alloc : arg-*6] */ GpStatus WINGDIPAPI GdipCreateTexture2I (GpImage *image, GpWrapMode wrapmode, INT x, INT y, INT width, INT height, GpTexture **texture) { GpImage *textureImage; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!image || !texture) return InvalidParameter; if (wrapmode > WrapModeClamp) { *texture = NULL; return OutOfMemory; } switch (image->type) { case ImageTypeBitmap: { INT bmpWidth = image->active_bitmap->width; INT bmpHeight = image->active_bitmap->height; if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0) || (bmpWidth < (x + width)) || (bmpHeight < (y + height))) { *texture = NULL; return OutOfMemory; } status = GdipCloneBitmapAreaI (x, y, width, height, image->active_bitmap->pixel_format, image, &textureImage); if (status != Ok) return status; break; } case ImageTypeMetafile: status = gdip_get_bitmap_from_metafile ((GpMetafile *) image, width, height, &textureImage); if (status != Ok) return status; break; default: return GenericError; } return gdip_texture_create_from_cloned_image (textureImage, wrapmode, texture); } /* coverity[+alloc : arg-*6] */ GpStatus WINGDIPAPI GdipCreateTextureIA (GpImage *image, GpImageAttributes *imageAttributes, REAL x, REAL y, REAL width, REAL height, GpTexture **texture) { if (!gdiplusInitialized) return GdiplusNotInitialized; return GdipCreateTextureIAI (image, imageAttributes, (INT) x, (INT) y, (INT) width, (INT) height, texture); } /* coverity[+alloc : arg-*6] */ GpStatus WINGDIPAPI GdipCreateTextureIAI (GpImage *image, GpImageAttributes *imageAttributes, INT x, INT y, INT width, INT height, GpTexture **texture) { if (!gdiplusInitialized) return GdiplusNotInitialized; /* FIXME MonoTODO: Make use of ImageAttributes parameter when * ImageAttributes is implemented */ GpWrapMode mode = imageAttributes ? imageAttributes->wrapmode : WrapModeTile; return GdipCreateTexture2I (image, mode, x, y, width, height, texture); } GpStatus WINGDIPAPI GdipGetTextureTransform (GpTexture *texture, GpMatrix *matrix) { if (!texture || !matrix) return InvalidParameter; gdip_cairo_matrix_copy (matrix, &texture->matrix); return Ok; } GpStatus WINGDIPAPI GdipSetTextureTransform (GpTexture *texture, GDIPCONST GpMatrix *matrix) { BOOL invertible; if (!texture || !matrix) return InvalidParameter; GdipIsMatrixInvertible ((GpMatrix *) matrix, &invertible); if (!invertible) return InvalidParameter; gdip_cairo_matrix_copy (&texture->matrix, matrix); texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipResetTextureTransform (GpTexture *texture) { if (!texture) return InvalidParameter; cairo_matrix_init_identity (&texture->matrix); texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipMultiplyTextureTransform (GpTexture *texture, GpMatrix *matrix, GpMatrixOrder order) { BOOL invertible; if (!texture) return InvalidParameter; if (!matrix) return Ok; /* the matrix MUST be invertible to be used */ GdipIsMatrixInvertible (matrix, &invertible); if (!invertible) return InvalidParameter; if (order == MatrixOrderPrepend) cairo_matrix_multiply (&texture->matrix, matrix, &texture->matrix); else cairo_matrix_multiply (&texture->matrix, &texture->matrix, matrix); texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipTranslateTextureTransform (GpTexture *texture, REAL dx, REAL dy, GpMatrixOrder order) { GpStatus status; if (!texture) return InvalidParameter; status = GdipTranslateMatrix (&texture->matrix, dx, dy, order); if (status != Ok) return status; texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipScaleTextureTransform (GpTexture *texture, REAL sx, REAL sy, GpMatrixOrder order) { GpStatus status; if (!texture) return InvalidParameter; status = GdipScaleMatrix (&texture->matrix, sx, sy, order); if (status != Ok) return status; texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipRotateTextureTransform (GpTexture *texture, REAL angle, GpMatrixOrder order) { GpStatus status; if (!texture) return InvalidParameter; status = GdipRotateMatrix (&texture->matrix, angle, order); if (status != Ok) return status; texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipSetTextureWrapMode (GpTexture *texture, GpWrapMode wrapMode) { if (!texture) return InvalidParameter; /* ignore invalid GpWrapMode value */ if (wrapMode > WrapModeClamp) return Ok; texture->wrapMode = wrapMode; texture->base.changed = TRUE; return Ok; } GpStatus WINGDIPAPI GdipGetTextureWrapMode (GpTexture *texture, GpWrapMode *wrapMode) { if (!texture || !wrapMode) return InvalidParameter; *wrapMode = texture->wrapMode; return Ok; } /* coverity[+alloc : arg-*1] */ GpStatus WINGDIPAPI GdipGetTextureImage (GpTexture *texture, GpImage **image) { if (!gdiplusInitialized) return GdiplusNotInitialized; if (!texture || !image) return InvalidParameter; return GdipCloneImage (texture->image, image); } libgdiplus-6.0.4+dfsg/src/pen.h0000644000175000017500000001203613542674535017060 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __PEN_H__ #define __PEN_H__ GpStatus WINGDIPAPI GdipCreatePen1 (ARGB argb, REAL width, GpUnit unit, GpPen **pen); GpStatus WINGDIPAPI GdipCreatePen2 (GpBrush *brush, REAL width, GpUnit unit, GpPen **pen); GpStatus WINGDIPAPI GdipClonePen (GpPen *pen, GpPen **clonepen); GpStatus WINGDIPAPI GdipDeletePen (GpPen *pen); GpStatus WINGDIPAPI GdipSetPenWidth (GpPen *pen, REAL width); GpStatus WINGDIPAPI GdipGetPenWidth (GpPen *pen, REAL *width); GpStatus WINGDIPAPI GdipGetPenUnit (GpPen *pen, GpUnit *unit); GpStatus WINGDIPAPI GdipSetPenUnit (GpPen *pen, GpUnit unit); GpStatus WINGDIPAPI GdipSetPenBrushFill (GpPen *pen, GpBrush *brush); GpStatus WINGDIPAPI GdipGetPenBrushFill (GpPen *pen, GpBrush **brush); GpStatus WINGDIPAPI GdipGetPenFillType (GpPen *pen, GpPenType *type); GpStatus WINGDIPAPI GdipSetPenColor (GpPen *pen, ARGB color); GpStatus WINGDIPAPI GdipGetPenColor (GpPen *pen, ARGB *color); GpStatus WINGDIPAPI GdipSetPenDashStyle (GpPen *pen, GpDashStyle dashstyle); GpStatus WINGDIPAPI GdipGetPenDashStyle (GpPen *pen, GpDashStyle *dashstyle); GpStatus WINGDIPAPI GdipSetPenDashOffset (GpPen *pen, REAL offset); GpStatus WINGDIPAPI GdipGetPenDashOffset (GpPen *pen, REAL *offset); GpStatus WINGDIPAPI GdipGetPenDashCount (GpPen *pen, INT *count); GpStatus WINGDIPAPI GdipSetPenDashArray (GpPen *pen, GDIPCONST REAL *dash, INT count); GpStatus WINGDIPAPI GdipGetPenDashArray (GpPen *pen, REAL *dash, INT count); GpStatus WINGDIPAPI GdipSetPenCompoundArray (GpPen *pen, GDIPCONST REAL *dash, INT count); GpStatus WINGDIPAPI GdipGetPenCompoundArray (GpPen *pen, REAL *dash, INT count); GpStatus WINGDIPAPI GdipGetPenCompoundCount (GpPen *pen, INT *count); GpStatus WINGDIPAPI GdipSetPenMode (GpPen *pen, GpPenAlignment penMode); GpStatus WINGDIPAPI GdipGetPenMode (GpPen *pen, GpPenAlignment *penMode); GpStatus WINGDIPAPI GdipSetPenMiterLimit (GpPen *pen, REAL miterLimit); GpStatus WINGDIPAPI GdipGetPenMiterLimit (GpPen *pen, REAL *miterLimit); GpStatus WINGDIPAPI GdipSetPenLineCap197819 (GpPen *pen, GpLineCap startCap, GpLineCap endCap, GpDashCap dashCap); GpStatus WINGDIPAPI GdipSetPenStartCap (GpPen *pen, GpLineCap startCap); GpStatus WINGDIPAPI GdipGetPenStartCap (GpPen *pen, GpLineCap *startCap); GpStatus WINGDIPAPI GdipSetPenEndCap (GpPen *pen, GpLineCap endCap); GpStatus WINGDIPAPI GdipGetPenEndCap (GpPen *pen, GpLineCap *endCap); GpStatus WINGDIPAPI GdipSetPenDashCap197819 (GpPen *pen, GpDashCap dashCap); GpStatus WINGDIPAPI GdipGetPenDashCap197819 (GpPen *pen, GpDashCap *dashCap); GpStatus WINGDIPAPI GdipSetPenLineJoin (GpPen *pen, GpLineJoin lineJoin); GpStatus WINGDIPAPI GdipGetPenLineJoin (GpPen *pen, GpLineJoin *lineJoin); GpStatus WINGDIPAPI GdipSetPenCustomStartCap (GpPen *pen, GpCustomLineCap *customCap); GpStatus WINGDIPAPI GdipGetPenCustomStartCap (GpPen *pen, GpCustomLineCap **customCap); GpStatus WINGDIPAPI GdipSetPenCustomEndCap (GpPen *pen, GpCustomLineCap *customCap); GpStatus WINGDIPAPI GdipGetPenCustomEndCap (GpPen *pen, GpCustomLineCap **customCap); GpStatus WINGDIPAPI GdipSetPenTransform (GpPen *pen, GpMatrix *matrix); GpStatus WINGDIPAPI GdipGetPenTransform (GpPen *pen, GpMatrix *matrix); GpStatus WINGDIPAPI GdipResetPenTransform (GpPen *pen); GpStatus WINGDIPAPI GdipMultiplyPenTransform (GpPen *pen, GpMatrix *matrix, GpMatrixOrder order); GpStatus WINGDIPAPI GdipTranslatePenTransform (GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipScalePenTransform (GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipRotatePenTransform (GpPen *pen, REAL angle, GpMatrixOrder order); #endif libgdiplus-6.0.4+dfsg/src/pathgradientbrush.h0000644000175000017500000001227613542674535022022 0ustar directhexdirecthex/* * 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. * * Authors: * Vladimir Vukicevic (vladimir@pobox.com) * Ravindra (rkumar@novell.com) * Sebastien Pouliot * * Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com) */ #ifndef __PATHGRADIENTBRUSH_H__ #define __PATHGRADIENTBRUSH_H__ #include "brush.h" GpStatus WINGDIPAPI GdipCreatePathGradient (GDIPCONST GpPointF *points, INT count, GpWrapMode wrapMode, GpPathGradient **polyGradient); GpStatus WINGDIPAPI GdipCreatePathGradientI (GDIPCONST GpPoint *points, INT count, GpWrapMode wrapMode, GpPathGradient **polyGradient); GpStatus WINGDIPAPI GdipCreatePathGradientFromPath (GDIPCONST GpPath *path, GpPathGradient **polyGradient); GpStatus WINGDIPAPI GdipGetPathGradientCenterColor (GpPathGradient *brush, ARGB *colors); GpStatus WINGDIPAPI GdipSetPathGradientCenterColor (GpPathGradient *brush, ARGB colors); GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount (GpPathGradient *brush, INT *count); GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount (GpPathGradient *brush, ARGB *color, INT *count); GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount (GpPathGradient *brush, GDIPCONST ARGB *color, INT *count); GpStatus WINGDIPAPI GdipGetPathGradientPath (GpPathGradient *brush, GpPath *path); GpStatus WINGDIPAPI GdipSetPathGradientPath (GpPathGradient *brush, GDIPCONST GpPath *path); GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint (GpPathGradient *brush, GpPointF *points); GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI (GpPathGradient *brush, GpPoint* points); GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint (GpPathGradient *brush, GDIPCONST GpPointF *points); GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI (GpPathGradient *brush, GDIPCONST GpPoint* points); GpStatus WINGDIPAPI GdipGetPathGradientRect (GpPathGradient *brush, GpRectF *rect); GpStatus WINGDIPAPI GdipGetPathGradientRectI (GpPathGradient *brush, GpRect *rect); GpStatus WINGDIPAPI GdipGetPathGradientPointCount (GpPathGradient *brush, INT *count); GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection (GpPathGradient *brush, BOOL useGammaCorrection); GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection (GpPathGradient *brush, BOOL *useGammaCorrection); GpStatus WINGDIPAPI GdipGetPathGradientBlendCount (GpPathGradient *brush, INT *count); GpStatus WINGDIPAPI GdipGetPathGradientBlend (GpPathGradient *brush, REAL *blend, REAL *positions, INT count); GpStatus WINGDIPAPI GdipSetPathGradientBlend (GpPathGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *positions, INT count); GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount (GpPathGradient *brush, INT *count); GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend (GpPathGradient *brush, ARGB *blend, REAL *positions, INT count); GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend (GpPathGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *positions, INT count); GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend (GpPathGradient *brush, REAL focus, REAL scale); GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend (GpPathGradient *brush, REAL focus, REAL scale); GpStatus WINGDIPAPI GdipGetPathGradientWrapMode (GpPathGradient *brush, GpWrapMode *wrapMode); GpStatus WINGDIPAPI GdipSetPathGradientWrapMode (GpPathGradient *brush, GpWrapMode wrapMode); GpStatus WINGDIPAPI GdipGetPathGradientTransform (GpPathGradient *brush, GpMatrix *matrix); GpStatus WINGDIPAPI GdipSetPathGradientTransform (GpPathGradient *brush, GpMatrix *matrix); GpStatus WINGDIPAPI GdipResetPathGradientTransform (GpPathGradient *brush); GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform (GpPathGradient *brush, GDIPCONST GpMatrix *matrix, GpMatrixOrder order); GpStatus WINGDIPAPI GdipTranslatePathGradientTransform (GpPathGradient *brush, REAL dx, REAL dy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipScalePathGradientTransform (GpPathGradient *brush, REAL sx, REAL sy, GpMatrixOrder order); GpStatus WINGDIPAPI GdipRotatePathGradientTransform (GpPathGradient *brush, REAL angle, GpMatrixOrder order); GpStatus WINGDIPAPI GdipGetPathGradientFocusScales (GpPathGradient *brush, REAL *xScale, REAL *yScale); GpStatus WINGDIPAPI GdipSetPathGradientFocusScales (GpPathGradient *brush, REAL xScale, REAL yScale); #endif libgdiplus-6.0.4+dfsg/src/matrix.h0000644000175000017500000000623113542673672017603 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __MATRIX_H__ #define __MATRIX_H__ GpStatus WINGDIPAPI GdipCreateMatrix (GpMatrix **matrix); GpStatus WINGDIPAPI GdipCreateMatrix2 (REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix); GpStatus WINGDIPAPI GdipCreateMatrix3 (GDIPCONST GpRectF *rect, GDIPCONST GpPointF *dstplg, GpMatrix **matrix); GpStatus WINGDIPAPI GdipCreateMatrix3I (GDIPCONST GpRect *rect, GDIPCONST GpPoint *dstplg, GpMatrix **matrix); GpStatus WINGDIPAPI GdipCloneMatrix (GpMatrix *matrix, GpMatrix **cloneMatrix); GpStatus WINGDIPAPI GdipDeleteMatrix (GpMatrix *matrix); GpStatus WINGDIPAPI GdipSetMatrixElements (GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy); GpStatus WINGDIPAPI GdipMultiplyMatrix (GpMatrix *matrix, GpMatrix *matrix2, GpMatrixOrder order); GpStatus WINGDIPAPI GdipTranslateMatrix (GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order); GpStatus WINGDIPAPI GdipScaleMatrix (GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order); GpStatus WINGDIPAPI GdipRotateMatrix (GpMatrix *matrix, REAL angle, GpMatrixOrder order); GpStatus WINGDIPAPI GdipShearMatrix (GpMatrix *matrix, REAL shearX, REAL shearY, GpMatrixOrder order); GpStatus WINGDIPAPI GdipInvertMatrix (GpMatrix *matrix); GpStatus WINGDIPAPI GdipTransformMatrixPoints (GpMatrix *matrix, GpPointF *pts, INT count); GpStatus WINGDIPAPI GdipTransformMatrixPointsI (GpMatrix *matrix, GpPoint *pts, INT count); GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints (GpMatrix *matrix, GpPointF *pts, INT count); GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI (GpMatrix *matrix, GpPoint *pts, INT count); GpStatus WINGDIPAPI GdipGetMatrixElements (GDIPCONST GpMatrix *matrix, REAL *matrixOut); GpStatus WINGDIPAPI GdipIsMatrixInvertible (GDIPCONST GpMatrix *matrix, BOOL *result); GpStatus WINGDIPAPI GdipIsMatrixIdentity (GDIPCONST GpMatrix *matrix, BOOL *result); GpStatus WINGDIPAPI GdipIsMatrixEqual (GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result); #endif libgdiplus-6.0.4+dfsg/src/region.h0000644000175000017500000000773613542674535017574 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __REGION_H__ #define __REGION_H__ GpStatus WINGDIPAPI GdipCreateRegion (GpRegion **region); GpStatus WINGDIPAPI GdipCreateRegionRect (GDIPCONST GpRectF *rect, GpRegion **region); GpStatus WINGDIPAPI GdipCreateRegionRectI (GDIPCONST GpRect *rect, GpRegion **region); GpStatus WINGDIPAPI GdipCreateRegionPath (GpPath *path, GpRegion **region); GpStatus WINGDIPAPI GdipCreateRegionRgnData (GDIPCONST BYTE *regionData, INT size, GpRegion **region); GpStatus WINGDIPAPI GdipCloneRegion(GpRegion *region, GpRegion **cloneRegion); GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region); GpStatus WINGDIPAPI GdipSetInfinite(GpRegion *region); GpStatus WINGDIPAPI GdipSetEmpty(GpRegion *region); GpStatus WINGDIPAPI GdipCombineRegionRect(GpRegion *region, GDIPCONST GpRectF *rect, CombineMode combineMode); GpStatus WINGDIPAPI GdipCombineRegionRectI(GpRegion *region, GDIPCONST GpRect *rect, CombineMode combineMode); GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, CombineMode combineMode); GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region, GpRegion *region2, CombineMode combineMode); GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics, GpRectF *rect); GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hRgn); GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsInfiniteRegion(GpRegion *region, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleRegionPoint(GpRegion *region, REAL x, REAL y, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleRegionPointI(GpRegion *region, INT x, INT y, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleRegionRect(GpRegion *region, REAL x, REAL y, REAL width, REAL height, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipIsVisibleRegionRectI(GpRegion *region, INT x, INT y, INT width, INT height, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMatrix *matrix); GpStatus WINGDIPAPI GdipGetRegionScans(GpRegion *region, GpRectF *rects, INT *count, GpMatrix *matrix); GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *rects, INT *count, GpMatrix *matrix); GpStatus WINGDIPAPI GdipIsEqualRegion(GpRegion *region, GpRegion *region2, GpGraphics *graphics, BOOL *result); GpStatus WINGDIPAPI GdipGetRegionDataSize(GpRegion *region, UINT * bufferSize); GpStatus WINGDIPAPI GdipGetRegionData(GpRegion *region, BYTE * buffer, UINT bufferSize, UINT *sizeFilled); GpStatus WINGDIPAPI GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy); GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy); GpStatus WINGDIPAPI GdipTransformRegion(GpRegion *region, GpMatrix *matrix); #endif libgdiplus-6.0.4+dfsg/src/adjustablearrowcap.c0000644000175000017500000001550213542674535022147 0ustar directhexdirecthex/* * adjustablearrowcap.c * * 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. * * Author: * Ravindra (rkumar@novell.com) * * Copyright (C) 2003-2007 Novell, Inc. http://www.novell.com */ #include "adjustablearrowcap-private.h" #include "general-private.h" #include "graphics-private.h" static GpStatus gdip_adjust_arrowcap_setup (GpGraphics *graphics, GpCustomLineCap *cap); static GpStatus gdip_adjust_arrowcap_clone_cap (GpCustomLineCap *cap, GpCustomLineCap **clonedCap); static GpStatus gdip_adjust_arrowcap_destroy (GpCustomLineCap *cap); static GpStatus gdip_adjust_arrowcap_draw (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *Cap, float x, float y, float otherend_x, float otherend_y); /* * we have a single copy of vtable for * all instances of adjustable arrowcap. */ static CapClass vtable = { CustomLineCapTypeAdjustableArrow, gdip_adjust_arrowcap_setup, gdip_adjust_arrowcap_clone_cap, gdip_adjust_arrowcap_destroy, gdip_adjust_arrowcap_draw }; static void gdip_adjust_arrowcap_init (GpAdjustableArrowCap *arrow) { gdip_custom_linecap_init (&arrow->base, &vtable); arrow->fill_state = TRUE; arrow->middle_inset = 0.0; arrow->width = 0.0; arrow->height = 0.0; } static GpAdjustableArrowCap* gdip_adjust_arrowcap_new (void) { GpAdjustableArrowCap *result = (GpAdjustableArrowCap *) GdipAlloc (sizeof (GpAdjustableArrowCap)); if (result) gdip_adjust_arrowcap_init (result); return result; } GpStatus gdip_adjust_arrowcap_clone_cap (GpCustomLineCap *cap, GpCustomLineCap **clonedCap) { GpAdjustableArrowCap *newcap; if (!cap || !clonedCap) return InvalidParameter; newcap = gdip_adjust_arrowcap_new (); if (!newcap) return OutOfMemory; memcpy (newcap, cap, sizeof (GpAdjustableArrowCap)); *clonedCap = (GpCustomLineCap *) newcap; return Ok; } GpStatus gdip_adjust_arrowcap_destroy (GpCustomLineCap *cap) { if (!cap) return InvalidParameter; GdipFree (cap); return Ok; } /* MonoTODO: Implement this when cairo supports cairo_stroke_path API */ GpStatus gdip_adjust_arrowcap_setup (GpGraphics *graphics, GpCustomLineCap *customCap) { if (!graphics || !customCap) return InvalidParameter; return NotImplemented; } GpStatus gdip_adjust_arrowcap_draw (GpGraphics *graphics, GpPen *pen, GpCustomLineCap *customCap, float x, float y, float otherend_x, float otherend_y) { double angle; GpAdjustableArrowCap *arrowcap; float w; float h; float penwidth; if (!graphics || !customCap) return InvalidParameter; penwidth = pen->width; if (penwidth < 2.0) { /* Seems to be a minimum */ penwidth = 2.0; } arrowcap = (GpAdjustableArrowCap *)customCap; w = arrowcap->width / 2; h = arrowcap->height; angle = gdip_custom_linecap_angle (x, y, otherend_x, otherend_y); cairo_save (graphics->ct); /* FIXME: handle base_inset (including set/get!) */ cairo_translate (graphics->ct, x, y); cairo_rotate (graphics->ct, angle); gdip_cairo_move_to (graphics, 0, 0, TRUE, TRUE); gdip_cairo_line_to (graphics, (double)-w * penwidth, (double)-h * penwidth, TRUE, TRUE); gdip_cairo_line_to (graphics, (double)w * penwidth, (double)-h * penwidth, TRUE, TRUE); gdip_cairo_line_to (graphics, 0, 0, TRUE, TRUE); if (arrowcap->fill_state) { /* FIXME: handle middle_inset */ cairo_fill_preserve (graphics->ct); } cairo_stroke (graphics->ct); cairo_restore (graphics->ct); return Ok; } static void update_adjustablearrowcap (GpAdjustableArrowCap *cap) { if (cap->width) { cap->base.base_inset = cap->height / cap->width; } else { cap->base.base_inset = 0; } cap->base.base_cap = LineCapTriangle; } /* AdjustableArrowCap functions */ // coverity[+alloc : arg-*3] GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap (REAL height, REAL width, BOOL isFilled, GpAdjustableArrowCap **cap) { GpAdjustableArrowCap *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!cap) return InvalidParameter; result = gdip_adjust_arrowcap_new (); if (!result) { *cap = NULL; return OutOfMemory; } result->fill_state = isFilled; result->width = width; result->height = height; update_adjustablearrowcap (result); *cap = result; return Ok; } GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight (GpAdjustableArrowCap *cap, REAL height) { if (!cap) return InvalidParameter; if (height != cap->height) { cap->height = height; update_adjustablearrowcap (cap); } return Ok; } GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight (GpAdjustableArrowCap *cap, REAL *height) { if (!cap || !height) return InvalidParameter; *height = cap->height; return Ok; } GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth (GpAdjustableArrowCap *cap, REAL width) { if (!cap) return InvalidParameter; if (width != cap->width) { cap->width = width; update_adjustablearrowcap (cap); } return Ok; } GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth (GpAdjustableArrowCap *cap, REAL *width) { if (!cap || !width) return InvalidParameter; *width = cap->width; return Ok; } GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset (GpAdjustableArrowCap *cap, REAL middleInset) { if (!cap) return InvalidParameter; if (middleInset != cap->middle_inset) { cap->middle_inset = middleInset; update_adjustablearrowcap (cap); } return Ok; } GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset (GpAdjustableArrowCap *cap, REAL *middleInset) { if (!cap || !middleInset) return InvalidParameter; *middleInset = cap->middle_inset; return Ok; } GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState (GpAdjustableArrowCap *cap, BOOL isFilled) { if (!cap) return InvalidParameter; if (isFilled != cap->fill_state) { cap->fill_state = isFilled; update_adjustablearrowcap (cap); } return Ok; } GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState (GpAdjustableArrowCap *cap, BOOL *isFilled) { if (!cap || !isFilled) return InvalidParameter; *isFilled = cap->fill_state; return Ok; } libgdiplus-6.0.4+dfsg/src/graphics-cairo.c0000644000175000017500000006141313542674535021167 0ustar directhexdirecthex/* * Copyright (c) 2003 Alexandre Pigolkine, Novell Inc. * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Sebastien Pouliot */ #include "graphics-cairo-private.h" #include "graphics-private.h" #include "graphics-path-private.h" /* * NOTE: all parameter's validations are done inside graphics.c */ /* helper functions to avoid a lot of repetitive code */ static GpStatus fill_graphics_with_brush (GpGraphics *graphics, GpBrush *brush, BOOL stroke) { /* We do brush setup just before filling. */ gdip_brush_setup (graphics, brush); /* don't stroke if scaled (since the pen thickness will be scaled too!) */ if (stroke && !gdip_is_scaled (graphics)) { /* stroke only using 1 pixel width - see #413461 */ double width = cairo_get_line_width (graphics->ct); cairo_set_line_width (graphics->ct, 1.0); cairo_stroke_preserve (graphics->ct); cairo_set_line_width (graphics->ct, width); } cairo_close_path (graphics->ct); cairo_fill (graphics->ct); /* Set the matrix back to graphics->copy_of_ctm for other functions. * This overwrites the matrix set by brush setup. */ gdip_cairo_set_matrix (graphics, graphics->copy_of_ctm); return gdip_get_status (cairo_status (graphics->ct)); } static GpStatus stroke_graphics_with_pen (GpGraphics *graphics, GpPen *pen) { /* We do pen setup just before stroking. */ gdip_pen_setup (graphics, pen); cairo_stroke (graphics->ct); /* Set the matrix back to graphics->copy_of_ctm for other functions. * This overwrites the matrix set by pen setup. */ gdip_cairo_set_matrix (graphics, graphics->copy_of_ctm); return gdip_get_status (cairo_status (graphics->ct)); } cairo_fill_rule_t gdip_convert_fill_mode (FillMode fill_mode) { if (fill_mode == FillModeAlternate) return CAIRO_FILL_RULE_EVEN_ODD; else return CAIRO_FILL_RULE_WINDING; } static void make_ellipse (GpGraphics *graphics, float x, float y, float width, float height, BOOL convert_units, BOOL antialiasing) { double rx, ry, cx, cy; /* if required deal, once and for all, with unit conversion */ if (convert_units && !OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); width = gdip_unitx_convgr (graphics, width); height = gdip_unity_convgr (graphics, height); } rx = width / 2; ry = height / 2; cx = x + rx; cy = y + ry; /* if required deal, once and for all, with antialiasing */ if (antialiasing && !gdip_is_scaled (graphics)) { cx += graphics->aa_offset_x; cy += graphics->aa_offset_y; } gdip_cairo_move_to (graphics, cx + rx, cy, FALSE, FALSE); /* an approximate of the ellipse by drawing a curve in each * quadrants */ gdip_cairo_curve_to (graphics, cx + rx, cy - C1 * ry, cx + C1 * rx, cy - ry, cx, cy - ry, FALSE, FALSE); gdip_cairo_curve_to (graphics, cx - C1 * rx, cy - ry, cx - rx, cy - C1 * ry, cx - rx, cy, FALSE, FALSE); gdip_cairo_curve_to (graphics, cx - rx, cy + C1 * ry, cx - C1 * rx, cy + ry, cx, cy + ry, FALSE, FALSE); gdip_cairo_curve_to (graphics, cx + C1 * rx, cy + ry, cx + rx, cy + C1 * ry, cx + rx, cy, FALSE, FALSE); cairo_close_path (graphics->ct); } /* * Based on the algorithm described in * http://www.stillhq.com/ctpfaq/2002/03/c1088.html#AEN1212 */ static void make_arc (GpGraphics *graphics, BOOL start, float x, float y, float width, float height, float startAngle, float endAngle, BOOL antialiasing) { float delta, bcp; double sin_alpha, sin_beta, cos_alpha, cos_beta; float rx = width / 2; float ry = height / 2; /* center */ float cx = x + rx; float cy = y + ry; /* angles in radians */ float alpha = startAngle * PI / 180; float beta = endAngle * PI / 180; /* adjust angles for ellipses */ alpha = atan2 (rx * sin (alpha), ry * cos (alpha)); beta = atan2 (rx * sin (beta), ry * cos (beta)); if (fabs (beta - alpha) > M_PI){ if (beta > alpha) beta -= 2 * PI; else alpha -= 2 * PI; } delta = beta - alpha; bcp = 4.0 / 3 * (1 - cos (delta / 2)) / sin (delta /2); sin_alpha = sin (alpha); sin_beta = sin (beta); cos_alpha = cos (alpha); cos_beta = cos (beta); /* don't move to starting point if we're continuing an existing curve */ if (start) { /* starting point */ double sx = cx + rx * cos_alpha; double sy = cy + ry * sin_alpha; gdip_cairo_move_to (graphics, sx, sy, FALSE, antialiasing); } gdip_cairo_curve_to (graphics, cx + rx * (cos_alpha - bcp * sin_alpha), cy + ry * (sin_alpha + bcp * cos_alpha), cx + rx * (cos_beta + bcp * sin_beta), cy + ry * (sin_beta - bcp * cos_beta), cx + rx * cos_beta, cy + ry * sin_beta, FALSE, antialiasing); } static void make_arcs (GpGraphics *graphics, float x, float y, float width, float height, float startAngle, float sweepAngle, BOOL convert_units, BOOL antialiasing) { int i; float drawn = 0; float endAngle; BOOL enough = FALSE; /* if required deal, once and for all, with unit conversions */ if (convert_units && !OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); width = gdip_unitx_convgr (graphics, width); height = gdip_unity_convgr (graphics, height); } if (fabs (sweepAngle) >= 360) { /* FALSE -> units are already converted */ make_ellipse (graphics, x, y, width, height, FALSE, antialiasing); return; } endAngle = startAngle + sweepAngle; /* if we end before the start then reverse positions (to keep increment positive) */ if (endAngle < startAngle) { double temp = endAngle; endAngle = startAngle; startAngle = temp; } /* i is the number of sub-arcs drawn, each sub-arc can be at most 90 degrees.*/ /* there can be no more then 4 subarcs, ie. 90 + 90 + 90 + (something less than 90) */ for (i = 0; i < 4; i++) { float current = startAngle + drawn; float additional; if (enough) return; additional = endAngle - current; /* otherwise, add the remainder */ if (additional > 90) { additional = 90.0; } else { /* a near zero value will introduce bad artefact in the drawing (#78999) */ if (gdip_near_zero (additional)) return; enough = TRUE; } make_arc (graphics, (i == 0), /* only move to the starting pt in the 1st iteration */ x, y, width, height, /* bounding rectangle */ current, current + additional, antialiasing); drawn += additional; } } GpStatus cairo_DrawArc (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { /* We use graphics->copy_of_ctm matrix for path creation. We should * have it set already. */ make_arcs (graphics, x, y, width, height, startAngle, sweepAngle, TRUE, TRUE); return stroke_graphics_with_pen (graphics, pen); } GpStatus cairo_DrawBeziers (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) { int i, j, k; /* We use graphics->copy_of_ctm matrix for path creation. We should have it set already. */ gdip_cairo_move_to (graphics, points [0].X, points [0].Y, TRUE, TRUE); for (i = 1, j = 2, k = 3; k < count; i += 3, j += 3, k += 3) { gdip_cairo_curve_to (graphics, points [i].X, points [i].Y, points [j].X, points [j].Y, points [k].X, points [k].Y, TRUE, TRUE); } return stroke_graphics_with_pen (graphics, pen); } static void make_curve (GpGraphics *graphics, GDIPCONST GpPointF *points, GpPointF *tangents, int offset, int length, _CurveType type, BOOL antialiasing) { int i; gdip_cairo_move_to (graphics, points [offset].X, points [offset].Y, FALSE, antialiasing); for (i = offset; i < offset + length; i++) { int j = i + 1; double x1 = points [i].X + tangents [i].X; double y1 = points [i].Y + tangents [i].Y; double x2 = points [j].X - tangents [j].X; double y2 = points [j].Y - tangents [j].Y; double x3 = points [j].X; double y3 = points [j].Y; gdip_cairo_curve_to (graphics, x1, y1, x2, y2, x3, y3, FALSE, antialiasing); } if (type == CURVE_CLOSE) { /* complete (close) the curve using the first point */ double x1 = points [i].X + tangents [i].X; double y1 = points [i].Y + tangents [i].Y; double x2 = points [0].X - tangents [0].X; double y2 = points [0].Y - tangents [0].Y; double x3 = points [0].X; double y3 = points [0].Y; gdip_cairo_curve_to (graphics, x1, y1, x2, y2, x3, y3, FALSE, antialiasing); cairo_close_path (graphics->ct); } } GpStatus cairo_DrawClosedCurve2 (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count, float tension) { GpStatus status; GpPointF *tangents = gdip_closed_curve_tangents (CURVE_MIN_TERMS, points, count, tension); if (!tangents) return OutOfMemory; make_curve (graphics, points, tangents, 0, count - 1, CURVE_CLOSE, TRUE); status = stroke_graphics_with_pen (graphics, pen); GdipFree (tangents); return status; } GpStatus cairo_FillClosedCurve2 (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, float tension, GpFillMode fillMode) { GpStatus status; GpPointF *tangents = gdip_closed_curve_tangents (CURVE_MIN_TERMS, points, count, tension); if (!tangents) return OutOfMemory; make_curve (graphics, points, tangents, 0, count - 1, CURVE_CLOSE, FALSE); cairo_set_fill_rule (graphics->ct, gdip_convert_fill_mode (fillMode)); status = fill_graphics_with_brush (graphics, brush, FALSE); GdipFree (tangents); return status; } GpStatus cairo_DrawCurve3 (GpGraphics *graphics, GpPen* pen, GDIPCONST GpPointF *points, int count, int offset, int numOfSegments, float tension) { GpStatus status; GpPointF *tangents = gdip_open_curve_tangents (CURVE_MIN_TERMS, points, count, tension); if (!tangents) return OutOfMemory; make_curve (graphics, points, tangents, offset, numOfSegments, CURVE_OPEN, TRUE); status = stroke_graphics_with_pen (graphics, pen); GdipFree (tangents); return status; } /* * Ellipses */ GpStatus cairo_DrawEllipse (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height) { /* We use graphics->copy_of_ctm matrix for path creation. We should have it set already. */ make_ellipse (graphics, x, y, width, height, TRUE, TRUE); return stroke_graphics_with_pen (graphics, pen); } GpStatus cairo_FillEllipse (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height) { /* We use graphics->copy_of_ctm matrix for path creation. We should have it set already. */ make_ellipse (graphics, x, y, width, height, TRUE, FALSE); return fill_graphics_with_brush (graphics, brush, FALSE); } GpStatus cairo_DrawLines (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) { int i; float last_x, last_y, prev_x, prev_y; GpStatus ret; /* We use graphics->copy_of_ctm matrix for path creation. We should have it set already. */ gdip_cairo_move_to (graphics, points [0].X, points [0].Y, TRUE, TRUE); for (i = 1; i < count; i++) { gdip_cairo_line_to (graphics, points [i].X, points [i].Y, TRUE, TRUE); prev_x = points [i - 1].X; prev_y = points [i - 1].Y; last_x = points [i].X; last_y = points [i].Y; } ret = stroke_graphics_with_pen (graphics, pen); if (count > 1) { gdip_pen_draw_custom_start_cap (graphics, pen, points [0].X, points [0].Y, points [1].X, points [1].Y); gdip_pen_draw_custom_end_cap (graphics, pen, last_x, last_y, prev_x, prev_y); } return ret; } GpStatus gdip_plot_path (GpGraphics *graphics, GpPath *path, BOOL antialiasing) { int length = path->count; int i, idx = 0; for (i = 0; i < length; ++i) { GpPointF pt = path->points[i]; BYTE type = path->types[i]; GpPointF pts [3]; /* mask the bits so that we get only the type value not the other flags */ switch (type & PathPointTypePathTypeMask) { case PathPointTypeStart: gdip_cairo_move_to (graphics, pt.X, pt.Y, TRUE, antialiasing); break; case PathPointTypeLine: gdip_cairo_line_to (graphics, pt.X, pt.Y, TRUE, antialiasing); break; case PathPointTypeBezier: /* make sure we only add at most 3 points to pts */ if (idx < 3) { pts [idx] = pt; idx ++; } /* once we've added 3 pts, we can draw the curve */ if (idx == 3) { gdip_cairo_curve_to (graphics, pts[0].X, pts[0].Y, pts[1].X, pts[1].Y, pts[2].X, pts[2].Y, TRUE, antialiasing); idx = 0; } break; default: g_warning ("Unknown PathPointType %d", type); return NotImplemented; } /* close the subpath */ if (type & PathPointTypeCloseSubpath) cairo_close_path (graphics->ct); } return Ok; } GpStatus cairo_DrawPath (GpGraphics *graphics, GpPen *pen, GpPath *path) { GpStatus ret; int count; GpPointF *points; /* We use graphics->copy_of_ctm matrix for path creation. We should have it set already. */ GpStatus status = gdip_plot_path (graphics, path, TRUE); if (status != Ok) return status; ret = stroke_graphics_with_pen (graphics, pen); /* Draw any custom pen end caps */ status = GdipGetPointCount (path, &count); /* To know the angle of the end cap, we need the penultimate point. Unfortunately there's no way of getting it without getting all the points :-( */ if (status == Ok && count > 1) { points = gdip_calloc (count, sizeof(GpPointF)); if (points == NULL) { return OutOfMemory; } status = GdipGetPathPoints (path, points, count); if (status == Ok) { gdip_pen_draw_custom_start_cap (graphics, pen, points [0].X, points [0].Y, points [1].X, points [1].Y); gdip_pen_draw_custom_end_cap (graphics, pen, points [count - 1].X, points [count - 1].Y, points [count - 2].X, points [count - 2].Y); } GdipFree (points); } return ret; } /* FIXME - this doesn't match MS behaviour when we use really complex paths with internal intersections */ GpStatus cairo_FillPath (GpGraphics *graphics, GpBrush *brush, GpPath *path) { /* We use graphics->copy_of_ctm matrix for path creation. We should have it set already. */ GpStatus status = gdip_plot_path (graphics, path, TRUE); if (status != Ok) return status; cairo_set_fill_rule (graphics->ct, gdip_convert_fill_mode (path->fill_mode)); // filled paths includes the stroke return fill_graphics_with_brush (graphics, brush, TRUE); } static void make_pie (GpGraphics *graphics, float x, float y, float width, float height, float startAngle, float sweepAngle, BOOL antialiasing) { float rx, ry, cx, cy, alpha; double sin_alpha, cos_alpha; /* if required deal, once and for all, with unit conversions */ if (!OPTIMIZE_CONVERSION (graphics)) { x = gdip_unitx_convgr (graphics, x); y = gdip_unity_convgr (graphics, y); width = gdip_unitx_convgr (graphics, width); height = gdip_unity_convgr (graphics, height); } rx = width / 2; ry = height / 2; /* center */ cx = x + rx; cy = y + ry; /* angles in radians */ alpha = startAngle * PI / 180; /* adjust angle for ellipses */ alpha = atan2 (rx * sin (alpha), ry * cos (alpha)); sin_alpha = sin (alpha); cos_alpha = cos (alpha); /* if required deal, once and for all, with antialiasing */ if (antialiasing && !gdip_is_scaled (graphics)) { cx += graphics->aa_offset_x; cy += graphics->aa_offset_y; } /* draw pie edge */ if (fabs (sweepAngle) >= 360) gdip_cairo_move_to (graphics, cx + rx * cos_alpha, cy + ry * sin_alpha, FALSE, FALSE); else { gdip_cairo_move_to (graphics, cx, cy, FALSE, FALSE); gdip_cairo_line_to (graphics, cx + rx * cos_alpha, cy + ry * sin_alpha, FALSE, FALSE); } /* draw the arcs */ make_arcs (graphics, x, y, width, height, startAngle, sweepAngle, FALSE, antialiasing); /* draws line back to center */ if (fabs (sweepAngle) >= 360) gdip_cairo_move_to (graphics, cx, cy, FALSE, FALSE); else gdip_cairo_line_to (graphics, cx, cy, FALSE, FALSE); } GpStatus cairo_DrawPie (GpGraphics *graphics, GpPen *pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { make_pie (graphics, x, y, width, height, startAngle, sweepAngle, TRUE); return stroke_graphics_with_pen (graphics, pen); } GpStatus cairo_FillPie (GpGraphics *graphics, GpBrush *brush, float x, float y, float width, float height, float startAngle, float sweepAngle) { make_pie (graphics, x, y, width, height, startAngle, sweepAngle, FALSE); return fill_graphics_with_brush (graphics, brush, FALSE); } /* * Polygons */ static void make_polygon (GpGraphics *graphics, GDIPCONST GpPointF *points, int count, BOOL antialiasing) { int i; gdip_cairo_move_to (graphics, points [0].X, points [0].Y, TRUE, antialiasing); for (i = 0; i < count; i++) { gdip_cairo_line_to (graphics, points [i].X, points [i].Y, TRUE, antialiasing); } /* * Draw a line from the last point back to the first point if * they're not the same */ if (points [0].X != points [count-1].X && points [0].Y != points [count-1].Y) { gdip_cairo_line_to (graphics, points [0].X, points [0].Y, TRUE, antialiasing); } cairo_close_path (graphics->ct); } GpStatus cairo_DrawPolygon (GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, int count) { make_polygon (graphics, points, count, TRUE); return stroke_graphics_with_pen (graphics, pen); } GpStatus cairo_FillPolygon (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, int count, FillMode fillMode) { make_polygon (graphics, points, count, FALSE); cairo_set_fill_rule (graphics->ct, gdip_convert_fill_mode (fillMode)); return fill_graphics_with_brush (graphics, brush, FALSE); } /* * Rectangle(s) */ GpStatus cairo_DrawRectangles (GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, int count) { BOOL draw = FALSE; BOOL adjust = gdip_cairo_pen_width_needs_adjustment (pen); int i; for (i = 0; i < count; i++) { float x = rects [i].X; float y = rects [i].Y; float w = rects [i].Width; float h = rects [i].Height; /* don't draw/fill rectangles with negative width/height (bug #77129) */ if ((w < 0) || (h < 0)) continue; /* wide pen position can be different between cairo and gdi+ */ if (adjust) { x -= 1.0f; y -= 1.0f; } gdip_cairo_rectangle (graphics, x, y, w, h, TRUE); draw = TRUE; } if (!draw) return Ok; return stroke_graphics_with_pen (graphics, pen); } GpStatus cairo_FillRectangles (GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, int count) { BOOL draw = FALSE; int i; /* We use graphics->copy_of_ctm matrix for path creation. We * should have it set already. */ for (i = 0; i < count; i++) { /* don't draw/fill rectangles with negative width/height (bug #77129) */ if ((rects [i].Width < 0) || (rects [i].Height < 0)) continue; gdip_cairo_rectangle (graphics, rects [i].X, rects [i].Y, rects [i].Width, rects [i].Height, FALSE); draw = TRUE; } /* shortcut if no rectangles were drawn into the graphics */ if (!draw) return Ok; return fill_graphics_with_brush (graphics, brush, FALSE); } /* * Regions */ GpStatus cairo_FillRegion (GpGraphics *graphics, GpBrush *brush, GpRegion *region) { /* if this is a region with a complex path */ if (region->type == RegionTypePath) { GpStatus status; cairo_surface_t *mask_surface; /* (optimization) if if the path is empty, return immediately */ if (!region->tree) return Ok; /* (optimization) if there is only one path, then we do not need the bitmap */ if (region->tree->path) { /* if the path is empty, return OK */ if (region->tree->path->count == 0) return Ok; /* else fill the single path */ return cairo_FillPath (graphics, brush, region->tree->path); } gdip_region_bitmap_ensure (region); if (!region->bitmap) return OutOfMemory; mask_surface = gdip_region_bitmap_to_cairo_surface (region->bitmap); cairo_save (graphics->ct); /* We do brush setup just before filling. */ gdip_brush_setup (graphics, brush); cairo_close_path (graphics->ct); cairo_mask_surface (graphics->ct, mask_surface, region->bitmap->X, region->bitmap->Y); cairo_fill (graphics->ct); status = gdip_get_status (cairo_status (graphics->ct)); cairo_restore (graphics->ct); cairo_surface_destroy (mask_surface); return status; } /* if there's no rectangles, we can return directly */ if (!region->rects || (region->cnt == 0)) return Ok; return cairo_FillRectangles (graphics, brush, region->rects, region->cnt); } /* * */ GpStatus cairo_GraphicsClear (GpGraphics *graphics, ARGB color) { double blue = color & 0xff; double green = (color >> 8) & 0xff; double red = (color >> 16) & 0xff; double alpha = (color >> 24); /* Save the existing color/alpha/pattern settings */ cairo_save (graphics->ct); cairo_set_source_rgba (graphics->ct, red / 255, green / 255, blue / 255, alpha / 255); cairo_set_operator (graphics->ct, CAIRO_OPERATOR_SOURCE); cairo_paint (graphics->ct); /* Restore the color/alpha/pattern settings */ cairo_restore (graphics->ct); return gdip_get_status (cairo_status (graphics->ct)); } GpStatus cairo_SetCompositingMode (GpGraphics *graphics, CompositingMode compositingMode) { switch (compositingMode) { case CompositingModeSourceOver: cairo_set_operator (graphics->ct, CAIRO_OPERATOR_OVER); break; case CompositingModeSourceCopy: cairo_set_operator (graphics->ct, CAIRO_OPERATOR_SOURCE); break; } return Ok; } GpStatus cairo_SetSmoothingMode (GpGraphics *graphics, SmoothingMode mode) { switch (mode) { case SmoothingModeAntiAlias: case SmoothingModeHighQuality: cairo_set_antialias (graphics->ct, CAIRO_ANTIALIAS_DEFAULT); graphics->aa_offset_x = 0.5; graphics->aa_offset_y = 0.5; break; case SmoothingModeNone: case SmoothingModeDefault: case SmoothingModeHighSpeed: default: cairo_set_antialias (graphics->ct, CAIRO_ANTIALIAS_NONE); graphics->aa_offset_x = CAIRO_AA_OFFSET_X; graphics->aa_offset_y = CAIRO_AA_OFFSET_Y; break; } return Ok; } /* * Clipping */ /* Since cairo does autoclipping and it hides the clipping rectangles from the API, the best thing for now is keep track of what the user wants and let Cairo do its autoclipping */ GpStatus cairo_SetGraphicsClip (GpGraphics *graphics) { GpRegion *work; GpRectF* rect; int i; cairo_reset_clip (graphics->ct); if (gdip_is_InfiniteRegion (graphics->clip)) return Ok; if (gdip_is_matrix_empty (graphics->clip_matrix)) { work = graphics->clip; } else { GdipCloneRegion (graphics->clip, &work); GdipTransformRegion (work, graphics->clip_matrix); } switch (work->type) { case RegionTypeRect: for (i = 0, rect = work->rects; i < work->cnt; i++, rect++) { gdip_cairo_rectangle (graphics, rect->X, rect->Y, rect->Width, rect->Height, FALSE); } break; case RegionTypePath: if (work->tree && work->tree->path) gdip_plot_path (graphics, work->tree->path, FALSE); else { UINT count; GpMatrix matrix; cairo_matrix_init_identity (&matrix); /* I admit that's a (not so cute) hack - anyone with a better idea ? */ if ((GdipGetRegionScansCount (work, &count, &matrix) == Ok) && (count > 0)) { GpRectF *rects = (GpRectF*) GdipAlloc (count * sizeof (GpRectF)); if (rects) { INT countTemp; GdipGetRegionScans (work, rects, &countTemp, &matrix); for (i = 0, rect = rects; i < countTemp; i++, rect++) { gdip_cairo_rectangle (graphics, rect->X, rect->Y, rect->Width, rect->Height, FALSE); } GdipFree (rects); } } } break; default: g_warning ("Unknown region type %d", work->type); break; } cairo_clip (graphics->ct); /* destroy the clone, if one was needed */ if (work != graphics->clip) GdipDeleteRegion (work); return Ok; } GpStatus cairo_ResetClip (GpGraphics *graphics) { cairo_reset_clip (graphics->ct); return gdip_get_status (cairo_status (graphics->ct)); } /* * World Transforms */ GpStatus cairo_ResetWorldTransform (GpGraphics *graphics) { gdip_cairo_set_matrix (graphics, graphics->copy_of_ctm); cairo_reset_clip (graphics->ct); cairo_SetGraphicsClip (graphics); return gdip_get_status (cairo_status (graphics->ct)); } GpStatus cairo_SetWorldTransform (GpGraphics *graphics, GpMatrix *matrix) { gdip_cairo_set_matrix (graphics, matrix); cairo_SetGraphicsClip (graphics); return gdip_get_status (cairo_status (graphics->ct)); } libgdiplus-6.0.4+dfsg/src/image-private.h0000644000175000017500000000423112377405421021015 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __IMAGE_PRIVATE_H__ #define __IMAGE_PRIVATE_H__ #include "gdiplus-private.h" #include "codecs-private.h" typedef enum { BMP, TIF, GIF, PNG, JPEG, EXIF, WMF, EMF, ICON, MEMBMP, INVALID } ImageFormat; int gdip_get_pixel_format_depth (PixelFormat pixfmt) GDIP_INTERNAL; int gdip_get_pixel_format_components (PixelFormat pixfmt) GDIP_INTERNAL; int gdip_get_pixel_format_bpp (PixelFormat pixfmt) GDIP_INTERNAL; BOOL gdip_is_an_indexed_pixelformat (PixelFormat pixfmt) GDIP_INTERNAL; void gdip_image_init (GpImage *image) GDIP_INTERNAL; #include "image.h" #endif libgdiplus-6.0.4+dfsg/src/gdipstructs.h0000644000175000017500000000471313542674535020654 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __GDIPSTRUCTS_H__ #define __GDIPSTRUCTS_H__ #include "win32structs.h" #define GDIPCONST const /* public structures defined by GDI+ (i.e. you can safely access their members) */ typedef struct { int First; int Length; } CharacterRange; typedef struct { ARGB Argb; } Color; typedef struct { Color oldColor; Color newColor; } ColorMap; typedef struct { float m[5][5]; } ColorMatrix; typedef struct { int X, Y; } Point, GpPoint; typedef struct { float X, Y; } PointF, GpPointF; typedef struct { int Count; PointF *Points; BYTE *Types; } PathData, GpPathData; typedef struct { int X, Y, Width, Height; } Rect, GpRect; typedef struct { float X, Y, Width, Height; } RectF, GpRectF; /* Callbacks */ typedef BOOL (*ImageAbort) (void *); typedef ImageAbort DrawImageAbort; typedef ImageAbort GetThumbnailImageAbort; typedef BOOL (*EnumerateMetafileProc) (EmfPlusRecordType, UINT, UINT, const BYTE*, VOID*); #endif libgdiplus-6.0.4+dfsg/src/fontcollection-private.h0000644000175000017500000000361113542672033022756 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __FONTCOLLECTION_PRIVATE_H__ #define __FONTCOLLECTION_PRIVATE_H__ #include "gdiplus-private.h" struct _FontCollection { FcFontSet* fontset; FcConfig* config; /* Only for private collections */ #ifdef USE_PANGO_RENDERING PangoFontMap* pango_font_map; #endif }; #include "fontcollection.h" #endif libgdiplus-6.0.4+dfsg/src/text-cairo-private.h0000644000175000017500000000675213542674535022035 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __TEXT_CAIRO_PRIVATE_H__ #define __TEXT_CAIRO_PRIVATE_H__ #include "gdiplus-private.h" #include "graphics-private.h" #include "stringformat-private.h" /* Flags and Support structure for MeasureOrDrawString */ #define STRING_DETAIL_TAB (1<<0) #define STRING_DETAIL_LF (1<<1) #define STRING_DETAIL_HOTKEY (1<<2) #define STRING_DETAIL_BREAK (1<<3) #define STRING_DETAIL_HIDDEN (1<<4) #define STRING_DETAIL_LINESTART (1<<5) #define text_DrawString cairo_DrawString #define text_MeasureString cairo_MeasureString #define text_MeasureCharacterRanges cairo_MeasureCharacterRanges /* cache for computed information during MeasureString that can be reused during DrawString */ typedef struct { BOOL has_hotkeys; int align_horz; int align_vert; int line_height; int max_y; int descent; } GpDrawTextData; typedef struct { unsigned long Flags; unsigned long Linefeeds; float PosX; /* We call it X, even though it might become Y for vertical drawing */ float PosY; /* We call it Y, even though it might become X for vertical drawing */ float Width; /* Width of the character; height is defined in font structure */ int LineLen; /* If LineStart how many chars is the line long? */ } GpStringDetailStruct; GpStatus cairo_DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, GpBrush *brush) GDIP_INTERNAL; GpStatus cairo_MeasureString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, RectF *boundingBox, INT *codepointsFitted, INT *linesFilled) GDIP_INTERNAL; GpStatus cairo_MeasureCharacterRanges (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST GpRectF *layout, GDIPCONST GpStringFormat *format, INT regionCount, GpRegion **regions) GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/gdipenums.h0000644000175000017500000007133013542674535020273 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __GDIPENUMS_H__ #define __GDIPENUMS_H__ #include "win32structs.h" typedef UINT GraphicsContainer; typedef UINT GraphicsState; typedef enum { ColorAdjustTypeDefault, ColorAdjustTypeBitmap, ColorAdjustTypeBrush, ColorAdjustTypePen, ColorAdjustTypeText, ColorAdjustTypeCount, ColorAdjustTypeAny } ColorAdjustType; typedef enum { ColorChannelFlagsC = 0, ColorChannelFlagsM, ColorChannelFlagsY, ColorChannelFlagsK, ColorChannelFlagsLast } ColorChannelFlags; typedef enum { ColorMatrixFlagsDefault = 0, ColorMatrixFlagsSkipGrays = 1, ColorMatrixFlagsAltGray = 2 } ColorMatrixFlags; typedef enum { CombineModeReplace = 0, CombineModeIntersect = 1, CombineModeUnion = 2, CombineModeXor = 3, CombineModeExclude = 4, CombineModeComplement = 5 } CombineMode; typedef enum { CompositingModeSourceOver, CompositingModeSourceCopy } CompositingMode; typedef enum { CoordinateSpaceWorld, CoordinateSpacePage, CoordinateSpaceDevice } CoordinateSpace, GpCoordinateSpace; typedef enum { CustomLineCapTypeDefault = 0, CustomLineCapTypeAdjustableArrow = 1 } CustomLineCapType; typedef enum { EncoderParameterValueTypeByte = 1, EncoderParameterValueTypeASCII = 2, EncoderParameterValueTypeShort = 3, EncoderParameterValueTypeLong = 4, EncoderParameterValueTypeRational = 5, EncoderParameterValueTypeLongRange = 6, EncoderParameterValueTypeUndefined = 7, EncoderParameterValueTypeRationalRange = 8 } EncoderParameterValueType; typedef enum { EncoderValueColorTypeCMYK = 0, EncoderValueColorTypeYCCK = 1, EncoderValueCompressionLZW = 2, EncoderValueCompressionCCITT3 = 3, EncoderValueCompressionCCITT4 = 4, EncoderValueCompressionRle = 5, EncoderValueCompressionNone = 6, EncoderValueScanMethodInterlaced = 7, EncoderValueScanMethodNonInterlaced = 8, EncoderValueVersionGif87 = 9, EncoderValueVersionGif89 = 10, EncoderValueRenderProgressive = 11, EncoderValueRenderNonProgressive = 12, EncoderValueTransformRotate90 = 13, EncoderValueTransformRotate180 = 14, EncoderValueTransformRotate270 = 15, EncoderValueTransformFlipHorizontal = 16, EncoderValueTransformFlipVertical = 17, EncoderValueMultiFrame = 18, EncoderValueLastFrame = 19, EncoderValueFlush = 20, EncoderValueFrameDimensionTime = 21, EncoderValueFrameDimensionResolution = 22, EncoderValueFrameDimensionPage = 23, EncoderValueColorTypeGray = 24, EncoderValueColorTypeRGB = 25 } EncoderValue; typedef enum { FontStyleRegular = 0, FontStyleBold = 1, FontStyleItalic = 2, FontStyleUnderline = 4, FontStyleStrikeout = 8 } FontStyle; typedef enum { BrushTypeSolidColor = 0, /* Solid Brush */ BrushTypeHatchFill = 1, /* Hatch Brush */ BrushTypeTextureFill = 2, /* Texture Brush */ BrushTypePathGradient = 3, /* PathGradient Brush */ BrushTypeLinearGradient = 4 /* LinearGradient Brush */ } GpBrushType, BrushType; typedef enum { DashCapFlat = 0, DashCapRound = 2, DashCapTriangle = 3 } GpDashCap, DashCap; typedef enum { DashStyleSolid = 0, /* solid line */ DashStyleDash = 1, /* dashed line */ DashStyleDot = 2, /* dotted line */ DashStyleDashDot = 3, /* alt. dash-dot */ DashStyleDashDotDot = 4, /* alt. dash-dot-dot */ DashStyleCustom = 5 /* user-defined */ } GpDashStyle, DashStyle; typedef enum { FillModeAlternate, FillModeWinding } GpFillMode, FillMode; typedef enum { FlushIntentionFlush = 0, FlushIntentionSync = 1 } GpFlushIntention, FlushIntention; typedef enum { LineCapFlat = 0, LineCapSquare = 1, LineCapRound = 2, LineCapTriangle = 3, LineCapNoAnchor = 0x10, LineCapSquareAnchor = 0x11, LineCapRoundAnchor = 0x12, LineCapDiamondAnchor = 0x13, LineCapArrowAnchor = 0x14, LineCapCustom = 0xff, LineCapAnchorMask = 0xf0 } GpLineCap, LineCap; typedef enum { LineJoinMiter = 0, /* sharp corner */ LineJoinBevel = 1, /* round corner */ LineJoinRound = 2, /* circular, smooth, circular arc */ LineJoinMiterClipped = 3 /* miter, sharp or beveled corner */ } GpLineJoin, LineJoin; typedef enum { MatrixOrderPrepend = 0, MatrixOrderAppend = 1 } GpMatrixOrder, MatrixOrder; typedef enum { PenAlignmentCenter = 0, PenAlignmentInset = 1 } GpPenAlignment, PenAlignment; typedef enum { HotkeyPrefixNone = 0, HotkeyPrefixShow = 1, HotkeyPrefixHide = 2 } HotkeyPrefix; typedef enum { ImageTypeUnknown, ImageTypeBitmap, ImageTypeMetafile } ImageType; typedef enum { QualityModeInvalid = -1, QualityModeDefault = 0, QualityModeLow = 1, QualityModeHigh = 2 } QualityMode; typedef enum { CompositingQualityInvalid = QualityModeInvalid, CompositingQualityDefault = QualityModeDefault, CompositingQualityHighSpeed = QualityModeLow, CompositingQualityHighQuality = QualityModeHigh, CompositingQualityGammaCorrected, CompositingQualityAssumeLinear } CompositingQuality; typedef enum { HatchStyleHorizontal = 0, HatchStyleVertical = 1, HatchStyleForwardDiagonal = 2, HatchStyleBackwardDiagonal = 3, HatchStyleCross = 4, HatchStyleDiagonalCross = 5, HatchStyle05Percent = 6, HatchStyle10Percent = 7, HatchStyle20Percent = 8, HatchStyle25Percent = 9, HatchStyle30Percent = 10, HatchStyle40Percent = 11, HatchStyle50Percent = 12, HatchStyle60Percent = 13, HatchStyle70Percent = 14, HatchStyle75Percent = 15, HatchStyle80Percent = 16, HatchStyle90Percent = 17, HatchStyleLightDownwardDiagonal = 18, HatchStyleLightUpwardDiagonal = 19, HatchStyleDarkDownwardDiagonal = 20, HatchStyleDarkUpwardDiagonal = 21, HatchStyleWideDownwardDiagonal = 22, HatchStyleWideUpwardDiagonal = 23, HatchStyleLightVertical = 24, HatchStyleLightHorizontal = 25, HatchStyleNarrowVertical = 26, HatchStyleNarrowHorizontal = 27, HatchStyleDarkVertical = 28, HatchStyleDarkHorizontal = 29, HatchStyleDashedDownwardDiagonal = 30, HatchStyleDashedUpwardDiagonal = 31, HatchStyleDashedHorizontal = 32, HatchStyleDashedVertical = 33, HatchStyleSmallConfetti = 34, HatchStyleLargeConfetti = 35, HatchStyleZigZag = 36, HatchStyleWave = 37, HatchStyleDiagonalBrick = 38, HatchStyleHorizontalBrick = 39, HatchStyleWeave = 40, HatchStylePlaid = 41, HatchStyleDivot = 42, HatchStyleDottedGrid = 43, HatchStyleDottedDiamond = 44, HatchStyleShingle = 45, HatchStyleTrellis = 46, HatchStyleSphere = 47, HatchStyleSmallGrid = 48, HatchStyleSmallCheckerBoard = 49, HatchStyleLargeCheckerBoard = 50, HatchStyleOutlinedDiamond = 51, HatchStyleSolidDiamond = 52, HatchStyleLargeGrid = HatchStyleCross, HatchStyleMin = HatchStyleHorizontal, HatchStyleMax = HatchStyleSolidDiamond } GpHatchStyle, HatchStyle; typedef enum { InterpolationModeInvalid = QualityModeInvalid, InterpolationModeDefault = QualityModeDefault, InterpolationModeLowQuality = QualityModeLow, InterpolationModeHighQuality = QualityModeHigh, InterpolationModeBilinear, InterpolationModeBicubic, InterpolationModeNearestNeighbor, InterpolationModeHighQualityBilinear, InterpolationModeHighQualityBicubic } InterpolationMode; typedef enum { PathPointTypeStart = 0x00, PathPointTypeLine = 0x01, PathPointTypeBezier = 0x03, PathPointTypePathTypeMask = 0x07, PathPointTypeDashMode = 0x10, PathPointTypePathMarker = 0x20, PathPointTypeCloseSubpath = 0x80, PathPointTypeBezier3 = 0x03 } PathPointType; typedef enum { PenTypeSolidColor = BrushTypeSolidColor, PenTypeHatchFill = BrushTypeHatchFill, PenTypeTextureFill = BrushTypeTextureFill, PenTypePathGradient = BrushTypePathGradient, PenTypeLinearGradient = BrushTypeLinearGradient, PenTypeUnknown = -1 } GpPenType, PenType; typedef enum { PixelOffsetModeInvalid = QualityModeInvalid, PixelOffsetModeDefault = QualityModeDefault, PixelOffsetModeHighSpeed = QualityModeLow, PixelOffsetModeHighQuality = QualityModeHigh, PixelOffsetModeNone, PixelOffsetModeHalf } PixelOffsetMode; typedef enum { SmoothingModeInvalid = QualityModeInvalid, SmoothingModeDefault = QualityModeDefault, SmoothingModeHighSpeed = QualityModeLow, SmoothingModeHighQuality = QualityModeHigh, SmoothingModeNone, SmoothingModeAntiAlias, #if (GDIPVER >= 0x0110) SmoothingModeAntiAlias8x4 = SmoothingModeAntiAlias, SmoothingModeAntiAlias8x8 #endif //(GDIPVER >= 0x0110) } SmoothingMode; typedef enum { Ok = 0, GenericError = 1, InvalidParameter = 2, OutOfMemory = 3, ObjectBusy = 4, InsufficientBuffer = 5, NotImplemented = 6, Win32Error = 7, WrongState = 8, Aborted = 9, FileNotFound = 10, ValueOverflow = 11, AccessDenied = 12, UnknownImageFormat = 13, FontFamilyNotFound = 14, FontStyleNotFound = 15, NotTrueTypeFont = 16, UnsupportedGdiplusVersion = 17, GdiplusNotInitialized = 18, PropertyNotFound = 19, PropertyNotSupported = 20 } GpStatus; typedef enum { StringAlignmentNear = 0, StringAlignmentCenter = 1, StringAlignmentFar = 2 } StringAlignment; typedef enum { StringDigitSubstituteUser = 0, StringDigitSubstituteNone = 1, StringDigitSubstituteNational = 2, StringDigitSubstituteTraditional = 3 } StringDigitSubstitute; typedef enum { StringFormatFlagsDirectionRightToLeft = 0x00000001, StringFormatFlagsDirectionVertical = 0x00000002, StringFormatFlagsNoFitBlackBox = 0x00000004, StringFormatFlagsDisplayFormatControl = 0x00000020, StringFormatFlagsNoFontFallback = 0x00000400, StringFormatFlagsMeasureTrailingSpaces = 0x00000800, StringFormatFlagsNoWrap = 0x00001000, StringFormatFlagsLineLimit = 0x00002000, StringFormatFlagsNoClip = 0x00004000 } StringFormatFlags; typedef enum { StringTrimmingNone = 0, StringTrimmingCharacter = 1, StringTrimmingWord = 2, StringTrimmingEllipsisCharacter = 3, StringTrimmingEllipsisWord = 4, StringTrimmingEllipsisPath = 5 } StringTrimming; typedef enum { TextRenderingHintSystemDefault = 0, TextRenderingHintSingleBitPerPixelGridFit, TextRenderingHintSingleBitPerPixel, TextRenderingHintAntiAliasGridFit, TextRenderingHintAntiAlias, TextRenderingHintClearTypeGridFit } TextRenderingHint; typedef enum { UnitWorld = 0, UnitDisplay = 1, UnitPixel = 2, UnitPoint = 3, UnitInch = 4, UnitDocument = 5, UnitMillimeter = 6, UnitCairoPoint = 7 } GpUnit, Unit; typedef enum { WarpModePerspective = 0, WarpModeBilinear = 1 } WarpMode; typedef enum { WrapModeTile = 0, WrapModeTileFlipX = 1, WrapModeTileFlipY = 2, WrapModeTileFlipXY = 3, WrapModeClamp = 4 } WrapMode, GpWrapMode; typedef enum { EmfTypeEmfOnly = MetafileTypeEmf, EmfTypeEmfPlusOnly = MetafileTypeEmfPlusOnly, EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual } EmfType; typedef enum { MetafileFrameUnitPixel = UnitPixel, MetafileFrameUnitPoint = UnitPoint, MetafileFrameUnitInch = UnitInch, MetafileFrameUnitDocument = UnitDocument, MetafileFrameUnitMillimeter = UnitMillimeter, MetafileFrameUnitGdi } MetafileFrameUnit; #define GDIP_EMFPLUS_RECORD_BASE 0x00004000 #define GDIP_WMF_RECORD_BASE 0x00010000 #define GDIP_WMF_RECORD_TO_EMFPLUS(n) ((n) | GDIP_WMF_RECORD_BASE) #define GDIP_EMFPLUS_RECORD_TO_WMF(n) ((n) & (~GDIP_WMF_RECORD_BASE)) #define GDIP_IS_WMF_RECORDTYPE(n) (((n) & GDIP_WMF_RECORD_BASE) != 0) typedef enum { WmfRecordTypeSetBkColor = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETBKCOLOR), WmfRecordTypeSetBkMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETBKMODE), WmfRecordTypeSetMapMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETMAPMODE), WmfRecordTypeSetROP2 = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETROP2), WmfRecordTypeSetRelAbs = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETRELABS), WmfRecordTypeSetPolyFillMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPOLYFILLMODE), WmfRecordTypeSetStretchBltMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETSTRETCHBLTMODE), WmfRecordTypeSetTextCharExtra = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTCHAREXTRA), WmfRecordTypeSetTextColor = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTCOLOR), WmfRecordTypeSetTextJustification = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTJUSTIFICATION), WmfRecordTypeSetWindowOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETWINDOWORG), WmfRecordTypeSetWindowExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETWINDOWEXT), WmfRecordTypeSetViewportOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETVIEWPORTORG), WmfRecordTypeSetViewportExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETVIEWPORTEXT), WmfRecordTypeOffsetWindowOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETWINDOWORG), WmfRecordTypeScaleWindowExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SCALEWINDOWEXT), WmfRecordTypeOffsetViewportOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETVIEWPORTORG), WmfRecordTypeScaleViewportExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SCALEVIEWPORTEXT), WmfRecordTypeLineTo = GDIP_WMF_RECORD_TO_EMFPLUS(META_LINETO), WmfRecordTypeMoveTo = GDIP_WMF_RECORD_TO_EMFPLUS(META_MOVETO), WmfRecordTypeExcludeClipRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXCLUDECLIPRECT), WmfRecordTypeIntersectClipRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_INTERSECTCLIPRECT), WmfRecordTypeArc = GDIP_WMF_RECORD_TO_EMFPLUS(META_ARC), WmfRecordTypeEllipse = GDIP_WMF_RECORD_TO_EMFPLUS(META_ELLIPSE), WmfRecordTypeFloodFill = GDIP_WMF_RECORD_TO_EMFPLUS(META_FLOODFILL), WmfRecordTypePie = GDIP_WMF_RECORD_TO_EMFPLUS(META_PIE), WmfRecordTypeRectangle = GDIP_WMF_RECORD_TO_EMFPLUS(META_RECTANGLE), WmfRecordTypeRoundRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_ROUNDRECT), WmfRecordTypePatBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_PATBLT), WmfRecordTypeSaveDC = GDIP_WMF_RECORD_TO_EMFPLUS(META_SAVEDC), WmfRecordTypeSetPixel = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPIXEL), WmfRecordTypeOffsetClipRgn = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETCLIPRGN), WmfRecordTypeTextOut = GDIP_WMF_RECORD_TO_EMFPLUS(META_TEXTOUT), WmfRecordTypeBitBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_BITBLT), WmfRecordTypeStretchBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_STRETCHBLT), WmfRecordTypePolygon = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYGON), WmfRecordTypePolyline = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYLINE), WmfRecordTypeEscape = GDIP_WMF_RECORD_TO_EMFPLUS(META_ESCAPE), WmfRecordTypeRestoreDC = GDIP_WMF_RECORD_TO_EMFPLUS(META_RESTOREDC), WmfRecordTypeFillRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_FILLREGION), WmfRecordTypeFrameRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_FRAMEREGION), WmfRecordTypeInvertRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_INVERTREGION), WmfRecordTypePaintRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_PAINTREGION), WmfRecordTypeSelectClipRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTCLIPREGION), WmfRecordTypeSelectObject = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTOBJECT), WmfRecordTypeSetTextAlign = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTALIGN), WmfRecordTypeDrawText = GDIP_WMF_RECORD_TO_EMFPLUS(0x062F), // META_DRAWTEXT WmfRecordTypeChord = GDIP_WMF_RECORD_TO_EMFPLUS(META_CHORD), WmfRecordTypeSetMapperFlags = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETMAPPERFLAGS), WmfRecordTypeExtTextOut = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXTTEXTOUT), WmfRecordTypeSetDIBToDev = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETDIBTODEV), WmfRecordTypeSelectPalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTPALETTE), WmfRecordTypeRealizePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_REALIZEPALETTE), WmfRecordTypeAnimatePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_ANIMATEPALETTE), WmfRecordTypeSetPalEntries = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPALENTRIES), WmfRecordTypePolyPolygon = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYPOLYGON), WmfRecordTypeResizePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_RESIZEPALETTE), WmfRecordTypeDIBBitBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBBITBLT), WmfRecordTypeDIBStretchBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBSTRETCHBLT), WmfRecordTypeDIBCreatePatternBrush = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBCREATEPATTERNBRUSH), WmfRecordTypeStretchDIB = GDIP_WMF_RECORD_TO_EMFPLUS(META_STRETCHDIB), WmfRecordTypeExtFloodFill = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXTFLOODFILL), WmfRecordTypeSetLayout = GDIP_WMF_RECORD_TO_EMFPLUS(0x0149), // META_SETLAYOUT WmfRecordTypeResetDC = GDIP_WMF_RECORD_TO_EMFPLUS(0x014C), // META_RESETDC WmfRecordTypeStartDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x014D), // META_STARTDOC WmfRecordTypeStartPage = GDIP_WMF_RECORD_TO_EMFPLUS(0x004F), // META_STARTPAGE WmfRecordTypeEndPage = GDIP_WMF_RECORD_TO_EMFPLUS(0x0050), // META_ENDPAGE WmfRecordTypeAbortDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x0052), // META_ABORTDOC WmfRecordTypeEndDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x005E), // META_ENDDOC WmfRecordTypeDeleteObject = GDIP_WMF_RECORD_TO_EMFPLUS(META_DELETEOBJECT), WmfRecordTypeCreatePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPALETTE), WmfRecordTypeCreateBrush = GDIP_WMF_RECORD_TO_EMFPLUS(0x00F8), // META_CREATEBRUSH WmfRecordTypeCreatePatternBrush = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPATTERNBRUSH), WmfRecordTypeCreatePenIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPENINDIRECT), WmfRecordTypeCreateFontIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEFONTINDIRECT), WmfRecordTypeCreateBrushIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEBRUSHINDIRECT), WmfRecordTypeCreateBitmapIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(0x02FD), // META_CREATEBITMAPINDIRECT WmfRecordTypeCreateBitmap = GDIP_WMF_RECORD_TO_EMFPLUS(0x06FE), // META_CREATEBITMAP WmfRecordTypeCreateRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEREGION), EmfRecordTypeHeader = EMR_HEADER, EmfRecordTypePolyBezier = EMR_POLYBEZIER, EmfRecordTypePolygon = EMR_POLYGON, EmfRecordTypePolyline = EMR_POLYLINE, EmfRecordTypePolyBezierTo = EMR_POLYBEZIERTO, EmfRecordTypePolyLineTo = EMR_POLYLINETO, EmfRecordTypePolyPolyline = EMR_POLYPOLYLINE, EmfRecordTypePolyPolygon = EMR_POLYPOLYGON, EmfRecordTypeSetWindowExtEx = EMR_SETWINDOWEXTEX, EmfRecordTypeSetWindowOrgEx = EMR_SETWINDOWORGEX, EmfRecordTypeSetViewportExtEx = EMR_SETVIEWPORTEXTEX, EmfRecordTypeSetViewportOrgEx = EMR_SETVIEWPORTORGEX, EmfRecordTypeSetBrushOrgEx = EMR_SETBRUSHORGEX, EmfRecordTypeEOF = EMR_EOF, EmfRecordTypeSetPixelV = EMR_SETPIXELV, EmfRecordTypeSetMapperFlags = EMR_SETMAPPERFLAGS, EmfRecordTypeSetMapMode = EMR_SETMAPMODE, EmfRecordTypeSetBkMode = EMR_SETBKMODE, EmfRecordTypeSetPolyFillMode = EMR_SETPOLYFILLMODE, EmfRecordTypeSetROP2 = EMR_SETROP2, EmfRecordTypeSetStretchBltMode = EMR_SETSTRETCHBLTMODE, EmfRecordTypeSetTextAlign = EMR_SETTEXTALIGN, EmfRecordTypeSetColorAdjustment = EMR_SETCOLORADJUSTMENT, EmfRecordTypeSetTextColor = EMR_SETTEXTCOLOR, EmfRecordTypeSetBkColor = EMR_SETBKCOLOR, EmfRecordTypeOffsetClipRgn = EMR_OFFSETCLIPRGN, EmfRecordTypeMoveToEx = EMR_MOVETOEX, EmfRecordTypeSetMetaRgn = EMR_SETMETARGN, EmfRecordTypeExcludeClipRect = EMR_EXCLUDECLIPRECT, EmfRecordTypeIntersectClipRect = EMR_INTERSECTCLIPRECT, EmfRecordTypeScaleViewportExtEx = EMR_SCALEVIEWPORTEXTEX, EmfRecordTypeScaleWindowExtEx = EMR_SCALEWINDOWEXTEX, EmfRecordTypeSaveDC = EMR_SAVEDC, EmfRecordTypeRestoreDC = EMR_RESTOREDC, EmfRecordTypeSetWorldTransform = EMR_SETWORLDTRANSFORM, EmfRecordTypeModifyWorldTransform = EMR_MODIFYWORLDTRANSFORM, EmfRecordTypeSelectObject = EMR_SELECTOBJECT, EmfRecordTypeCreatePen = EMR_CREATEPEN, EmfRecordTypeCreateBrushIndirect = EMR_CREATEBRUSHINDIRECT, EmfRecordTypeDeleteObject = EMR_DELETEOBJECT, EmfRecordTypeAngleArc = EMR_ANGLEARC, EmfRecordTypeEllipse = EMR_ELLIPSE, EmfRecordTypeRectangle = EMR_RECTANGLE, EmfRecordTypeRoundRect = EMR_ROUNDRECT, EmfRecordTypeArc = EMR_ARC, EmfRecordTypeChord = EMR_CHORD, EmfRecordTypePie = EMR_PIE, EmfRecordTypeSelectPalette = EMR_SELECTPALETTE, EmfRecordTypeCreatePalette = EMR_CREATEPALETTE, EmfRecordTypeSetPaletteEntries = EMR_SETPALETTEENTRIES, EmfRecordTypeResizePalette = EMR_RESIZEPALETTE, EmfRecordTypeRealizePalette = EMR_REALIZEPALETTE, EmfRecordTypeExtFloodFill = EMR_EXTFLOODFILL, EmfRecordTypeLineTo = EMR_LINETO, EmfRecordTypeArcTo = EMR_ARCTO, EmfRecordTypePolyDraw = EMR_POLYDRAW, EmfRecordTypeSetArcDirection = EMR_SETARCDIRECTION, EmfRecordTypeSetMiterLimit = EMR_SETMITERLIMIT, EmfRecordTypeBeginPath = EMR_BEGINPATH, EmfRecordTypeEndPath = EMR_ENDPATH, EmfRecordTypeCloseFigure = EMR_CLOSEFIGURE, EmfRecordTypeFillPath = EMR_FILLPATH, EmfRecordTypeStrokeAndFillPath = EMR_STROKEANDFILLPATH, EmfRecordTypeStrokePath = EMR_STROKEPATH, EmfRecordTypeFlattenPath = EMR_FLATTENPATH, EmfRecordTypeWidenPath = EMR_WIDENPATH, EmfRecordTypeSelectClipPath = EMR_SELECTCLIPPATH, EmfRecordTypeAbortPath = EMR_ABORTPATH, EmfRecordTypeReserved_069 = 69, // Not Used EmfRecordTypeGdiComment = EMR_GDICOMMENT, EmfRecordTypeFillRgn = EMR_FILLRGN, EmfRecordTypeFrameRgn = EMR_FRAMERGN, EmfRecordTypeInvertRgn = EMR_INVERTRGN, EmfRecordTypePaintRgn = EMR_PAINTRGN, EmfRecordTypeExtSelectClipRgn = EMR_EXTSELECTCLIPRGN, EmfRecordTypeBitBlt = EMR_BITBLT, EmfRecordTypeStretchBlt = EMR_STRETCHBLT, EmfRecordTypeMaskBlt = EMR_MASKBLT, EmfRecordTypePlgBlt = EMR_PLGBLT, EmfRecordTypeSetDIBitsToDevice = EMR_SETDIBITSTODEVICE, EmfRecordTypeStretchDIBits = EMR_STRETCHDIBITS, EmfRecordTypeExtCreateFontIndirect = EMR_EXTCREATEFONTINDIRECTW, EmfRecordTypeExtTextOutA = EMR_EXTTEXTOUTA, EmfRecordTypeExtTextOutW = EMR_EXTTEXTOUTW, EmfRecordTypePolyBezier16 = EMR_POLYBEZIER16, EmfRecordTypePolygon16 = EMR_POLYGON16, EmfRecordTypePolyline16 = EMR_POLYLINE16, EmfRecordTypePolyBezierTo16 = EMR_POLYBEZIERTO16, EmfRecordTypePolylineTo16 = EMR_POLYLINETO16, EmfRecordTypePolyPolyline16 = EMR_POLYPOLYLINE16, EmfRecordTypePolyPolygon16 = EMR_POLYPOLYGON16, EmfRecordTypePolyDraw16 = EMR_POLYDRAW16, EmfRecordTypeCreateMonoBrush = EMR_CREATEMONOBRUSH, EmfRecordTypeCreateDIBPatternBrushPt = EMR_CREATEDIBPATTERNBRUSHPT, EmfRecordTypeExtCreatePen = EMR_EXTCREATEPEN, EmfRecordTypePolyTextOutA = EMR_POLYTEXTOUTA, EmfRecordTypePolyTextOutW = EMR_POLYTEXTOUTW, EmfRecordTypeSetICMMode = 98, // EMR_SETICMMODE, EmfRecordTypeCreateColorSpace = 99, // EMR_CREATECOLORSPACE, EmfRecordTypeSetColorSpace = 100, // EMR_SETCOLORSPACE, EmfRecordTypeDeleteColorSpace = 101, // EMR_DELETECOLORSPACE, EmfRecordTypeGLSRecord = 102, // EMR_GLSRECORD, EmfRecordTypeGLSBoundedRecord = 103, // EMR_GLSBOUNDEDRECORD, EmfRecordTypePixelFormat = 104, // EMR_PIXELFORMAT, EmfRecordTypeDrawEscape = 105, // EMR_RESERVED_105, EmfRecordTypeExtEscape = 106, // EMR_RESERVED_106, EmfRecordTypeStartDoc = 107, // EMR_RESERVED_107, EmfRecordTypeSmallTextOut = 108, // EMR_RESERVED_108, EmfRecordTypeForceUFIMapping = 109, // EMR_RESERVED_109, EmfRecordTypeNamedEscape = 110, // EMR_RESERVED_110, EmfRecordTypeColorCorrectPalette = 111, // EMR_COLORCORRECTPALETTE, EmfRecordTypeSetICMProfileA = 112, // EMR_SETICMPROFILEA, EmfRecordTypeSetICMProfileW = 113, // EMR_SETICMPROFILEW, EmfRecordTypeAlphaBlend = 114, // EMR_ALPHABLEND, EmfRecordTypeSetLayout = 115, // EMR_SETLAYOUT, EmfRecordTypeTransparentBlt = 116, // EMR_TRANSPARENTBLT, EmfRecordTypeReserved_117 = 117, // Not Used EmfRecordTypeGradientFill = 118, // EMR_GRADIENTFILL, EmfRecordTypeSetLinkedUFIs = 119, // EMR_RESERVED_119, EmfRecordTypeSetTextJustification = 120, // EMR_RESERVED_120, EmfRecordTypeColorMatchToTargetW = 121, // EMR_COLORMATCHTOTARGETW, EmfRecordTypeCreateColorSpaceW = 122, // EMR_CREATECOLORSPACEW, EmfRecordTypeMax = 122, EmfRecordTypeMin = 1, // That is the END of the GDI EMF records. // Now we start the list of EMF+ records. We leave quite // a bit of room here for the addition of any new GDI // records that may be added later. EmfPlusRecordTypeInvalid = GDIP_EMFPLUS_RECORD_BASE, EmfPlusRecordTypeHeader, EmfPlusRecordTypeEndOfFile, EmfPlusRecordTypeComment, EmfPlusRecordTypeGetDC, EmfPlusRecordTypeMultiFormatStart, EmfPlusRecordTypeMultiFormatSection, EmfPlusRecordTypeMultiFormatEnd, // For all persistent objects EmfPlusRecordTypeObject, // Drawing Records EmfPlusRecordTypeClear, EmfPlusRecordTypeFillRects, EmfPlusRecordTypeDrawRects, EmfPlusRecordTypeFillPolygon, EmfPlusRecordTypeDrawLines, EmfPlusRecordTypeFillEllipse, EmfPlusRecordTypeDrawEllipse, EmfPlusRecordTypeFillPie, EmfPlusRecordTypeDrawPie, EmfPlusRecordTypeDrawArc, EmfPlusRecordTypeFillRegion, EmfPlusRecordTypeFillPath, EmfPlusRecordTypeDrawPath, EmfPlusRecordTypeFillClosedCurve, EmfPlusRecordTypeDrawClosedCurve, EmfPlusRecordTypeDrawCurve, EmfPlusRecordTypeDrawBeziers, EmfPlusRecordTypeDrawImage, EmfPlusRecordTypeDrawImagePoints, EmfPlusRecordTypeDrawString, // Graphics State Records EmfPlusRecordTypeSetRenderingOrigin, EmfPlusRecordTypeSetAntiAliasMode, EmfPlusRecordTypeSetTextRenderingHint, EmfPlusRecordTypeSetTextContrast, EmfPlusRecordTypeSetInterpolationMode, EmfPlusRecordTypeSetPixelOffsetMode, EmfPlusRecordTypeSetCompositingMode, EmfPlusRecordTypeSetCompositingQuality, EmfPlusRecordTypeSave, EmfPlusRecordTypeRestore, EmfPlusRecordTypeBeginContainer, EmfPlusRecordTypeBeginContainerNoParams, EmfPlusRecordTypeEndContainer, EmfPlusRecordTypeSetWorldTransform, EmfPlusRecordTypeResetWorldTransform, EmfPlusRecordTypeMultiplyWorldTransform, EmfPlusRecordTypeTranslateWorldTransform, EmfPlusRecordTypeScaleWorldTransform, EmfPlusRecordTypeRotateWorldTransform, EmfPlusRecordTypeSetPageTransform, EmfPlusRecordTypeResetClip, EmfPlusRecordTypeSetClipRect, EmfPlusRecordTypeSetClipPath, EmfPlusRecordTypeSetClipRegion, EmfPlusRecordTypeOffsetClip, EmfPlusRecordTypeDrawDriverString, #if (GDIPVER >= 0x0110) EmfPlusRecordTypeStrokeFillPath, EmfPlusRecordTypeSerializableObject, EmfPlusRecordTypeSetTSGraphics, EmfPlusRecordTypeSetTSClip, #endif EmfPlusRecordTotal, EmfPlusRecordTypeMax = EmfPlusRecordTotal-1, EmfPlusRecordTypeMin = EmfPlusRecordTypeHeader } EmfPlusRecordType; #endif libgdiplus-6.0.4+dfsg/src/carbon-private.c0000644000175000017500000000355713542672033021204 0ustar directhexdirecthex/* * carbon-private.c * * Copyright (C) 2008 Novell, Inc (http://www.novell.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. * * Authors: * Geoff Norton */ #ifdef __APPLE__ #include void gdip_get_display_dpi_carbon (float *h_dpi, float *v_dpi) { *h_dpi = *v_dpi = 96.0f; if (getenv ("MONO_MWF_MAC_DETECT_DPI") != NULL) { CGSize size = CGDisplayScreenSize(kCGDirectMainDisplay); if (!CGSizeEqualToSize(size, CGSizeZero)) { const float mmpi = 25.4; float h_size_inch = size.width / mmpi; float v_size_inch = size.height / mmpi; *h_dpi = CGDisplayPixelsWide (kCGDirectMainDisplay) / h_size_inch; *v_dpi = CGDisplayPixelsHigh (kCGDirectMainDisplay) / v_size_inch; } } } #else #include void gdip_get_display_dpi_carbon (float *h_dpi, float *v_dpi) { g_assert_not_reached (); } #endif libgdiplus-6.0.4+dfsg/src/dstream.h0000644000175000017500000000343313233636545017732 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * */ #ifndef __DSTREAM_H #define __DSTREAM_H #include "win32structs.h" #include "image.h" typedef struct _dstream_pvt dstream_private; typedef struct _dstream dstream_t; struct _dstream { dstream_private *pvt; }; dstream_t *dstream_input_new (GetBytesDelegate read, SeekDelegate seek) GDIP_INTERNAL; int dstream_read (dstream_t *loader, BYTE *buffer, int size, char peek) GDIP_INTERNAL; void dstream_skip (dstream_t *loader, int nbytes) GDIP_INTERNAL; void dstream_free (dstream_t *loader) GDIP_INTERNAL; void dstream_keep_exif_buffer (dstream_t *loader) GDIP_INTERNAL; void dstream_get_exif_buffer (dstream_t *loader, unsigned char **ptr, unsigned int *length) GDIP_INTERNAL; #endif libgdiplus-6.0.4+dfsg/src/Makefile.in0000644000175000017500000007032513545371055020171 0ustar directhexdirecthex# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_PANGO_RENDERING_TRUE@am__append_1 = \ @USE_PANGO_RENDERING_TRUE@ text-pango.c \ @USE_PANGO_RENDERING_TRUE@ text-pango-private.h @USE_PANGO_RENDERING_FALSE@am__append_2 = \ @USE_PANGO_RENDERING_FALSE@ text-cairo.c \ @USE_PANGO_RENDERING_FALSE@ text-cairo-private.h subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libgdiplus_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libgdiplus_la_SOURCES_DIST = adjustablearrowcap.c \ adjustablearrowcap.h adjustablearrowcap-private.h \ alpha-premul-table.inc bitmap.c bitmap.h bitmap-private.h \ brush.c brush.h brush-private.h carbon-private.c \ carbon-private.h codecs.h codecs-private.h customlinecap.c \ customlinecap.h customlinecap-private.h dstream.c dstream.h \ font.c font.h font-private.h fontcollection.h \ fontcollection-private.h fontfamily.h fontfamily-private.h \ gdi32.h gdi32.c GdiPlusFlat.h gdiplus-private.h gdip.h \ gdipenums.h gdiplusimaging.h gdipluspixelformats.h \ gdipstructs.h general.c general.h general-private.h graphics.c \ graphics.h graphics-cairo.c graphics-cairo-private.h \ graphics-metafile.c graphics-metafile-private.h \ graphics-private.h graphics-path.c graphics-path.h \ graphics-path-private.h graphics-pathiterator.c \ graphics-pathiterator.h graphics-pathiterator-private.h \ hatchbrush.c hatchbrush.h hatchbrush-private.h icocodec.c \ icocodec.h image.c image.h image-private.h imageattributes.c \ imageattributes.h imageattributes-private.h \ lineargradientbrush.c lineargradientbrush.h \ lineargradientbrush-private.h matrix.c matrix.h \ matrix-private.h metafile.c metafile.h metafile-private.h \ pathgradientbrush.c pathgradientbrush.h \ pathgradientbrush-private.h pen.c pen.h pen-private.h print.c \ region.c region.h region-private.h region-bitmap.c \ region-bitmap.h region-path-tree.c region-path-tree.h \ solidbrush.c solidbrush.h solidbrush-private.h stringformat.c \ stringformat.h stringformat-private.h text.c text.h \ text-metafile.c text-metafile-private.h texturebrush.c \ texturebrush.h texturebrush-private.h win32structs.h \ bmpcodec.h bmpcodec.c emfcodec.c emfcodec.h emfplus.c \ emfplus.h gifcodec.h gifcodec.c jpegcodec.h jpegcodec.c \ pngcodec.h pngcodec.c tiffcodec.h tiffcodec.c wmfcodec.c \ wmfcodec.h text-pango.c text-pango-private.h text-cairo.c \ text-cairo-private.h @USE_PANGO_RENDERING_TRUE@am__objects_1 = text-pango.lo @USE_PANGO_RENDERING_FALSE@am__objects_2 = text-cairo.lo am_libgdiplus_la_OBJECTS = adjustablearrowcap.lo bitmap.lo brush.lo \ carbon-private.lo customlinecap.lo dstream.lo font.lo gdi32.lo \ general.lo graphics.lo graphics-cairo.lo graphics-metafile.lo \ graphics-path.lo graphics-pathiterator.lo hatchbrush.lo \ icocodec.lo image.lo imageattributes.lo lineargradientbrush.lo \ matrix.lo metafile.lo pathgradientbrush.lo pen.lo print.lo \ region.lo region-bitmap.lo region-path-tree.lo solidbrush.lo \ stringformat.lo text.lo text-metafile.lo texturebrush.lo \ bmpcodec.lo emfcodec.lo emfplus.lo gifcodec.lo jpegcodec.lo \ pngcodec.lo tiffcodec.lo wmfcodec.lo $(am__objects_1) \ $(am__objects_2) libgdiplus_la_OBJECTS = $(am_libgdiplus_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libgdiplus_la_SOURCES) DIST_SOURCES = $(am__libgdiplus_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_DEPENDENCIES_CFLAGS = @BASE_DEPENDENCIES_CFLAGS@ BASE_DEPENDENCIES_LIBS = @BASE_DEPENDENCIES_LIBS@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_CONFIG = @FONTCONFIG_CONFIG@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FREETYPE_CONFIG = @FREETYPE_CONFIG@ GDIPLUS_CFLAGS = @GDIPLUS_CFLAGS@ GDIPLUS_LIBS = @GDIPLUS_LIBS@ GDIPLUS_PKG_CFLAGS = @GDIPLUS_PKG_CFLAGS@ GDIPLUS_PKG_LIBS = @GDIPLUS_PKG_LIBS@ GDIPLUS_PKG_REQ = @GDIPLUS_PKG_REQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBEXIF_CFLAGS = @LIBEXIF_CFLAGS@ LIBEXIF_LIBS = @LIBEXIF_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANGO_CFLAGS = @PANGO_CFLAGS@ PANGO_LIBS = @PANGO_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libgdiplus.la libgdiplus_la_SOURCES = adjustablearrowcap.c adjustablearrowcap.h \ adjustablearrowcap-private.h alpha-premul-table.inc bitmap.c \ bitmap.h bitmap-private.h brush.c brush.h brush-private.h \ carbon-private.c carbon-private.h codecs.h codecs-private.h \ customlinecap.c customlinecap.h customlinecap-private.h \ dstream.c dstream.h font.c font.h font-private.h \ fontcollection.h fontcollection-private.h fontfamily.h \ fontfamily-private.h gdi32.h gdi32.c GdiPlusFlat.h \ gdiplus-private.h gdip.h gdipenums.h gdiplusimaging.h \ gdipluspixelformats.h gdipstructs.h general.c general.h \ general-private.h graphics.c graphics.h graphics-cairo.c \ graphics-cairo-private.h graphics-metafile.c \ graphics-metafile-private.h graphics-private.h graphics-path.c \ graphics-path.h graphics-path-private.h \ graphics-pathiterator.c graphics-pathiterator.h \ graphics-pathiterator-private.h hatchbrush.c hatchbrush.h \ hatchbrush-private.h icocodec.c icocodec.h image.c image.h \ image-private.h imageattributes.c imageattributes.h \ imageattributes-private.h lineargradientbrush.c \ lineargradientbrush.h lineargradientbrush-private.h matrix.c \ matrix.h matrix-private.h metafile.c metafile.h \ metafile-private.h pathgradientbrush.c pathgradientbrush.h \ pathgradientbrush-private.h pen.c pen.h pen-private.h print.c \ region.c region.h region-private.h region-bitmap.c \ region-bitmap.h region-path-tree.c region-path-tree.h \ solidbrush.c solidbrush.h solidbrush-private.h stringformat.c \ stringformat.h stringformat-private.h text.c text.h \ text-metafile.c text-metafile-private.h texturebrush.c \ texturebrush.h texturebrush-private.h win32structs.h \ bmpcodec.h bmpcodec.c emfcodec.c emfcodec.h emfplus.c \ emfplus.h gifcodec.h gifcodec.c jpegcodec.h jpegcodec.c \ pngcodec.h pngcodec.c tiffcodec.h tiffcodec.c wmfcodec.c \ wmfcodec.h $(am__append_1) $(am__append_2) libgdiplus_la_LIBADD = $(GDIPLUS_LIBS) AM_CPPFLAGS = $(GDIPLUS_CFLAGS) EXTRA_DIST = libgdiplus.vcxproj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libgdiplus.la: $(libgdiplus_la_OBJECTS) $(libgdiplus_la_DEPENDENCIES) $(EXTRA_libgdiplus_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libgdiplus_la_OBJECTS) $(libgdiplus_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjustablearrowcap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmpcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/carbon-private.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/customlinecap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emfcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emfplus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/font.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdi32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/general.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics-cairo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics-metafile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics-path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics-pathiterator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hatchbrush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icocodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imageattributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lineargradientbrush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metafile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pathgradientbrush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/region-bitmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/region-path-tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/region.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solidbrush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringformat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-cairo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-metafile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-pango.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texturebrush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmfcodec.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libgdiplus-6.0.4+dfsg/src/dstream.c0000644000175000017500000001070013542672033017713 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * */ #include "gdiplus-private.h" #include "dstream.h" struct _dstream_pvt { GetBytesDelegate read; SeekDelegate seek; BYTE *buffer; int allocated; int position; int used; /* EXIF APP1 buffer */ BYTE *exif_buffer; unsigned int exif_datasize; BOOL keep_exif_buffer; }; /* dstream_t */ dstream_t * dstream_input_new (GetBytesDelegate read, SeekDelegate seek) { dstream_t *st; st = GdipAlloc (sizeof (dstream_t)); if (st == NULL) return NULL; st->pvt = GdipAlloc (sizeof (dstream_private)); if (st->pvt == NULL) { GdipFree (st); return NULL; } memset (st->pvt, 0, sizeof (dstream_private)); st->pvt->read = read; st->pvt->seek = seek; return st; } void dstream_free (dstream_t *st) { if (st) { dstream_private *loader = st->pvt; if (loader->buffer) GdipFree (loader->buffer); if (loader->exif_buffer) GdipFree (loader->exif_buffer); memset (loader, 0, sizeof (dstream_t)); GdipFree (loader); GdipFree (st); } } static int read_from_buffer (dstream_private *loader, void *buffer, int size) { int nbytes = loader->used - loader->position; if (nbytes > size) nbytes = size; memcpy (buffer, loader->buffer + loader->position, nbytes); loader->position += nbytes; return nbytes; } static void fill_buffer (dstream_private *loader) { int offset; int nbytes = loader->used - loader->position; if (nbytes > 0) return; if (loader->allocated == 0) { loader->allocated = 65536; loader->buffer = GdipAlloc (loader->allocated); if (loader->buffer == NULL) { /* what? */ return; } } offset = 0; do { nbytes = loader->read (loader->buffer + offset, loader->allocated - offset, 0); if (nbytes > 0) offset += nbytes; } while (nbytes > 0 && ((loader->allocated - offset) > 0)); if (offset != 0) { loader->position = 0; loader->used = offset; } /* First chunk read */ if (nbytes > 0 && loader->keep_exif_buffer && loader->exif_buffer == NULL) { loader->exif_buffer = GdipAlloc (offset); if (!loader->exif_buffer) return; loader->exif_datasize = offset; memcpy (loader->exif_buffer, loader->buffer, offset); } } int dstream_read (dstream_t *st, BYTE *buffer, int size, char peek) { int nbytes; int offset; dstream_private *loader = st->pvt; offset = 0; do { fill_buffer (loader); nbytes = read_from_buffer (loader, buffer + offset, size); offset += nbytes; size -= nbytes; } while (size > 0 && nbytes > 0); return offset; } void dstream_skip (dstream_t *st, int nbytes) { dstream_private *loader = st->pvt; if (loader->seek != NULL) { loader->seek (nbytes, SEEK_CUR); } else { int remain = loader->used - loader->position; if (remain > 0) { if (nbytes >= remain) { nbytes -= remain; loader->used = 0; loader->position = 0; } else { loader->position += nbytes; nbytes = 0; } } /* 'read' ignores reads into a NULL buffer */ while (nbytes > 0) { nbytes -= loader->read (NULL, nbytes, 0); } } /* Invalidate buffer */ loader->used = 0; loader->position = 0; } void dstream_keep_exif_buffer (dstream_t *st) { dstream_private *loader = st->pvt; loader->keep_exif_buffer = TRUE; } void dstream_get_exif_buffer (dstream_t *st, BYTE **ptr, unsigned int *length) { dstream_private *loader = st->pvt; if (loader->keep_exif_buffer) { *ptr = loader->exif_buffer; *length = loader->exif_datasize; } else { *ptr = NULL; *length = 0; } } libgdiplus-6.0.4+dfsg/src/codecs.h0000644000175000017500000000366013542674535017541 0ustar directhexdirecthex/* * codecs.h * * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __CODECS_H__ #define __CODECS_H__ GpStatus WINGDIPAPI GdipGetImageDecodersSize (UINT *numDecoders, UINT *size); GpStatus WINGDIPAPI GdipGetImageDecoders (UINT numDecoders, UINT size, ImageCodecInfo *decoders); GpStatus WINGDIPAPI GdipGetImageEncodersSize (UINT *numEncoders, UINT *size); GpStatus WINGDIPAPI GdipGetImageEncoders (UINT numEncoders, UINT size, ImageCodecInfo *encoders); #endif libgdiplus-6.0.4+dfsg/src/region-path-tree.h0000644000175000017500000000422513542672033021440 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef _REGION_PATH_TREE_H_ #define _REGION_PATH_TREE_H_ #include "gdiplus-private.h" #include "matrix-private.h" /* internal (private) API for regions path trees */ #define REGION_TAG_PATH 1 #define REGION_TAG_TREE 2 typedef struct GpPathTree { CombineMode mode; GpPath* path; struct GpPathTree* branch1; struct GpPathTree* branch2; } GpPathTree; void gdip_region_clear_tree (GpPathTree *tree) GDIP_INTERNAL; GpStatus gdip_region_copy_tree (GpPathTree *source, GpPathTree *dest) GDIP_INTERNAL; UINT gdip_region_get_tree_size (GpPathTree *tree) GDIP_INTERNAL; BOOL gdip_region_deserialize_tree (BYTE *data, int size, GpPathTree *tree) GDIP_INTERNAL; BOOL gdip_region_serialize_tree (GpPathTree *tree, BYTE *buffer, UINT bufferSize, UINT *sizeFilled) GDIP_INTERNAL; void gdip_region_translate_tree (GpPathTree *tree, float dx, float dy) GDIP_INTERNAL; GpStatus gdip_region_transform_tree (GpPathTree *tree, GpMatrix *matrix) GDIP_INTERNAL; #endif /* _REGION_PATH_TREE_H_ */ libgdiplus-6.0.4+dfsg/src/text-metafile.c0000644000175000017500000000310213542674535021033 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #include "text-metafile-private.h" /* * NOTE: all parameter's validations are done inside text.c */ /* * http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/DrawString.html */ GpStatus metafile_DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, GpBrush *brush) { /* TODO */ return Ok; } libgdiplus-6.0.4+dfsg/src/matrix-private.h0000644000175000017500000000462613542673672021261 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __MATRIX_PRIVATE_H__ #define __MATRIX_PRIVATE_H__ #include "gdiplus-private.h" typedef cairo_matrix_t GpMatrix; #define gdip_matrix_get_x_translation(matrix) (matrix->x0) #define gdip_matrix_get_y_translation(matrix) (matrix->y0) #define gdip_matrix_get_x_scale(matrix) (matrix->xx) #define gdip_matrix_get_y_scale(matrix) (matrix->yy) #define gdip_matrix_reverse_order(order) ((order == MatrixOrderPrepend) ? MatrixOrderAppend : MatrixOrderPrepend) #define gdip_cairo_matrix_copy(m1,m2) memcpy (m1, m2, sizeof (cairo_matrix_t)) BOOL gdip_is_matrix_a_translation (const GpMatrix *matrix) GDIP_INTERNAL; BOOL gdip_is_matrix_empty (const GpMatrix* matrix) GDIP_INTERNAL; GpStatus gdip_matrix_init_from_rect_3points (GpMatrix *matrix, const GpRectF *rect, const GpPointF *dstplg) GDIP_INTERNAL; #include "matrix.h" #endif libgdiplus-6.0.4+dfsg/src/pngcodec.c0000644000175000017500000006502213545154626020053 0ustar directhexdirecthex/* * pngcodec.c : Contains function definitions for encoding decoding png images * * Copyright (C) 2003-2004,2007 Novell, Inc (http://www.novell.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. * * Authors: * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic * Jonathan Gilbert (logic@deltaq.org) * */ #include "config.h" #include "win32structs.h" GUID gdip_png_image_format_guid = {0xb96b3cafU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e}}; #ifdef HAVE_LIBPNG #include #include "codecs-private.h" #include "pngcodec.h" #include /* Codecinfo related data*/ static ImageCodecInfo png_codec; static const WCHAR png_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'P', 'N', 'G', ' ', 'C', 'o', 'd', 'e', 'c', 0}; /* Built-in PNG Codec */ static const WCHAR png_extension[] = {'*', '.', 'P', 'N', 'G', 0}; /* *.PNG */ static const WCHAR png_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'p', 'n', 'g', 0}; /* image/png */ static const WCHAR png_format[] = {'P', 'N', 'G', 0}; /* PNG */ static const BYTE png_sig_pattern[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }; static const BYTE png_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; ImageCodecInfo * gdip_getcodecinfo_png () { png_codec.Clsid = (CLSID) { 0x557cf406, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }; png_codec.FormatID = gdip_png_image_format_guid; png_codec.CodecName = (const WCHAR*) png_codecname; png_codec.DllName = NULL; png_codec.FormatDescription = (const WCHAR*) png_format; png_codec.FilenameExtension = (const WCHAR*) png_extension; png_codec.MimeType = (const WCHAR*) png_mimetype; png_codec.Flags = ImageCodecFlagsEncoder | ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin; png_codec.Version = 1; png_codec.SigCount = 1; png_codec.SigSize = 8; png_codec.SigPattern = png_sig_pattern; png_codec.SigMask = png_sig_mask; return &png_codec; } #if !defined(HAVE_SIGSETJMP) && !defined(sigsetjmp) #define sigjmp_buf jmp_buf #define sigsetjmp(jb, x) setjmp(jb) #define siglongjmp longjmp #endif static void _gdip_png_stream_read_data (png_structp png_ptr, png_bytep data, png_size_t length) { GetBytesDelegate getBytesFunc; int bytesRead; int res; getBytesFunc = (GetBytesDelegate) png_get_io_ptr (png_ptr); /* In png parlance, it is an error to read less than length */ bytesRead = 0; while (bytesRead != length) { res = getBytesFunc (data + bytesRead, length - bytesRead, 0); if (res <= 0) { png_error(png_ptr, "Read failed"); } bytesRead += res; } } static void _gdip_png_stream_write_data (png_structp png_ptr, png_bytep data, png_size_t length) { PutBytesDelegate putBytesFunc = (PutBytesDelegate) png_get_io_ptr (png_ptr); putBytesFunc (data, length); } static void _gdip_png_stream_flush_data (png_structp png_ptr) { /* nothing */ } static GpStatus gdip_load_png_properties (png_structp png_ptr, png_infop info_ptr, png_infop end_ptr, ActiveBitmapData *bitmap_data) { #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) bitmap_data->image_flags |= ImageFlagsHasRealDPI; bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr); bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr); #elif defined(PNG_pHYs_SUPPORTED) { int unit_type = 0; png_uint_32 res_x = 0; png_uint_32 res_y = 0; png_get_pHYs( png_ptr, info_ptr, &res_x, &res_y, &unit_type ); if (unit_type == PNG_RESOLUTION_METER) { bitmap_data->image_flags |= ImageFlagsHasRealDPI; bitmap_data->dpi_horz = res_x * 0.0254; bitmap_data->dpi_vert = res_y * 0.0254; } } #endif /* default to screen resolution (if nothing was provided or available) */ if (bitmap_data->dpi_horz == 0 || bitmap_data->dpi_vert == 0) { bitmap_data->dpi_horz = bitmap_data->dpi_vert = gdip_get_display_dpi (); } #if defined(PNG_iCCP_SUPPORTED) { png_charp name = NULL; #if (PNG_LIBPNG_VER > 10499) png_bytep profile = NULL; #else png_charp profile = NULL; #endif png_uint_32 proflen = 0; int compression_type = 0; if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile, &proflen)) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagICCProfileDescriptor, (BYTE*)name); gdip_bitmapdata_property_add_byte(bitmap_data, PropertyTagICCProfile, (BYTE)compression_type); } } #endif #if defined(PNG_gAMA_SUPPORTED) { double gamma = 0; if (png_get_gAMA(png_ptr, info_ptr, &gamma)) { gdip_bitmapdata_property_add_rational(bitmap_data, PropertyTagGamma, 100000, gamma * 100000); } } #endif #if defined(PNG_cHRM_SUPPORTED) { double white_x = 0; double white_y = 0; double red_x = 0; double red_y = 0; double green_x = 0; double green_y = 0; double blue_x = 0; double blue_y = 0; if (png_get_cHRM(png_ptr, info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y)) { BYTE *buffer; guint32 *ptr; buffer = GdipAlloc(6 * (sizeof(png_uint_32) + sizeof(png_uint_32))); if (!buffer) { return OutOfMemory; } ptr = (guint32 *)buffer; ptr[0] = (guint32)(red_x * 100000); ptr[1] = 1000000; ptr[2] = (guint32)(red_y * 100000); ptr[3] = 100000; ptr[4] = (guint32)(green_x * 100000); ptr[5] = 1000000; ptr[6] = (guint32)(green_y * 100000); ptr[7] = 100000; ptr[8] = (guint32)(blue_x * 100000); ptr[9] = 100000; ptr[10] = (guint32)(blue_y * 100000); ptr[11] = 100000; gdip_bitmapdata_property_add (bitmap_data, PropertyTagPrimaryChromaticities, 6 * (sizeof(guint32) + sizeof(guint32)), PropertyTagTypeRational, buffer); ptr[0] = (guint32)(white_x * 100000); ptr[1] = 1000000; ptr[2] = (guint32)(white_y * 100000); ptr[3] = 100000; gdip_bitmapdata_property_add (bitmap_data, PropertyTagWhitePoint, 2 * (sizeof(guint32) + sizeof(guint32)), PropertyTagTypeRational, buffer); GdipFree(buffer); } } #endif #if defined(PNG_pHYs_SUPPORTED) { int unit_type = 0; png_uint_32 res_x = 0; png_uint_32 res_y = 0; if (png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, &unit_type)) { gdip_bitmapdata_property_add_byte(bitmap_data, PropertyTagPixelUnit, (BYTE)unit_type); gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagPixelPerUnitX, res_x); gdip_bitmapdata_property_add_long(bitmap_data, PropertyTagPixelPerUnitY, res_y); } } #endif #if defined(PNG_TEXT_SUPPORTED) { int num_text = 0; png_textp text_ptr = NULL; if (png_get_text(png_ptr, info_ptr, &text_ptr, &num_text)) { if (num_text > 0) { gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagExifUserComment, (BYTE*)text_ptr[0].text); } } } #endif return Ok; } static GpStatus gdip_load_png_image_from_file_or_stream (FILE *fp, GetBytesDelegate getBytesFunc, GpImage **image) { png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_infop end_info_ptr = NULL; BYTE *rawdata = NULL; GpImage *result = NULL; GpStatus status = OutOfMemory; int bit_depth; int channels; BYTE color_type; int num_palette = 0; png_colorp png_palette = NULL; png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_ptr) { goto error; } if (setjmp(png_jmpbuf(png_ptr))) { /* png detected error occured */ goto error; } info_ptr = png_create_info_struct (png_ptr); if (info_ptr == NULL) { goto error; } end_info_ptr = png_create_info_struct (png_ptr); if (end_info_ptr == NULL) { goto error; } if (fp != NULL) { png_init_io (png_ptr, fp); } else { png_set_read_fn (png_ptr, (void *) getBytesFunc, _gdip_png_stream_read_data); } /* Pass PNG_TRANSFORM_STRIP_16, which basically reduces the color palette from 16-bits to 8-bits * for 16-bit color depths. The current implementation of libgdiplus doesn't handle bit depths > 8, * so this acts as a workaround. Net impact is that the quality of the image is slightly reduced instead * of refusing to process the image (and potentially crashing the application) altogether; * proper support would mean supporting 16-bit color channels. * Partially fixes http://bugzilla.ximian.com/show_bug.cgi?id=80693 */ png_read_png (png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16, NULL); bit_depth = png_get_bit_depth (png_ptr, info_ptr); channels = png_get_channels (png_ptr, info_ptr); color_type = png_get_color_type (png_ptr, info_ptr); png_get_PLTE( png_ptr, info_ptr, &png_palette, &num_palette ); /* 2bpp is a special case (promoted to 32bpp ARGB by MS GDI+) */ if ((bit_depth <= 8) && (bit_depth != 2) && (channels == 1) && ((color_type == PNG_COLOR_TYPE_PALETTE) || (color_type == PNG_COLOR_TYPE_GRAY))) { int width; int height; int source_stride; int dest_stride; png_bytep *row_pointers; int num_colours; int palette_entries; ColorPalette *palette; ImageFlags colourspace_flag; int i; width = png_get_image_width (png_ptr, info_ptr); height = png_get_image_height (png_ptr, info_ptr); source_stride = (width * bit_depth + 7) / 8; dest_stride = source_stride; gdip_align_stride (dest_stride); /* Copy image data. */ row_pointers = png_get_rows (png_ptr, info_ptr); unsigned long long int size = (unsigned long long int)dest_stride * height; if (size > G_MAXINT32) { status = OutOfMemory; goto error; } rawdata = GdipAlloc(size); if (!rawdata) { status = OutOfMemory; goto error; } for (i=0; i < height; i++) { memcpy (rawdata + i * dest_stride, row_pointers[i], source_stride); } /* Copy palette. */ num_colours = 1 << bit_depth; if (color_type == PNG_COLOR_TYPE_GRAY) { /* A gray-scale image; generate a palette fading from black to white. */ colourspace_flag = ImageFlagsColorSpaceGRAY; palette = gdip_create_greyscale_palette (num_colours); if (!palette) { status = OutOfMemory; goto error; } palette->Flags = PaletteFlagsGrayScale; } else { /* Copy the palette data into the GDI+ structure. */ colourspace_flag = ImageFlagsColorSpaceRGB; palette_entries = num_colours; if (palette_entries > num_palette) { palette_entries = num_palette; } palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB)); if (!palette) { status = OutOfMemory; goto error; } palette->Flags = 0; palette->Count = num_colours; for (i=0; i < palette_entries; i++) { set_pixel_bgra (&palette->Entries[i], 0, png_palette[i].blue, png_palette[i].green, png_palette[i].red, 0xFF); /* alpha */ } } if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) { png_bytep trans_alpha = NULL; int num_trans = 0; png_color_16p trans_color = NULL; /* Make sure transparency is respected. */ png_get_tRNS( png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color ); if (num_trans > 0) { palette->Flags |= PaletteFlagsHasAlpha; colourspace_flag |= ImageFlagsHasAlpha; if (num_trans > num_palette) { num_trans = num_palette; } for (i=0; i < num_trans; i++) { png_byte alpha = #if (PNG_LIBPNG_VER > 10399) trans_alpha[i]; #else info_ptr->trans[i]; #endif set_pixel_bgra(&palette->Entries[i], 0, png_palette[i].blue, png_palette[i].green, png_palette[i].red, alpha); } } } result = gdip_bitmap_new_with_frame (&gdip_image_frameDimension_page_guid, TRUE); if (!result) { status = OutOfMemory; goto error; } result->type = ImageTypeBitmap; result->active_bitmap->stride = dest_stride; result->active_bitmap->width = width; result->active_bitmap->height = height; result->active_bitmap->scan0 = rawdata; result->active_bitmap->reserved = GBD_OWN_SCAN0; switch (bit_depth) { case 1: result->active_bitmap->pixel_format = PixelFormat1bppIndexed; result->cairo_format = CAIRO_FORMAT_A1; break; // note: 2bpp is a special case as the format is "promoted" to PixelFormat32bppARGB / CAIRO_FORMAT_ARGB32 // we deal with this later... case 4: result->active_bitmap->pixel_format = PixelFormat4bppIndexed; result->cairo_format = CAIRO_FORMAT_A8; break; case 8: result->active_bitmap->pixel_format = PixelFormat8bppIndexed; result->cairo_format = CAIRO_FORMAT_A8; break; } result->active_bitmap->image_flags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize | colourspace_flag; /* assigned when the palette is loaded */ result->active_bitmap->dpi_horz = 0; result->active_bitmap->dpi_vert = 0; result->active_bitmap->palette = palette; } /* 2bpp needs to enter here too */ if (!result) { int width; int height; BYTE bit_depth; int stride; png_bytep *row_pointers; BYTE *rawptr; int i, j; BYTE alpha[4] = {0xFF, 0xFF, 0xFF, 0xFF}; /* Transparency values for 2bpp - default to fully opaque. */ width = png_get_image_width (png_ptr, info_ptr); height = png_get_image_height (png_ptr, info_ptr); /* 24 and 32bpp are supported, 48, 64bpp aren't, see http://bugzilla.ximian.com/show_bug.cgi?id=80693 */ bit_depth = png_get_bit_depth (png_ptr, info_ptr); if (bit_depth > 8) { g_warning ("PNG images with %dbpp aren't supported by libgdiplus.", channels * bit_depth); status = UnknownImageFormat; goto error; } stride = (width * 4); gdip_align_stride (stride); row_pointers = png_get_rows (png_ptr, info_ptr); unsigned long long int size = (unsigned long long int)stride * height; if (size > G_MAXINT32) { status = OutOfMemory; goto error; } rawdata = GdipAlloc (size); if (!rawdata) { status = OutOfMemory; goto error; } rawptr = rawdata; switch (channels) { case 4: { for (i = 0; i < height; i++) { png_bytep rowp = row_pointers[i]; for (j = 0; j < width; j++) { BYTE b = rowp[2]; BYTE g = rowp[1]; BYTE r = rowp[0]; BYTE a = rowp[3]; set_pixel_bgra (rawptr, 0, b, g, r, a); rowp += 4; rawptr += 4; } } break; } case 3: { for (i = 0; i < height; i++) { png_bytep rowp = row_pointers[i]; for (j = 0; j < width; j++) { set_pixel_bgra (rawptr, 0, rowp[2], rowp[1], rowp[0], 0xff); rowp += 3; rawptr += 4; } } break; } case 2: { for (i = 0; i < height; i++) { png_bytep rowp = row_pointers[i]; for (j = 0; j < width; j++) { set_pixel_bgra (rawptr, 0, rowp[0], rowp[0], rowp[0], rowp[1]); rowp += 2; rawptr += 4; } } break; } case 1: if (bit_depth == 2) { /* Make sure transparency is respected for 2bpp images. */ int num_trans = 0; BYTE * trans = NULL; png_color_16p dummy = NULL; if (png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &dummy)) { if (num_trans > 0 && trans != NULL) { memcpy(alpha, trans, MIN(num_trans, 4)); } } } for (i = 0; i < height; i++) { png_bytep rowp = row_pointers[i]; rawptr = rawdata + i * stride; /* Ensure each output row starts at the right place. */ if (bit_depth == 2) { // 4 pixels for each byte for (j = 0; j < width; j++) { png_byte palette = 0; png_byte pix = *rowp++; palette = (pix >> 6) & 0x03; set_pixel_bgra (rawptr, 0, png_palette[palette].blue, png_palette[palette].green, png_palette[palette].red, alpha[palette]); if (++j >= width) break; palette = (pix >> 4) & 0x03; set_pixel_bgra (rawptr, 4, png_palette[palette].blue, png_palette[palette].green, png_palette[palette].red, alpha[palette]); if (++j >= width) break; palette = (pix >> 2) & 0x03; set_pixel_bgra (rawptr, 8, png_palette[palette].blue, png_palette[palette].green, png_palette[palette].red, alpha[palette]); if (++j >= width) break; palette = pix & 0x03; set_pixel_bgra (rawptr, 12, png_palette[palette].blue, png_palette[palette].green, png_palette[palette].red, alpha[palette]); rawptr += 16; } } else { for (j = 0; j < width; j++) { png_byte pix = *rowp++; set_pixel_bgra (rawptr, 0, pix, pix, pix, 0xff); rawptr += 4; } } } break; } result = gdip_bitmap_new_with_frame (&gdip_image_frameDimension_page_guid, TRUE); if (!result) { status = OutOfMemory; goto error; } result->type = ImageTypeBitmap; result->cairo_format = CAIRO_FORMAT_ARGB32; result->active_bitmap->stride = stride; result->active_bitmap->pixel_format = PixelFormat32bppARGB; result->active_bitmap->width = width; result->active_bitmap->height = height; result->active_bitmap->scan0 = rawdata; result->active_bitmap->reserved = GBD_OWN_SCAN0; if (channels == 3) { result->active_bitmap->pixel_format = PixelFormat24bppRGB; result->active_bitmap->image_flags = ImageFlagsColorSpaceRGB; } else if (channels == 4) { result->active_bitmap->pixel_format = PixelFormat32bppARGB; result->active_bitmap->image_flags = ImageFlagsColorSpaceRGB; } else if ((channels == 1) && (color_type == PNG_COLOR_TYPE_GRAY)) { // doesn't apply to 2bpp images result->active_bitmap->pixel_format = PixelFormat8bppIndexed; result->active_bitmap->image_flags = ImageFlagsColorSpaceGRAY; } else if ((channels == 1) && (color_type == PNG_COLOR_TYPE_PALETTE)) { // does apply to (what were) 2bpp images result->active_bitmap->image_flags = ImageFlagsColorSpaceRGB; result->active_bitmap->image_flags |= ImageFlagsHasAlpha; } if (color_type & PNG_COLOR_MASK_ALPHA) result->active_bitmap->image_flags |= ImageFlagsHasAlpha; result->active_bitmap->image_flags |= ImageFlagsReadOnly | ImageFlagsHasRealPixelSize; result->active_bitmap->dpi_horz = 0; result->active_bitmap->dpi_vert = 0; } status = gdip_load_png_properties(png_ptr, info_ptr, end_info_ptr, result->active_bitmap); if (status != Ok) { goto error; } png_destroy_read_struct (&png_ptr, &info_ptr, &end_info_ptr); *image = result; return Ok; error: if (result) { // Avoid double freeing the rawdata. if (result->active_bitmap->scan0 == rawdata) { rawdata = NULL; } gdip_bitmap_dispose (result); } /* coverity[dead_error_line] */ if (rawdata) { GdipFree (rawdata); } if (png_ptr) { png_destroy_read_struct (&png_ptr, info_ptr ? &info_ptr : (png_infopp) NULL, end_info_ptr ? &end_info_ptr : (png_infopp) NULL); } *image = NULL; return status; } GpStatus gdip_load_png_image_from_file (FILE *fp, GpImage **image) { return gdip_load_png_image_from_file_or_stream (fp, NULL, image); } GpStatus gdip_load_png_image_from_stream_delegate (GetBytesDelegate getBytesFunc, SeekDelegate seeknFunc, GpImage **image) { return gdip_load_png_image_from_file_or_stream (NULL, getBytesFunc, image); } static GpStatus gdip_save_png_image_to_file_or_stream (FILE *fp, PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { GpStatus status; png_structp png_ptr = NULL; png_infop info_ptr = NULL; int i; int bit_depth; int color_type; png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_ptr) { status = OutOfMemory; goto error; } if (setjmp(png_jmpbuf(png_ptr))) { /* png detected error occured */ status = GenericError; goto error; } info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { status = OutOfMemory; goto error; } if (fp != NULL) { png_init_io (png_ptr, fp); } else { png_set_write_fn (png_ptr, (void *) putBytesFunc, _gdip_png_stream_write_data, _gdip_png_stream_flush_data); } switch (image->active_bitmap->pixel_format) { case PixelFormat32bppARGB: case PixelFormat32bppPARGB: case PixelFormat32bppRGB: color_type = PNG_COLOR_TYPE_RGB_ALPHA; bit_depth = 8; break; case PixelFormat24bppRGB: color_type = PNG_COLOR_TYPE_RGB; /* FIXME - we should be able to write grayscale PNGs */ bit_depth = 8; break; case PixelFormat8bppIndexed: color_type = PNG_COLOR_TYPE_PALETTE; bit_depth = 8; break; case PixelFormat4bppIndexed: color_type = PNG_COLOR_TYPE_PALETTE; bit_depth = 4; break; case PixelFormat1bppIndexed: color_type = PNG_COLOR_TYPE_PALETTE; bit_depth = 1; break; /* We're not going to even try to save these images, for now */ case PixelFormat64bppARGB: case PixelFormat64bppPARGB: case PixelFormat48bppRGB: case PixelFormat16bppARGB1555: case PixelFormat16bppGrayScale: case PixelFormat16bppRGB555: case PixelFormat16bppRGB565: default: color_type = -1; bit_depth = -1; break; } if (bit_depth == -1) { status = GenericError; goto error; } png_set_IHDR (png_ptr, info_ptr, image->active_bitmap->width, image->active_bitmap->height, bit_depth, color_type, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); if (gdip_is_an_indexed_pixelformat (image->active_bitmap->pixel_format)) { png_color palette[256]; png_byte trans_alpha[256]; int palette_entries = image->active_bitmap->palette->Count; if (image->active_bitmap->pixel_format == PixelFormat4bppIndexed) { palette_entries = 16; } for (i=0; i < palette_entries; i++) { ARGB entry = image->active_bitmap->palette->Entries[i]; get_pixel_bgra(entry, palette[i].blue, palette[i].green, palette[i].red, trans_alpha[i]); } png_set_PLTE (png_ptr, info_ptr, palette, palette_entries); if ((image->active_bitmap->palette->Flags & PaletteFlagsHasAlpha) == PaletteFlagsHasAlpha) { png_set_tRNS (png_ptr, info_ptr, trans_alpha, palette_entries, NULL); } } png_set_filter (png_ptr, 0, PNG_NO_FILTERS); png_set_sRGB_gAMA_and_cHRM (png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL); png_write_info (png_ptr, info_ptr); png_set_bgr(png_ptr); if (gdip_is_an_indexed_pixelformat (image->active_bitmap->pixel_format)) { for (i = 0; i < image->active_bitmap->height; i++) { png_write_row (png_ptr, image->active_bitmap->scan0 + i * image->active_bitmap->stride); } } else if (image->active_bitmap->pixel_format == PixelFormat24bppRGB) { int j; BYTE *row_pointer = GdipAlloc (image->active_bitmap->width * 3); if (!row_pointer) { status = OutOfMemory; goto error; } for (i = 0; i < image->active_bitmap->height; i++) { for (j = 0; j < image->active_bitmap->width; j++) { #ifdef WORDS_BIGENDIAN row_pointer[j*3 ] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 3); row_pointer[j*3+1] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 2); row_pointer[j*3+2] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 1); #else row_pointer[j*3 ] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 0); row_pointer[j*3+1] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 1); row_pointer[j*3+2] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 2); #endif /* WORDS_BIGENDIAN */ } png_write_row (png_ptr, row_pointer); } GdipFree (row_pointer); } else { #ifdef WORDS_BIGENDIAN int j; BYTE *row_pointer = GdipAlloc (image->active_bitmap->width * 4); if (!row_pointer) { status = OutOfMemory; goto error; } for (i = 0; i < image->active_bitmap->height; i++) { for (j = 0; j < image->active_bitmap->width; j++) { row_pointer[j*4] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 3); row_pointer[j*4+1] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 2); row_pointer[j*4+2] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 1); row_pointer[j*4+3] = *((BYTE*)image->active_bitmap->scan0 + (image->active_bitmap->stride * i) + (j*4) + 0); } png_write_row (png_ptr, row_pointer); } GdipFree (row_pointer); #else for (i = 0; i < image->active_bitmap->height; i++) { png_write_row (png_ptr, image->active_bitmap->scan0 + (image->active_bitmap->stride * i)); } #endif } png_write_end (png_ptr, NULL); png_destroy_write_struct (&png_ptr, &info_ptr); return Ok; error: if (png_ptr) { png_destroy_write_struct (&png_ptr, info_ptr ? &info_ptr : NULL); } return status; } GpStatus gdip_save_png_image_to_file (FILE *fp, GpImage *image, GDIPCONST EncoderParameters *params) { return gdip_save_png_image_to_file_or_stream (fp, NULL, image, params); } GpStatus gdip_save_png_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return gdip_save_png_image_to_file_or_stream (NULL, putBytesFunc, image, params); } #else #include "codecs-private.h" #include "pngcodec.h" GpStatus gdip_load_png_image_from_file (FILE *fp, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_load_png_image_from_stream_delegate (GetBytesDelegate getBytesFunc, SeekDelegate seeknFunc, GpImage **image) { *image = NULL; return UnknownImageFormat; } GpStatus gdip_save_png_image_to_file (FILE *fp, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } GpStatus gdip_save_png_image_to_stream_delegate (PutBytesDelegate putBytesFunc, GpImage *image, GDIPCONST EncoderParameters *params) { return UnknownImageFormat; } ImageCodecInfo * gdip_getcodecinfo_png () { return NULL; } #endif /* HAVE_LIBPNG */ GpStatus gdip_fill_encoder_parameter_list_png (EncoderParameters *buffer, UINT size) { PngEncoderParameters *pngBuffer = (PngEncoderParameters *) buffer; if (!buffer || size != sizeof (PngEncoderParameters)) return InvalidParameter; pngBuffer->count = 1; pngBuffer->imageItems.Guid = GdipEncoderImageItems; pngBuffer->imageItems.NumberOfValues = 0; pngBuffer->imageItems.Type = 9; // Undocumented type. pngBuffer->imageItems.Value = NULL; return Ok; } libgdiplus-6.0.4+dfsg/src/gdiplus-private.h0000644000175000017500000000567013542674535021423 0ustar directhexdirecthex/* * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __LIBGDIPLUS_H__ #define __LIBGDIPLUS_H__ #include #ifdef _MSC_VER #define _USE_MATH_DEFINES #endif #include #include #include #include FT_TRUETYPE_TABLES_H #ifndef _MSC_VER #include #include #endif #include "config.h" #if HAVE_VISIBILITY_HIDDEN #define GDIP_INTERNAL __attribute__((visibility ("hidden"))) #else #define GDIP_INTERNAL #endif #ifdef _MSC_VER #define WINGDIPAPI __declspec( dllexport ) #else #define WINGDIPAPI #endif #include #ifdef CAIRO_HAS_FT_FONT #include #endif #if defined(HAVE_X11) #ifdef CAIRO_HAS_XLIB_SURFACE #include #endif #endif #if defined(HAVE_X11) #include #endif #include "win32structs.h" #include "gdipenums.h" #include "gdipluspixelformats.h" #include "gdiplusimaging.h" #include "gdipstructs.h" #include "general-private.h" typedef struct _AdjustableArrowCap GpAdjustableArrowCap; typedef struct _Brush GpBrush; typedef struct _CustomLineCap GpCustomLineCap; typedef struct _Font GpFont; typedef struct _FontCollection GpFontCollection; typedef struct _FontFamily GpFontFamily; typedef struct _Graphics GpGraphics; typedef struct _Hatch GpHatch; typedef struct _Image GpImage; typedef struct _ImageAttributes GpImageAttributes; typedef struct _LineGradient GpLineGradient; typedef struct _Metafile GpMetafile; typedef struct _Path GpPath; typedef struct _PathIterator GpPathIterator; typedef struct _PathGradient GpPathGradient; typedef struct _Pen GpPen; typedef struct _Region GpRegion; typedef struct _SolidFill GpSolidFill; typedef struct _StringFormat GpStringFormat; typedef struct _Texture GpTexture; #endif libgdiplus-6.0.4+dfsg/src/hatchbrush-private.h0000644000175000017500000000425513233636545022101 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ /* * NOTE: This is a private header files and everything is subject to changes. */ #ifndef __HATCHBRUSH_PRIVATE__ #define __HATCHBRUSH_PRIVATE__ #include "brush-private.h" #define HATCH_SIZE 7 #define LINE_WIDTH 1 #define gdip_hatch_get_width(hbr) (hatches_const[hbr->hatchStyle][0]) #define gdip_hatch_get_height(hbr) (hatches_const[hbr->hatchStyle][1]) #define gdip_hatch_get_line_width(hbr) (hatches_const[hbr->hatchStyle][2]) #define gdip_cairo_pixel(ct,x,y) cairo_rectangle (ct, x, y, 1, 1) typedef struct _Hatch { GpBrush base; GpHatchStyle hatchStyle; ARGB foreColor; ARGB backColor; cairo_pattern_t *pattern; BOOL alpha; } Hatch; #include "hatchbrush.h" #endif libgdiplus-6.0.4+dfsg/src/matrix.c0000644000175000017500000002611013542674535017573 0ustar directhexdirecthex/** * matrix.c * * Copyright (C) Novell, Inc. 2003-2004, 2007. * * 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. * * Author: Duncan Mak (duncan@ximian.com) * * **/ #include "matrix-private.h" #include "general-private.h" /* GDI+ matrix takes 6 elements arranged in 3 rows by 2 columns. The identity matrix is [1, 0] [1, 0, 0] [0, 1] that is a simplification of [0, 1, 0] [0, 0] [0, 0, 1] Point v1, v2 Matrix: [m11, m12] [m21, m22] [m31, m32] Calcutation of X, Y using the previous matrix X = v1 * m11 + v2 * m12 + m31 Y = v1 * m21 + v2 * m22 + m32 M31 and M32 are used to do matrix translations */ /* private functions */ /* * In System.Drawing it is often impossible to specify a 'null' matrix. * Instead we supply an empty matrix (i.e. new Matrix ()). However this * "empty" matrix can cause a lot of extra calculation in libgdiplus * (e.g. invalidating the bitmap) unless we consider it as a special case. */ BOOL gdip_is_matrix_empty (const GpMatrix* matrix) { if (!matrix) return TRUE; /* compare the matrix elements with the empty (no-op) version */ return (gdip_near_one (matrix->xx) && gdip_near_zero (matrix->yx) && gdip_near_zero (matrix->xy) && gdip_near_one (matrix->yy) && gdip_near_zero (matrix->x0) && gdip_near_zero (matrix->y0)); } /* GDI+ is more restrictive with matrices which contain boundary values (NaN, Infinity) than cairo. This helper function helps you detect these special cases. */ BOOL gdip_is_matrix_with_boundary_values(const GpMatrix* matrix) { if (!matrix) return TRUE; return isnan(matrix->xx) || isnan(matrix->xy) || isnan(matrix->yx) || isnan(matrix->yy) || isnan(matrix->x0) || isnan(matrix->y0) || isinf(matrix->xx) || isinf(matrix->xy) || isinf(matrix->yx) || isinf(matrix->yy) || isinf(matrix->x0) || isinf(matrix->y0); } /* GDI+ maps values between [ FLT_MAX, Infinity [ to FLT_MAX, instead of Infinity */ REAL gdip_double_to_float(double value) { if (value != INFINITY && value > FLT_MAX) return (REAL)FLT_MAX; if (value != -INFINITY && value < -FLT_MAX) return (REAL)-FLT_MAX; return (REAL)value; } BOOL gdip_is_matrix_a_translation (const GpMatrix *matrix) { if (!matrix) return TRUE; return ((matrix->xx == 1.0f) && (matrix->yx == 0.0f) && (matrix->xy == 0.0f) && (matrix->yy == 1.0f)); } /* this helper function avoid GpMatrix allocation and reduce code duplication */ GpStatus gdip_matrix_init_from_rect_3points (GpMatrix *matrix, const GpRectF *rect, const GpPointF *dstplg) { GpPointF *p, *p0, *p1, *p2; double m11, m12, m21, m22; if (!matrix || !rect || !dstplg) return InvalidParameter; if ((rect->Width == 0) || (rect->Height == 0)) return OutOfMemory; p = (GpPointF*) dstplg; p0 = p++; p1 = p++; p2 = p; m11 = (p1->X - p0->X) / rect->Width; m12 = (p1->Y - p0->Y) / rect->Width; m21 = (p2->X - p0->X) / rect->Height; m22 = (p2->Y - p0->Y) / rect->Height; cairo_matrix_init (matrix, m11, m12, m21, m22, p0->X, p0->Y); cairo_matrix_translate (matrix, -rect->X, -rect->Y); return Ok; } /* public (exported) functions */ // coverity[+alloc : arg-*0] GpStatus WINGDIPAPI GdipCreateMatrix (GpMatrix **matrix) { GpMatrix *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!matrix) return InvalidParameter; result = GdipAlloc (sizeof (GpMatrix)); if (!result) return OutOfMemory; cairo_matrix_init_identity (result); *matrix = result; return Ok; } // coverity[+alloc : arg-*6] GpStatus WINGDIPAPI GdipCreateMatrix2 (REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix) { GpMatrix *result; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!matrix) return InvalidParameter; result = GdipAlloc (sizeof (GpMatrix)); if (!result) return OutOfMemory; cairo_matrix_init (result, m11, m12, m21, m22, dx, dy); *matrix = result; return Ok; } // coverity[+alloc : arg-*2] GpStatus WINGDIPAPI GdipCreateMatrix3 (GDIPCONST GpRectF *rect, GDIPCONST GpPointF *dstplg, GpMatrix **matrix) { GpMatrix *result; GpStatus status; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!rect || !dstplg || !matrix) return InvalidParameter; result = GdipAlloc (sizeof (GpMatrix)); if (!result) return OutOfMemory; status = gdip_matrix_init_from_rect_3points (result, rect, dstplg); if (status != Ok) { GdipFree (result); *matrix = NULL; return status; } *matrix = result; return status; } // coverity[+alloc : arg-*2] GpStatus WINGDIPAPI GdipCreateMatrix3I (GDIPCONST GpRect *rect, GDIPCONST GpPoint *dstplg, GpMatrix **matrix) { GpRectF rectf; GpPointF pts[3]; if (!gdiplusInitialized) return GdiplusNotInitialized; if (!rect || !dstplg || !matrix) return InvalidParameter; gdip_RectF_from_Rect (rect, &rectf); pts [0].X = dstplg [0].X; pts [0].Y = dstplg [0].Y; pts [1].X = dstplg [1].X; pts [1].Y = dstplg [1].Y; pts [2].X = dstplg [2].X; pts [2].Y = dstplg [2].Y; return GdipCreateMatrix3 (&rectf, (GpPointF*)&pts, matrix); } // coverity[+alloc : arg-*1] GpStatus WINGDIPAPI GdipCloneMatrix (GpMatrix *matrix, GpMatrix **cloneMatrix) { GpMatrix *result; if (!matrix || !cloneMatrix) return InvalidParameter; result = GdipAlloc (sizeof (GpMatrix)); if (!result) return OutOfMemory; gdip_cairo_matrix_copy (result, matrix); *cloneMatrix = result; return Ok; } GpStatus WINGDIPAPI GdipDeleteMatrix (GpMatrix *matrix) { if (!matrix) return InvalidParameter; GdipFree (matrix); return Ok; } GpStatus WINGDIPAPI GdipSetMatrixElements (GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy) { if (!matrix) return InvalidParameter; cairo_matrix_init (matrix, m11, m12, m21, m22, dx, dy); return Ok; } GpStatus WINGDIPAPI GdipGetMatrixElements (GDIPCONST GpMatrix *matrix, REAL *matrixOut) { if (!matrix || !matrixOut) return InvalidParameter; matrixOut[0] = gdip_double_to_float (matrix->xx); matrixOut[1] = gdip_double_to_float (matrix->yx); matrixOut[2] = gdip_double_to_float (matrix->xy); matrixOut[3] = gdip_double_to_float (matrix->yy); matrixOut[4] = gdip_double_to_float (matrix->x0); matrixOut[5] = gdip_double_to_float (matrix->y0); return Ok; } GpStatus WINGDIPAPI GdipMultiplyMatrix (GpMatrix *matrix, GpMatrix *matrix2, GpMatrixOrder order) { if (!matrix || !matrix2) return InvalidParameter; if (matrix == matrix2) return ObjectBusy; switch (order) { case MatrixOrderAppend: cairo_matrix_multiply (matrix, matrix, matrix2); break; case MatrixOrderPrepend: cairo_matrix_multiply (matrix, matrix2, matrix); break; default: return InvalidParameter; } return Ok; } GpStatus WINGDIPAPI GdipTranslateMatrix (GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order) { cairo_matrix_t tmp; cairo_matrix_init_translate (&tmp, offsetX, offsetY); return GdipMultiplyMatrix (matrix, &tmp, order); } GpStatus WINGDIPAPI GdipScaleMatrix (GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order) { cairo_matrix_t tmp; cairo_matrix_init_scale (&tmp, scaleX, scaleY); return GdipMultiplyMatrix (matrix, &tmp, order); } GpStatus WINGDIPAPI GdipRotateMatrix (GpMatrix *matrix, REAL angle, GpMatrixOrder order) { cairo_matrix_t tmp; cairo_matrix_init_rotate (&tmp, angle * DEGTORAD); return GdipMultiplyMatrix (matrix, &tmp, order); } GpStatus WINGDIPAPI GdipShearMatrix (GpMatrix *matrix, REAL shearX, REAL shearY, GpMatrixOrder order) { cairo_matrix_t tmp; cairo_matrix_init (&tmp, 1, shearY, shearX, 1, 0, 0); return GdipMultiplyMatrix (matrix, &tmp, order); } GpStatus WINGDIPAPI GdipInvertMatrix (GpMatrix *matrix) { if (!matrix || gdip_is_matrix_with_boundary_values(matrix)) return InvalidParameter; return gdip_get_status (cairo_matrix_invert (matrix)); } GpStatus WINGDIPAPI GdipTransformMatrixPoints (GpMatrix *matrix, GpPointF *pts, INT count) { if (!matrix || !pts || count <= 0) return InvalidParameter; for (int i = 0; i < count; i++, pts++) { double x = pts->X; double y = pts->Y; cairo_matrix_transform_point (matrix, &x, &y); pts->X = (REAL) x; pts->Y = (REAL) y; } return Ok; } GpStatus WINGDIPAPI GdipTransformMatrixPointsI (GpMatrix *matrix, GpPoint *pts, INT count) { if (count < 0) return OutOfMemory; if (!matrix || !pts || count == 0) return InvalidParameter; for (int i = 0; i < count; i++, pts++) { double x = pts->X; double y = pts->Y; cairo_matrix_transform_point (matrix, &x, &y); pts->X = iround (x); pts->Y = iround (y); } return Ok; } GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints (GpMatrix *matrix, GpPointF *pts, INT count) { if (!matrix || !pts || count <= 0) return InvalidParameter; for (int i = 0; i < count; i++, pts++) { double x = pts->X; double y = pts->Y; cairo_matrix_transform_distance (matrix, &x, &y); pts->X = (REAL) x; pts->Y = (REAL) y; } return Ok; } GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI (GpMatrix *matrix, GpPoint *pts, INT count) { if (!matrix || !pts || count <= 0) return InvalidParameter; for (int i = 0; i < count; i++, pts++) { double x = pts->X; double y = pts->Y; cairo_matrix_transform_distance (matrix, &x, &y); pts->X = iround (x); pts->Y = iround (y); } return Ok; } GpStatus WINGDIPAPI GdipIsMatrixInvertible (GDIPCONST GpMatrix *matrix, BOOL *result) { cairo_status_t status; cairo_matrix_t copy; if (!matrix || !result) return InvalidParameter; if (gdip_is_matrix_with_boundary_values (matrix)) { *result = FALSE; return Ok; } gdip_cairo_matrix_copy (©, matrix); status = cairo_matrix_invert (©); *result = (status == CAIRO_STATUS_SUCCESS); return Ok; } GpStatus WINGDIPAPI GdipIsMatrixIdentity (GDIPCONST GpMatrix *matrix, BOOL *result) { if (!matrix || !result) return InvalidParameter; // We can't use GdipIsMatrixEqual as the precision is different. *result = gdip_is_matrix_empty (matrix); return Ok; } GpStatus WINGDIPAPI GdipIsMatrixEqual (GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result) { if (!matrix || !matrix2 || !result) return InvalidParameter; *result = ((matrix->xx == matrix2->xx) && (matrix->yx == matrix2->yx) && (matrix->xy == matrix2->xy) && (matrix->yy == matrix2->yy) && (matrix->x0 == matrix2->x0) && (matrix->y0 == matrix2->y0)); return Ok; } libgdiplus-6.0.4+dfsg/src/text-cairo.c0000644000175000017500000011225113542674535020350 0ustar directhexdirecthex/* * Copyright (c) 2003 Alexandre Pigolkine, Novell Inc. * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Sebastien Pouliot */ #include "gdiplus-private.h" #ifndef USE_PANGO_RENDERING #include #include "text-cairo-private.h" #include "graphics-private.h" #include "graphics-cairo-private.h" #include "brush-private.h" #include "font-private.h" /* * NOTE: all parameter's validations are done inside text.c */ #undef DRAWSTRING_DEBUG static int CalculateStringWidths (cairo_t *ct, GDIPCONST GpFont *gdiFont, GDIPCONST gunichar2 *stringUnicode, unsigned long StringDetailElements, GpStringDetailStruct *StringDetails) { size_t i; cairo_text_extents_t ext; GpStringDetailStruct *CurrentDetail; BYTE utf8[5]; CurrentDetail = StringDetails; for (i = 0; i < StringDetailElements; i++) { utf8[utf8_encode_ucs2char(*(stringUnicode + i), utf8)] = '\0'; cairo_text_extents(ct, (const char *) utf8, &ext); CurrentDetail->Width = ext.x_advance; CurrentDetail++; } return StringDetailElements; } #ifdef NOT_USED /* Currently not used */ static int CalculateStringWidthsUTF8 (cairo_t *ct, GDIPCONST GpFont *gdiFont, const BYTE *utf8, unsigned long StringDetailElements, GpStringDetailStruct *StringDetails) { FT_Face face; size_t i; gunichar *ucs4 = NULL; cairo_font_face_t *Font; GpStringDetailStruct *CurrentDetail; glong NumOfGlyphs; cairo_matrix_t matrix; #ifdef DRAWSTRING_DEBUG printf("CalculateStringWidths(font, %s, %d, details) called\n", utf8, StringDetailElements); #endif Font = (cairo_font_face_t *)gdiFont->cairofnt; face = gdip_cairo_ft_font_lock_face(Font); if (!face) return 0; cairo_get_font_matrix(ct, &matrix); cairo_matrix_scale(&matrix, gdiFont->sizeInPixels, gdiFont->sizeInPixels); ucs4 = g_utf8_to_ucs4 ((const gchar *) utf8, (glong)-1, NULL, &NumOfGlyphs, NULL); if ((NumOfGlyphs == 0) || (ucs4 == NULL)) { return 0; } CurrentDetail=StringDetails; for (i = 0; i < NumOfGlyphs; i++) { FT_Load_Glyph (face, FT_Get_Char_Index (face, ucs4[i]), FT_LOAD_DEFAULT); CurrentDetail->Width = DOUBLE_FROM_26_6 (face->glyph->advance.x); CurrentDetail++; } gdip_cairo_ft_font_unlock_face(Font); GdipFree(ucs4); #ifdef DRAWSTRING_DEBUG printf("CalculateStringWidths: string >%s< translated into %d glyphs\n", utf8, NumOfGlyphs); #endif return NumOfGlyphs; } #endif static GpStatus MeasureString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, int *length, GDIPCONST GpFont *font, GDIPCONST RectF *rc_org, GDIPCONST GpStringFormat *format, GpBrush *brush, RectF *boundingBox, int *codepointsFitted, int *linesFilled, WCHAR *CleanString, GpStringDetailStruct* StringDetails, GpDrawTextData *data) { BYTE *String; /* Holds the UTF8 version of our sanitized string */ unsigned long StringLen; /* Length of CleanString */ GDIPCONST WCHAR *Src; WCHAR *Dest; unsigned long i; unsigned long j; GpStringDetailStruct *CurrentDetail; GpStringDetailStruct *CurrentLineStart; /* For rendering engine, to bump LineLen */ float *TabStops; int NumOfTabStops; int WrapPoint; /* Array index of wrap character */ int WrapX; /* Width of text at wrap character */ float CursorX; /* Current X position of drawing cursor */ float CursorY; /* Current Y position of drawing cursor */ int MaxX; /* Largest X of cursor */ int MaxXatY; /* Y coordinate of line with largest X, needed for MaxX resetting on wrap */ int MaxY; /* Largest Y of cursor */ int FrameWidth; /* rc->Width (or rc->Height if vertical) */ int FrameHeight; /* rc->Height (or rc->Width if vertical) */ int AlignHorz; /* Horizontal Alignment mode */ int AlignVert; /* Vertical Alignment mode */ int LineHeight; /* Height of a line with given font */ cairo_font_extents_t FontExtent; /* Info about our font */ cairo_font_options_t *FontOptions; RectF rc_coords, *rc = &rc_coords; float FontSize; if (OPTIMIZE_CONVERSION (graphics)) { rc->X = rc_org->X; rc->Y = rc_org->Y; rc->Width = rc_org->Width; rc->Height = rc_org->Height; } else { rc->X = gdip_unitx_convgr (graphics, rc_org->X); rc->Y = gdip_unity_convgr (graphics, rc_org->Y); rc->Width = gdip_unitx_convgr (graphics, rc_org->Width); rc->Height = gdip_unity_convgr (graphics, rc_org->Height); } #ifdef DRAWSTRING_DEBUG printf("GdipDrawString(...) called (length=%d, fontsize=%d)\n", length, (int)font->sizeInPixels); #endif TabStops = format->tabStops; NumOfTabStops = format->numtabStops; /* Prepare our various buffers and variables */ StringLen = *length; if (data) data->has_hotkeys = FALSE; /* Set aliasing mode */ FontOptions = cairo_font_options_create(); switch(graphics->text_mode) { default: case TextRenderingHintSystemDefault: { cairo_font_options_set_antialias(FontOptions, CAIRO_ANTIALIAS_DEFAULT); //cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_NONE); //cairo_font_options_set_subpixel_order(FontOptions, CAIRO_SUBPIXEL_ORDER_DEFAULT); //cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_DEFAULT); //cairo_font_options_set_hint_metrics(FontOptions, CAIRO_HINT_METRICS_DEFAULT); break; } case TextRenderingHintSingleBitPerPixelGridFit: { cairo_font_options_set_antialias(FontOptions, CAIRO_ANTIALIAS_NONE); cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_MEDIUM); cairo_font_options_set_hint_metrics(FontOptions, CAIRO_HINT_METRICS_ON); break; } case TextRenderingHintSingleBitPerPixel: { cairo_font_options_set_antialias(FontOptions, CAIRO_ANTIALIAS_NONE); cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_NONE); cairo_font_options_set_hint_metrics(FontOptions, CAIRO_HINT_METRICS_OFF); break; } case TextRenderingHintAntiAliasGridFit: { cairo_font_options_set_antialias(FontOptions, CAIRO_ANTIALIAS_GRAY); cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_MEDIUM); cairo_font_options_set_hint_metrics(FontOptions, CAIRO_HINT_METRICS_ON); break; } case TextRenderingHintAntiAlias: { cairo_font_options_set_antialias(FontOptions, CAIRO_ANTIALIAS_GRAY); cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_NONE); cairo_font_options_set_hint_metrics(FontOptions, CAIRO_HINT_METRICS_OFF); break; } case TextRenderingHintClearTypeGridFit: { cairo_font_options_set_antialias(FontOptions, CAIRO_ANTIALIAS_SUBPIXEL); cairo_font_options_set_hint_style(FontOptions, CAIRO_HINT_STYLE_MEDIUM); cairo_font_options_set_hint_metrics(FontOptions, CAIRO_HINT_METRICS_ON); break; } } cairo_set_font_options(graphics->ct, FontOptions); cairo_font_options_destroy(FontOptions); // Do we want this here? /* Commented out until we properly save/restore AA settings; should fix bug #76135 cairo_set_antialias(graphics->ct, CAIRO_ANTIALIAS_NONE); */ /* Get font size information; how expensive is the cairo stuff here? */ cairo_set_font_face (graphics->ct, (cairo_font_face_t*) font->cairofnt); /* Set our font; this will also be used for later drawing */ /* this will always return the same value, except when printing */ FontSize = (graphics->type == gtPostScript) ? font->emSize : font->sizeInPixels; cairo_set_font_size (graphics->ct, FontSize); cairo_font_extents (graphics->ct, &FontExtent); /* Get the size we're looking for */ /* cairo_font_set_transform(font->cairofnt, SavedMatrix);*/ /* Restore the matrix */ if ((LineHeight=FontExtent.ascent)<1) { LineHeight=1; } #ifdef DRAWSTRING_DEBUG printf("Font extents: ascent:%d, descent: %d, height:%d, maxXadvance:%d, maxYadvance:%d\n", (int)FontExtent.ascent, (int)FontExtent.descent, (int)FontExtent.height, (int)FontExtent.max_x_advance, (int)FontExtent.max_y_advance); #endif /* Sanitize string, remove formatting chars and build description array */ #ifdef DRAWSTRING_DEBUG printf("GdipDrawString(...) Sanitizing string, StringLen=%d\n", StringLen); #endif Src=stringUnicode; /* unless specified we don't consider the trailing spaces, unless there is just one space (#80680) */ if ((format->formatFlags & StringFormatFlagsMeasureTrailingSpaces) == 0) { while ((StringLen > 0) && (isspace ((int) ( *(Src + StringLen - 1))))) StringLen--; if (StringLen == 0) StringLen = 1; } Dest=CleanString; CurrentDetail=StringDetails; for (i=0; i 0) { CurrentDetail->Flags |= STRING_DETAIL_TAB; } Src++; continue; } case '\n': { /* LF */ CurrentDetail->Flags |= STRING_DETAIL_LF; CurrentDetail->Linefeeds++; Src++; continue; } case '&': { /* We print *all* chars if no hotkeys */ if (format->hotkeyPrefix==HotkeyPrefixNone) { break; } Src++; if (*Src=='&') { /* We skipped the first '&', the break will make us drop to copying the second */ break; } CurrentDetail->Flags |= STRING_DETAIL_HOTKEY; if (data) data->has_hotkeys = TRUE; continue; } /* Boy, this must be slow, FIXME somehow */ default: { if (((format->formatFlags & StringFormatFlagsNoWrap)==0) || ((format->trimming != StringTrimmingCharacter) && (format->trimming != StringTrimmingNone))) { break; } } /* fall through */ case ' ': case '.': { /* Mark where we can break for a new line */ CurrentDetail->Flags |= STRING_DETAIL_BREAK; break; } } *Dest=*Src; Src++; Dest++; CurrentDetail++; } *Dest='\0'; /* Recalculate StringLen; we may have shortened String */ Dest=CleanString; StringLen=0; while (*Dest!=0) { StringLen++; Dest++; } /* Don't bother doing anything else if the length is 0 */ if (StringLen == 0) { *length = 0; return Ok; } /* Convert string from Gdiplus format to UTF8, suitable for cairo */ String = (BYTE*) utf16_to_utf8 ((const gunichar2 *)CleanString, -1); if (!String) return OutOfMemory; #ifdef DRAWSTRING_DEBUG printf("Sanitized string: >%s<, length %d (utf8-length:%d)\n", String, StringLen, strlen((char *)String)); #endif /* Generate size array */ if (CalculateStringWidths (graphics->ct, font, CleanString, StringLen, StringDetails)==0) { /* FIXME; pick right return code */ GdipFree(String); return Ok; } GdipFree (String); CursorX=0; CursorY=0; MaxX=0; MaxXatY=0; MaxY=0; CurrentLineStart=StringDetails; CurrentDetail=StringDetails; CurrentDetail->Flags |= STRING_DETAIL_LINESTART; WrapPoint=-1; WrapX=0; if (format->formatFlags & StringFormatFlagsDirectionVertical) { FrameWidth = SAFE_FLOAT_TO_UINT32 (rc->Height); FrameHeight = SAFE_FLOAT_TO_UINT32 (rc->Width); } else { FrameWidth = SAFE_FLOAT_TO_UINT32 (rc->Width); FrameHeight = SAFE_FLOAT_TO_UINT32 (rc->Height); } #ifdef DRAWSTRING_DEBUG printf("Frame %d x %d\n", FrameWidth, FrameHeight); #endif for (i=0; iFlags & STRING_DETAIL_TAB) { float tab_pos; int tab_index; tab_pos = format->firstTabOffset; tab_index = 0; while (CursorX > tab_pos) { tab_pos += TabStops[tab_index % NumOfTabStops]; tab_index++; } CursorX = tab_pos; CurrentLineStart = CurrentDetail; CurrentDetail->Flags |= STRING_DETAIL_LINESTART; } if (CurrentDetail->Flags & STRING_DETAIL_LF) { CursorX = 0; CursorY += LineHeight * CurrentDetail->Linefeeds; CurrentDetail->Flags |= STRING_DETAIL_LINESTART; CurrentLineStart = CurrentDetail; #ifdef DRAWSTRING_DEBUG { int j; for (j=0; jLinefeeds; j++) { printf("\n"); } } #endif } #ifdef DRAWSTRING_DEBUG printf("[%3d] X: %3d, Y:%3d, '%c' | ", i, (int)CursorX, (int)CursorY, CleanString[i]>=32 ? CleanString[i] : '?'); #endif /* Remember where to wrap next, but only if wrapping allowed */ if (((format->formatFlags & StringFormatFlagsNoWrap)==0) && (CurrentDetail->Flags & STRING_DETAIL_BREAK)) { if (CleanString[i] == ' ') { WrapPoint=i+1; /* We skip the break char itself, keeping it at the end of the old line */ } else { WrapPoint=i; } if (CursorX>MaxX) { WrapX=CursorX; } else { WrapX=MaxX; } #ifdef DRAWSTRING_DEBUG printf(""); #endif } /* New line voids any previous wrap point */ if (CurrentDetail->Flags & STRING_DETAIL_LINESTART) { WrapPoint=-1; } CurrentDetail->PosX=CursorX; CurrentDetail->PosY=CursorY; /* Advance cursor */ CursorX+=CurrentDetail->Width; if (MaxXFrameWidth) { if (WrapPoint!=-1) { /** Re-Calculate line lengths **/ /* Old line */ CurrentLineStart->LineLen-=i-WrapPoint; if (MaxXatY==CursorY) { MaxX=WrapX; } /* Remove the trailing space from being counted if we're not supposed to */ if (((format->formatFlags & StringFormatFlagsMeasureTrailingSpaces)==0) && (WrapPoint>0)) { if (CleanString[WrapPoint-1]==' ') { if (MaxXatY==CursorY) { MaxX-=StringDetails[WrapPoint-1].Width; } StringDetails[WrapPoint-1].Width=0; CurrentLineStart->LineLen--; } } /* New line */ CurrentLineStart=&(StringDetails[WrapPoint]); CurrentLineStart->Flags|=STRING_DETAIL_LINESTART; CurrentLineStart->LineLen=0; /* Generate CursorX/Y for new line */ CursorY+=LineHeight; CursorX=CurrentLineStart->Width; i=WrapPoint; #ifdef DRAWSTRING_DEBUG printf("\n\n", WrapPoint, CursorX, CurrentLineStart->LineLen); #endif CurrentDetail=&(StringDetails[WrapPoint]); CurrentDetail->PosX=0; CurrentDetail->PosY=CursorY; WrapPoint=-1; } else { /* This line is too long and has no wrap points, check if we need to insert ellipsis. To keep at least a bit of performance, we cheat - we don't actually calculate the size of the elipsis chars but assume that they're always smaller than any other character. And we don't try to hard to fit as many chars as possible. */ int EndOfLine; #ifdef DRAWSTRING_DEBUG printf("No wrappoint (yet) set\n"); #endif /* Find end of line, index i is the first char no longer visible on the line */ EndOfLine=i; if ((format->formatFlags & StringFormatFlagsNoWrap)==0) { while (EndOfLinetrimming==StringTrimmingEllipsisWord) || (format->trimming==StringTrimmingEllipsisCharacter)) { if (CurrentLineStart->LineLen>3) { if (format->trimming==StringTrimmingEllipsisCharacter) { CleanString[i-1]='.'; CleanString[i-2]='.'; CleanString[i-3]='.'; } else { int found=0; j=i; while(j>(i-CurrentLineStart->LineLen)) { if (CleanString[j]==' ') { CleanString[j]='.'; CurrentLineStart->LineLen-=i-j-1; if ((j+1)LineLen++; } if ((j+2)LineLen++; } found=1; break; } j--; } if (!found) { CleanString[i-1]='.'; CleanString[i-2]='.'; CleanString[i-3]='.'; } } } } else if (format->trimming==StringTrimmingEllipsisPath) { int k; float LineWidth; /* Find end of line, index i is the first char no longer visible on the line */ EndOfLine=i; while (EndOfLineLineLen>3) { j=i-(CurrentLineStart->LineLen/2); CleanString[j-1]='.'; CleanString[j]='.'; CleanString[j+1]='.'; /* Have just enough to include our ellipsis */ LineWidth=0; for (k=i-CurrentLineStart->LineLen; k<(j+1); k++) { LineWidth+=StringDetails[k].Width; } CurrentLineStart->LineLen=i-j+3; /* 3=ellipsis */ /* Now figure out how many chars from the end of the string we have to copy */ j+=2; /* Points to the char behind the last ellipsis */ k=EndOfLine-1; while ((LineWidth+StringDetails[k].Width)LineLen+=EndOfLine-k-1; } } else { #ifdef DRAWSTRING_DEBUG /* Just cut off the text */ printf("End of line at index:%d\n", EndOfLine); #endif CurrentLineStart->LineLen=EndOfLine; } if ((format->formatFlags & StringFormatFlagsNoWrap)!=0) { // Avoid endless loops, always print at least one char if (CurrentLineStart->LineLen == 0) { CurrentLineStart->LineLen = 1; } break; } /* avoid endless loop when wrapping is allowed */ if (CurrentLineStart->LineLen == 0) { CurrentLineStart->LineLen = 1; } /* New line */ CurrentLineStart=&(StringDetails[EndOfLine]); CurrentLineStart->Flags|=STRING_DETAIL_LINESTART; CurrentLineStart->LineLen=0; /* Generate CursorX/Y for new line */ CursorY+=LineHeight; CursorX=CurrentLineStart->Width; i=EndOfLine; CurrentDetail=&(StringDetails[EndOfLine]); CurrentDetail->PosX=0; CurrentDetail->PosY=CursorY; } } /* Still visible? */ if ((FrameWidth && CursorX>FrameWidth) || (FrameHeight && ((CursorY>FrameHeight) || ((format->formatFlags & StringFormatFlagsLineLimit) && (CursorY+LineHeight)>FrameHeight)))) { CurrentDetail->Flags|=STRING_DETAIL_HIDDEN; #ifdef DRAWSTRING_DEBUG if (CurrentDetail->Flags & STRING_DETAIL_LINESTART) { printf(""); } else { printf(""); } #endif } else { if (MaxYLineLen++; } /* We ignored it above, for shorter of calculations, also, add a bit of padding */ MaxY+=LineHeight+FontExtent.descent; #ifdef DRAWSTRING_DEBUG printf("\n"); printf("Bounding box: %d x %d\n", MaxX, MaxY); printf("Line layout [Total len %d]:\n", StringLen); for (i=0; ialignment; if (format->formatFlags & StringFormatFlagsDirectionRightToLeft) { if (format->alignment==StringAlignmentNear) { AlignHorz=StringAlignmentFar; } else if (format->alignment==StringAlignmentFar) { AlignHorz=StringAlignmentNear; } } AlignVert = format->lineAlignment; /* At this point we know our bounding box, what characters are to be displayed and where every character goes */ if (boundingBox) { boundingBox->X = rc->X; boundingBox->Y = rc->Y; if (format->formatFlags & StringFormatFlagsDirectionVertical) { boundingBox->Width = MaxY; boundingBox->Height = MaxX; } else { boundingBox->Width = MaxX; boundingBox->Height = MaxY; } if ((rc->Width > 0) && (boundingBox->Width > rc->Width)) { boundingBox->Width = rc->Width; } if ((rc->Height > 0) && (boundingBox->Height > rc->Height)) { boundingBox->Height = rc->Height; } /* avoid conversion computations if possible */ if (!OPTIMIZE_CONVERSION (graphics)) { boundingBox->X = gdip_convgr_unitx (graphics, boundingBox->X); boundingBox->Y = gdip_convgr_unity (graphics, boundingBox->Y); boundingBox->Width = gdip_convgr_unitx (graphics, boundingBox->Width); boundingBox->Height = gdip_convgr_unity (graphics, boundingBox->Height); } switch (AlignVert) { case StringAlignmentCenter: if (format->formatFlags & StringFormatFlagsDirectionVertical) { boundingBox->X += (FrameHeight - MaxY) * 0.5; } else { boundingBox->Y += (FrameHeight - MaxY) * 0.5; } break; case StringAlignmentFar: if (format->formatFlags & StringFormatFlagsDirectionVertical) { boundingBox->X += (FrameHeight - MaxY); } else { boundingBox->Y += (FrameHeight - MaxY); } break; } switch (AlignHorz) { case StringAlignmentCenter: if (format->formatFlags & StringFormatFlagsDirectionVertical) { boundingBox->Y += (FrameWidth - MaxX) * 0.5; } else { boundingBox->X += (FrameWidth - MaxX) * 0.5; } break; case StringAlignmentFar: if (format->formatFlags & StringFormatFlagsDirectionVertical) { boundingBox->Y += (FrameWidth - MaxX); } else { boundingBox->X += (FrameWidth - MaxX); } break; } } if (codepointsFitted) { /* how many characters from the string can be drawn in the boundingBox (#76664) */ double max_width = boundingBox ? (boundingBox->X + boundingBox->Width) : rc->X + min (MaxX, rc->Width); double max_height = boundingBox ? (boundingBox->Y + boundingBox->Height) : rc->Y + min (MaxY, rc->Height); int charactersFitted; for (charactersFitted = 0; charactersFitted < StringLen; charactersFitted++) { if ((StringDetails[charactersFitted].PosX + StringDetails[charactersFitted].Width) > max_width) break; if (StringDetails[charactersFitted].PosY + LineHeight > max_height) break; } *codepointsFitted = charactersFitted; } if (linesFilled) { /* how many *complete* lines fits in our calculated boundingBox */ double height = (boundingBox) ? boundingBox->Height : min (MaxY, rc->Height); *linesFilled = floor (height / LineHeight); } if (AlignHorz != StringAlignmentNear || AlignVert != StringAlignmentNear) { // Update alignment int length = 0; int current_line_length = 0; for (i = 0; i < StringLen; i++) { if (i == current_line_length) { length = StringDetails[i].LineLen; current_line_length = min(length + i, StringLen); } switch (AlignHorz) { case StringAlignmentNear: break; case StringAlignmentCenter: if ((current_line_length == 1) || (StringDetails [current_line_length - 1].PosX > 0)) { StringDetails[i].PosX += (FrameWidth - StringDetails [current_line_length - 1].PosX - StringDetails [current_line_length - 1].Width) / 2; } break; case StringAlignmentFar: StringDetails[i].PosX += FrameWidth - StringDetails [current_line_length - 1].PosX - StringDetails [current_line_length - 1].Width; break; } switch (AlignVert) { case StringAlignmentNear: break; case StringAlignmentCenter: StringDetails[i].PosY += (FrameHeight - MaxY) / 2; break; case StringAlignmentFar: StringDetails[i].PosY += FrameHeight - MaxY; break; } } } /* if asked, supply extra data to be reused when drawing the same string */ if (data) { data->align_horz = AlignHorz; data->align_vert = AlignVert; data->line_height = LineHeight; data->max_y = MaxY; data->descent = FontExtent.descent; } return Ok; } static GpStatus DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, int length, GDIPCONST GpFont *font, GDIPCONST RectF *rc_org, GDIPCONST GpStringFormat *fmt, GpBrush *brush, WCHAR *CleanString, GpStringDetailStruct* StringDetails, GpDrawTextData *data) { float CursorX = 0.0; /* Current X position of drawing cursor */ float CursorY = 0.0; /* Current Y position of drawing cursor */ int StringLen = length; BOOL SetClipping = FALSE; unsigned long i, j; int LineHeight = data->line_height; cairo_font_extents_t FontExtent; RectF rect, *rc = ▭ cairo_font_extents (graphics->ct, &FontExtent); if (OPTIMIZE_CONVERSION (graphics)) { rc->X = rc_org->X; rc->Y = rc_org->Y; rc->Width = rc_org->Width; rc->Height = rc_org->Height; } else { rc->X = gdip_unitx_convgr (graphics, rc_org->X); rc->Y = gdip_unity_convgr (graphics, rc_org->Y); rc->Width = gdip_unitx_convgr (graphics, rc_org->Width); rc->Height = gdip_unity_convgr (graphics, rc_org->Height); } /* Set our clipping rectangle */ if ((rc->Width!=0) && (rc->Height!=0) && ((fmt->formatFlags & StringFormatFlagsNoClip)==0)) { #ifdef DRAWSTRING_DEBUG printf("Setting clipping rectangle (%f, %f %fx%f)\n", rc->X, rc->Y, rc->Width, rc->Height); #endif /* We do not call cairo_reset_clip because we want to take previous clipping into account */ gdip_cairo_rectangle (graphics, rc->X, rc->Y, rc->Width, rc->Height, TRUE); cairo_clip (graphics->ct); SetClipping = TRUE; } /* Setup cairo */ if (brush) { gdip_brush_setup (graphics, (GpBrush *)brush); } else { cairo_set_source_rgb (graphics->ct, 0., 0., 0.); } for (i=0; i StringLen - i) length = StringLen - i; String = (BYTE*) utf16_to_utf8 ((const gunichar2 *)(CleanString+i), length); #ifdef DRAWSTRING_DEBUG printf("Displaying line >%s< (%d chars)\n", String, length); #endif if ((fmt->formatFlags & StringFormatFlagsDirectionVertical)==0) { CursorX = rc->X + StringDetails[i].PosX; CursorY = rc->Y + StringDetails[i].PosY + LineHeight; gdip_cairo_move_to (graphics, CursorX, CursorY, FALSE, TRUE); cairo_show_text (graphics->ct, (const char *) String); } else { CursorY = rc->Y + StringDetails[i].PosX; CursorX = rc->X + StringDetails[i].PosY; /* Rotate text for vertical drawing */ cairo_save (graphics->ct); gdip_cairo_move_to (graphics, CursorX, CursorY, FALSE, TRUE); cairo_rotate (graphics->ct, PI/2); cairo_show_text (graphics->ct, (const char *) String); cairo_restore (graphics->ct); } #ifdef DRAWSTRING_DEBUG printf("Drawing %d chars at %d x %d (width=%f pixels)\n", StringDetails[i].LineLen, (int)CursorX, (int)CursorY, StringDetails[i+StringDetails[i].LineLen-1].PosX); #endif GdipFree (String); if (font->style & (FontStyleUnderline | FontStyleStrikeout)) { double line_width = cairo_get_line_width (graphics->ct); /* Calculate the width of the line */ cairo_set_line_width (graphics->ct, 1.0); j=StringDetails[i+StringDetails[i].LineLen-1].PosX+StringDetails[i+StringDetails[i].LineLen-1].Width; if (font->style & FontStyleStrikeout) { if ((fmt->formatFlags & StringFormatFlagsDirectionVertical)==0) { gdip_cairo_move_to (graphics, (int)(CursorX), (int)(CursorY-FontExtent.descent), FALSE, TRUE); gdip_cairo_line_to (graphics, (int)(CursorX+j), (int)(CursorY-FontExtent.descent), FALSE, TRUE); } else { gdip_cairo_move_to (graphics, (int)(CursorX+FontExtent.descent), (int)(CursorY), FALSE, TRUE); gdip_cairo_line_to (graphics, (int)(CursorX+FontExtent.descent), (int)(CursorY+j), FALSE, TRUE); } } if (font->style & FontStyleUnderline) { if ((fmt->formatFlags & StringFormatFlagsDirectionVertical)==0) { gdip_cairo_move_to (graphics, (int)(CursorX), (int)(CursorY+FontExtent.descent-2), FALSE, TRUE); gdip_cairo_line_to (graphics, (int)(CursorX+j), (int)(CursorY+FontExtent.descent-2), FALSE, TRUE); } else { gdip_cairo_move_to (graphics, (int)(CursorX+FontExtent.descent-2), (int)(CursorY), FALSE, TRUE); gdip_cairo_line_to (graphics, (int)(CursorX+FontExtent.descent-2), (int)(CursorY+j), FALSE, TRUE); } } cairo_stroke (graphics->ct); cairo_set_line_width (graphics->ct, line_width); } i+=StringDetails[i].LineLen-1; } } /* Handle Hotkey prefix */ if (fmt->hotkeyPrefix==HotkeyPrefixShow && data->has_hotkeys) { GpStringDetailStruct *CurrentDetail = StringDetails; for (i=0; iFlags & STRING_DETAIL_HOTKEY) { if ((fmt->formatFlags & StringFormatFlagsDirectionVertical)==0) { CursorX = rc->X + StringDetails[i].PosX; CursorY = rc->Y + StringDetails[i].PosY + LineHeight; } else { CursorY = rc->Y + StringDetails[i].PosX; CursorX = rc->X + StringDetails[i].PosY; } if ((fmt->formatFlags & StringFormatFlagsDirectionVertical)==0) { cairo_set_line_width(graphics->ct, 1); gdip_cairo_move_to (graphics, (int)(CursorX), (int)(CursorY+FontExtent.descent), FALSE, TRUE); gdip_cairo_line_to (graphics, (int)(CursorX+CurrentDetail->Width), (int)(CursorY+FontExtent.descent), FALSE, TRUE); cairo_stroke (graphics->ct); } else { gdip_cairo_move_to (graphics, (int)(CursorX-FontExtent.descent), (int)(CursorY), FALSE, TRUE); gdip_cairo_line_to (graphics, (int)(CursorX-FontExtent.descent), (int)(CursorY+CurrentDetail->Width), FALSE, TRUE); } } CurrentDetail++; } } /* Restore the graphics clipping region */ if (SetClipping) cairo_SetGraphicsClip (graphics); return Ok; } static GpStatus AllocStringData (WCHAR **clean_string, GpStringDetailStruct **details, int length) { *details = gdip_calloc (length + 1, sizeof (GpStringDetailStruct)); if (!*details) return OutOfMemory; *clean_string = GdipAlloc (sizeof (WCHAR) * (length + 1)); if (!*clean_string) { GdipFree (*details); return OutOfMemory; } return Ok; } GpStatus cairo_DrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, GpBrush *brush) { cairo_matrix_t SavedMatrix; GpStringFormat *fmt; GpStringDetailStruct *StringDetails; WCHAR *CleanString; GpDrawTextData data; /* avoid recomputation of stuff done while measuring */ int StringLen = length; GpStatus status = AllocStringData (&CleanString, &StringDetails, length); if (status != Ok) return status; /* a NULL format is valid, it means get the generic default values (and free them later) */ if (!format) { GdipStringFormatGetGenericDefault ((GpStringFormat **)&fmt); } else { fmt = (GpStringFormat *)format; } /* is the following ok ? */ cairo_get_font_matrix (graphics->ct, &SavedMatrix); status = MeasureString (graphics, stringUnicode, &StringLen, font, rc, fmt, brush, NULL, NULL, NULL, CleanString, StringDetails, &data); if ((status == Ok) && (StringLen > 0)) { status = DrawString (graphics, stringUnicode, StringLen, font, rc, fmt, brush, CleanString, StringDetails, &data); } /* Restore matrix to original values */ cairo_set_font_matrix (graphics->ct, &SavedMatrix); /* Cleanup */ GdipFree (CleanString); GdipFree (StringDetails); /* we must delete the default stringformat (when one wasn't provided by the caller) */ if (format != fmt) GdipDeleteStringFormat (fmt); return status; } GpStatus cairo_MeasureString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rc, GDIPCONST GpStringFormat *format, RectF *boundingBox, INT *codepointsFitted, INT *linesFilled) { cairo_matrix_t SavedMatrix; GpStringFormat *fmt; GpStringDetailStruct *StringDetails; WCHAR *CleanString; int StringLen = length; GpStatus status; status = AllocStringData (&CleanString, &StringDetails, length); if (status != Ok) return status; /* a NULL format is valid, it means get the generic default values (and free them later) */ if (!format) { GdipStringFormatGetGenericDefault ((GpStringFormat **)&fmt); } else { fmt = (GpStringFormat *)format; } /* is the following ok ? */ cairo_get_font_matrix (graphics->ct, &SavedMatrix); status = MeasureString (graphics, stringUnicode, &StringLen, font, rc, fmt, NULL, boundingBox, codepointsFitted, linesFilled, CleanString, StringDetails, NULL); /* Restore matrix to original values */ cairo_set_font_matrix (graphics->ct, &SavedMatrix); /* Cleanup */ GdipFree (CleanString); GdipFree (StringDetails); /* we must delete the default stringformat (when one wasn't provided by the caller) */ if (format != fmt) GdipDeleteStringFormat (fmt); return status; } GpStatus cairo_MeasureCharacterRanges (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, INT length, GDIPCONST GpFont *font, GDIPCONST GpRectF *layout, GDIPCONST GpStringFormat *format, INT regionCount, GpRegion **regions) { int i, j, start, end; int lineHeight; CharacterRange range; GpStringDetailStruct* StringDetails; RectF charRect; RectF rc_coords, *layoutRect = &rc_coords; BOOL optimize_convert; WCHAR *CleanString; GpDrawTextData data; /* avoid recomputation of stuff done while measuring */ int StringLen = length; GpStatus status = AllocStringData (&CleanString, &StringDetails, length); if (status != Ok) return status; /* avoid conversion if possible */ optimize_convert = OPTIMIZE_CONVERSION (graphics); if (optimize_convert) { layoutRect->X = layout->X; layoutRect->Y = layout->Y; layoutRect->Width = layout->Width; layoutRect->Height = layout->Height; } else { layoutRect->X = gdip_unitx_convgr (graphics, layout->X); layoutRect->Y = gdip_unity_convgr (graphics, layout->Y); layoutRect->Width = gdip_unitx_convgr (graphics, layout->Width); layoutRect->Height = gdip_unity_convgr (graphics, layout->Height); } if (layoutRect->Width <= 0.0) { if (layoutRect->Height < 0.0) { /* special case only if BOTH values are negative */ for (i = 0; i < format->charRangeCount; i++) GdipSetInfinite (regions [i]); status = Ok; goto cleanup; } else { layoutRect->Width = REGION_INFINITE_LENGTH; } } if (layoutRect->Height <= 0.0) { layoutRect->Height = REGION_INFINITE_LENGTH; } /* string measurements */ status = MeasureString (graphics, stringUnicode, &StringLen, font, layoutRect, format, NULL, NULL, NULL, NULL, CleanString, StringDetails, &data); if (status != Ok) goto cleanup; lineHeight = data.line_height + data.descent; /* Create a region for every char range */ for (i = 0; i < format->charRangeCount; i++) { range = format->charRanges [i]; GdipSetEmpty (regions [i]); if (range.Length > 0) start = range.First; else start = range.First + range.Length; end = start + range.Length; /* sanity check on charRange. negative lengths are allowed */ if (range.First < 0) { status = InvalidParameter; goto cleanup; } if ((start < 0) || (end > length)) { status = InvalidParameter; goto cleanup; } /* calculate the regions */ for (j = start; j < end; j++) { /* the prefix char (&) always count - even if we are not actually print it as a char */ if ((StringDetails[j].Flags & STRING_DETAIL_HOTKEY) && (format->hotkeyPrefix != HotkeyPrefixNone)) { end--; /* '&' count as invisible char */ continue; } /* workaround the fact that current implementation thinks LF is on the next line */ if ((j == end - 1) && (StringDetails[j].Flags & STRING_DETAIL_LF)) continue; if (format->formatFlags & StringFormatFlagsDirectionVertical) { charRect.X = layoutRect->X + StringDetails [j].PosY; charRect.Y = layoutRect->Y + StringDetails [j].PosX; charRect.Width = lineHeight; charRect.Height = StringDetails [j].Width; } else { charRect.X = layoutRect->X + StringDetails [j].PosX; charRect.Y = layoutRect->Y + StringDetails [j].PosY; charRect.Width = StringDetails [j].Width; charRect.Height = lineHeight; } if (optimize_convert) { charRect.X = gdip_convgr_unitx (graphics, charRect.X); charRect.Y = gdip_convgr_unity (graphics, charRect.Y); charRect.Width = gdip_convgr_unitx (graphics, charRect.Width); charRect.Height = gdip_convgr_unity (graphics, charRect.Height); } status = GdipCombineRegionRect (regions [i], &charRect, CombineModeUnion); if (status != Ok) break; } if (status != Ok) break; } cleanup: /* Cleanup */ GdipFree (CleanString); GdipFree (StringDetails); return status; } #endif libgdiplus-6.0.4+dfsg/src/imageattributes.h0000644000175000017500000000745513542672033021467 0ustar directhexdirecthex/* * 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. * * Authors: * Alexandre Pigolkine (pigolkine@gmx.de) * Duncan Mak (duncan@ximian.com) * Miguel de Icaza (miguel@ximian.com) * Ravindra (rkumar@novell.com) * Sanjay Gupta (gsanjay@novell.com) * Vladimir Vukicevic (vladimir@pobox.com) * Geoff Norton (gnorton@customerdna.com) * Jonathan Gilbert (logic@deltaq.org) * Sebastien Pouliot * * Copyright (C) 2003-2007 Novell, Inc (http://www.novell.com) */ #ifndef __IMAGEATTRIBUTES_H__ #define __IMAGEATTRIBUTES_H__ /* ImageAttributes public API (only!) */ GpStatus WINGDIPAPI GdipCreateImageAttributes (GpImageAttributes **imageattr); GpStatus WINGDIPAPI GdipCloneImageAttributes (GDIPCONST GpImageAttributes *imageattr, GpImageAttributes **cloneImageattr); GpStatus WINGDIPAPI GdipDisposeImageAttributes (GpImageAttributes *imageattr); GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity (GpImageAttributes *imageattr, ColorAdjustType type); GpStatus WINGDIPAPI GdipResetImageAttributes (GpImageAttributes *imageattr, ColorAdjustType type); GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette(GpImageAttributes *imageattr, ColorPalette *colorPalette, ColorAdjustType colorAdjustType); GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh); GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix, GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags); GpStatus WINGDIPAPI GdipSetImageAttributesGamma (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, REAL gamma); GpStatus WINGDIPAPI GdipSetImageAttributesNoOp (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag); GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags); GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, GDIPCONST WCHAR *colorProfileFilename); GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, UINT mapSize, GDIPCONST ColorMap *map); GpStatus WINGDIPAPI GdipSetImageAttributesThreshold (GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, REAL threshold); GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode (GpImageAttributes *imageattr, WrapMode wrap, ARGB argb, BOOL clamp); GpStatus WINGDIPAPI GdipSetImageAttributesICMMode (GpImageAttributes *imageAttr, BOOL on); GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground (GpImageAttributes *imageattr, BOOL enableFlag); #endif libgdiplus-6.0.4+dfsg/src/emfplus.h0000644000175000017500000000274312377405421017744 0ustar directhexdirecthex/* * Copyright (C) 2007 Novell, Inc (http://www.novell.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. * * Authors: * Sebastien Pouliot */ #ifndef __EMFPLUS_H__ #define __EMFPLUS_H__ #include "gdiplus-private.h" #include "metafile-private.h" #include "emfcodec.h" #include "graphics.h" #include "solidbrush-private.h" /* * Some interesting links... * [EMF+ Metafile Record Format Documentation] http://www.aces.uiuc.edu/~jhtodd/Metafile/ */ #endif libgdiplus-6.0.4+dfsg/test-driver0000755000175000017500000001104013256032133017506 0ustar directhexdirecthex#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libgdiplus-6.0.4+dfsg/COPYING0000644000175000017500000000010313542672033016350 0ustar directhexdirecthexSee LICENSE file in the project root for full license information. libgdiplus-6.0.4+dfsg/ChangeLog0000644000175000017500000000004613542672033017075 0ustar directhexdirecthexCheck git history for latest changes. libgdiplus-6.0.4+dfsg/NEWS0000644000175000017500000000012113542672033016014 0ustar directhexdirecthexSee http://www.mono-project.com/docs/gui/libgdiplus/ for the most recent details libgdiplus-6.0.4+dfsg/Makefile.in0000644000175000017500000007103113545371055017375 0ustar directhexdirecthex# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = libgdiplus.pc libgdiplus0.spec CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/libgdiplus.pc.in $(srcdir)/libgdiplus0.spec.in \ AUTHORS COPYING ChangeLog INSTALL NEWS TODO compile \ config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_DEPENDENCIES_CFLAGS = @BASE_DEPENDENCIES_CFLAGS@ BASE_DEPENDENCIES_LIBS = @BASE_DEPENDENCIES_LIBS@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_CONFIG = @FONTCONFIG_CONFIG@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FREETYPE_CONFIG = @FREETYPE_CONFIG@ GDIPLUS_CFLAGS = @GDIPLUS_CFLAGS@ GDIPLUS_LIBS = @GDIPLUS_LIBS@ GDIPLUS_PKG_CFLAGS = @GDIPLUS_PKG_CFLAGS@ GDIPLUS_PKG_LIBS = @GDIPLUS_PKG_LIBS@ GDIPLUS_PKG_REQ = @GDIPLUS_PKG_REQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBEXIF_CFLAGS = @LIBEXIF_CFLAGS@ LIBEXIF_LIBS = @LIBEXIF_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANGO_CFLAGS = @PANGO_CFLAGS@ PANGO_LIBS = @PANGO_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src tests DIST_SUBDIRS = src tests pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libgdiplus.pc DISTCLEANFILES = libgdiplus.pc EXTRA_DIST = libgdiplus.pc.in README.md LICENSE libgdiplus.sln winconfig.h.in all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 libgdiplus.pc: $(top_builddir)/config.status $(srcdir)/libgdiplus.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libgdiplus0.spec: $(top_builddir)/config.status $(srcdir)/libgdiplus0.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libgdiplus-6.0.4+dfsg/INSTALL0000644000175000017500000002243212377405421016357 0ustar directhexdirecthexInstallation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Here is a another example: /bin/bash ./configure CONFIG_SHELL=/bin/bash Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libgdiplus-6.0.4+dfsg/configure0000755000175000017500000173007213545371055017247 0ustar directhexdirecthex#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libgdiplus 6.0.4. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://github.com/mono/mono/issues/new about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libgdiplus' PACKAGE_TARNAME='libgdiplus' PACKAGE_VERSION='6.0.4' PACKAGE_STRING='libgdiplus 6.0.4' PACKAGE_BUGREPORT='https://github.com/mono/mono/issues/new' PACKAGE_URL='' ac_unique_file="README.md" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS GDIPLUS_PKG_REQ GDIPLUS_PKG_CFLAGS GDIPLUS_PKG_LIBS GDIPLUS_CFLAGS GDIPLUS_LIBS HAVE_LIBEXIF_FALSE HAVE_LIBEXIF_TRUE LIBEXIF_LIBS LIBEXIF_CFLAGS HAVE_X11_FALSE HAVE_X11_TRUE FREETYPE_CONFIG FREETYPE2_LIBS FREETYPE2_CFLAGS FONTCONFIG_CONFIG FONTCONFIG_LIBS FONTCONFIG_CFLAGS USE_PANGO_RENDERING_FALSE USE_PANGO_RENDERING_TRUE PANGO_LIBS PANGO_CFLAGS CAIRO_LIBS CAIRO_CFLAGS BASE_DEPENDENCIES_LIBS BASE_DEPENDENCIES_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock with_pango enable_warnaserror enable_asan enable_coverage with_libexif with_libjpeg with_libtiff with_libgif with_x11 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR BASE_DEPENDENCIES_CFLAGS BASE_DEPENDENCIES_LIBS CAIRO_CFLAGS CAIRO_LIBS PANGO_CFLAGS PANGO_LIBS FONTCONFIG_CFLAGS FONTCONFIG_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS LIBEXIF_CFLAGS LIBEXIF_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libgdiplus 6.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libgdiplus] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libgdiplus 6.0.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-warnaserror Enable treating warnings as errors. --enable-asan Enable address sanitizer. --enable-coverage Enable code coverage. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-pango use Pango to measure and draw text --without-libexif disable EXIF support --with-libjpeg=PREFIX Prefix where libjpeg is installed, or 'no' to disable --with-libtiff=PREFIX Prefix where libtiff is installed, or 'no' to disable --with-libgif=PREFIX Prefix where libgif is installed, or 'no' to disable --without-x11 Disable X11 support Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path BASE_DEPENDENCIES_CFLAGS C compiler flags for BASE_DEPENDENCIES, overriding pkg-config BASE_DEPENDENCIES_LIBS linker flags for BASE_DEPENDENCIES, overriding pkg-config CAIRO_CFLAGS C compiler flags for CAIRO, overriding pkg-config CAIRO_LIBS linker flags for CAIRO, overriding pkg-config PANGO_CFLAGS C compiler flags for PANGO, overriding pkg-config PANGO_LIBS linker flags for PANGO, overriding pkg-config FONTCONFIG_CFLAGS C compiler flags for FONTCONFIG, overriding pkg-config FONTCONFIG_LIBS linker flags for FONTCONFIG, overriding pkg-config FREETYPE2_CFLAGS C compiler flags for FREETYPE2, overriding pkg-config FREETYPE2_LIBS linker flags for FREETYPE2, overriding pkg-config LIBEXIF_CFLAGS C compiler flags for LIBEXIF, overriding pkg-config LIBEXIF_LIBS linker flags for LIBEXIF, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libgdiplus configure 6.0.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------------ ## ## Report this to https://github.com/mono/mono/issues/new ## ## ------------------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libgdiplus $as_me 6.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libgdiplus' VERSION='6.0.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$PKG_CONFIG" = "xno"; then as_fn_error $? "You need to install pkg-config" "$LINENO" 5 fi GLIB_REQUIRED_VERSION="2.2.3" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASE_DEPENDENCIES" >&5 $as_echo_n "checking for BASE_DEPENDENCIES... " >&6; } if test -n "$BASE_DEPENDENCIES_CFLAGS"; then pkg_cv_BASE_DEPENDENCIES_CFLAGS="$BASE_DEPENDENCIES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASE_DEPENDENCIES_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $GLIB_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$BASE_DEPENDENCIES_LIBS"; then pkg_cv_BASE_DEPENDENCIES_LIBS="$BASE_DEPENDENCIES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASE_DEPENDENCIES_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $GLIB_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then BASE_DEPENDENCIES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $GLIB_REQUIRED_VERSION" 2>&1` else BASE_DEPENDENCIES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $GLIB_REQUIRED_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$BASE_DEPENDENCIES_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= $GLIB_REQUIRED_VERSION) were not met: $BASE_DEPENDENCIES_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else BASE_DEPENDENCIES_CFLAGS=$pkg_cv_BASE_DEPENDENCIES_CFLAGS BASE_DEPENDENCIES_LIBS=$pkg_cv_BASE_DEPENDENCIES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi GDIPLUS_LIBS="`$PKG_CONFIG --libs glib-2.0 `" GDIPLUS_CFLAGS="`$PKG_CONFIG --cflags glib-2.0 `" CAIRO_REQUIRED_VERSION="1.6.4" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 $as_echo_n "checking for CAIRO... " >&6; } if test -n "$CAIRO_CFLAGS"; then pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo >= \$CAIRO_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo >= $CAIRO_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= $CAIRO_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_LIBS"; then pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo >= \$CAIRO_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo >= $CAIRO_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= $CAIRO_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo >= $CAIRO_REQUIRED_VERSION" 2>&1` else CAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo >= $CAIRO_REQUIRED_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (cairo >= $CAIRO_REQUIRED_VERSION) were not met: $CAIRO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CAIRO_CFLAGS and CAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CAIRO_CFLAGS and CAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS CAIRO_LIBS=$pkg_cv_CAIRO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Optional use of Pango's text rendering on top of Cairo # Check whether --with-pango was given. if test "${with_pango+set}" = set; then : withval=$with_pango; text_v=pango else text_v=default fi GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -std=gnu99" # Check whether --enable-warnaserror was given. if test "${enable_warnaserror+set}" = set; then : enableval=$enable_warnaserror; warnaserror=yes else warnaserror=no fi if test $warnaserror = "yes"; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Werror -Wno-unknown-warning-option -Wno-clobbered -Wno-typedef-redefinition" fi # Check whether --enable-asan was given. if test "${enable_asan+set}" = set; then : enableval=$enable_asan; asan=yes else asan=no fi if test $asan = "yes"; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -fsanitize=address,signed-integer-overflow,undefined -g -O1" LDFLAGS="$LDFLAGS -fsanitize=address,signed-integer-overflow,undefined" fi # Check whether --enable-coverage was given. if test "${enable_coverage+set}" = set; then : enableval=$enable_coverage; coverage=yes else coverage=no fi if test $coverage = "yes"; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS --coverage -g" LDFLAGS="$LDFLAGS --coverage" fi CAIRO_LIBS="`pkg-config --libs cairo `" CAIRO_CFLAGS="`pkg-config --cflags cairo `" cairo_info="`pkg-config --modversion cairo ` (system)" GDIPLUS_PKG_REQ="cairo" PANGO_REQUIRED_VERSION="1.40.14" PANGO_MAX_VERSION="1.43" if test $text_v = "pango"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGO" >&5 $as_echo_n "checking for PANGO... " >&6; } if test -n "$PANGO_CFLAGS"; then pkg_cv_PANGO_CFLAGS="$PANGO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pango >= \$PANGO_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "pango >= $PANGO_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PANGO_LIBS"; then pkg_cv_PANGO_LIBS="$PANGO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pango >= \$PANGO_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "pango >= $PANGO_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PANGO_LIBS=`$PKG_CONFIG --libs "pango >= $PANGO_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PANGO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pango >= $PANGO_REQUIRED_VERSION" 2>&1` else PANGO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pango >= $PANGO_REQUIRED_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PANGO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (pango >= $PANGO_REQUIRED_VERSION) were not met: $PANGO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PANGO_CFLAGS and PANGO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PANGO_CFLAGS and PANGO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else PANGO_CFLAGS=$pkg_cv_PANGO_CFLAGS PANGO_LIBS=$pkg_cv_PANGO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test $text_v = "default"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGO" >&5 $as_echo_n "checking for PANGO... " >&6; } if test -n "$PANGO_CFLAGS"; then pkg_cv_PANGO_CFLAGS="$PANGO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pango >= \$PANGO_REQUIRED_VERSION && pango <= \$PANGO_MAX_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PANGO_LIBS"; then pkg_cv_PANGO_LIBS="$PANGO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pango >= \$PANGO_REQUIRED_VERSION && pango <= \$PANGO_MAX_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PANGO_LIBS=`$PKG_CONFIG --libs "pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PANGO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION" 2>&1` else PANGO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pango >= $PANGO_REQUIRED_VERSION && pango <= $PANGO_MAX_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PANGO_PKG_ERRORS" >&5 text_v=cairo elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } text_v=cairo else PANGO_CFLAGS=$pkg_cv_PANGO_CFLAGS PANGO_LIBS=$pkg_cv_PANGO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } text_v=pango fi fi if test $text_v = "pango"; then PANGO_LIBS="`pkg-config --libs pangocairo `" PANGO_CFLAGS="`pkg-config --cflags pangocairo `" $as_echo "#define USE_PANGO_RENDERING 1" >>confdefs.h GDIPLUS_PKG_REQ="$GDIPLUS_PKG_REQ pangocairo-1.0" fi if test $text_v = "pango"; then USE_PANGO_RENDERING_TRUE= USE_PANGO_RENDERING_FALSE='#' else USE_PANGO_RENDERING_TRUE='#' USE_PANGO_RENDERING_FALSE= fi GDIPLUS_LIBS="$GDIPLUS_LIBS $CAIRO_LIBS $PANGO_LIBS" GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS $CAIRO_CFLAGS $PANGO_CFLAGS" # Fall back to using fontconfig/freetype-config if their .pc is not found pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FONTCONFIG" >&5 $as_echo_n "checking for FONTCONFIG... " >&6; } if test -n "$FONTCONFIG_CFLAGS"; then pkg_cv_FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5 ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FONTCONFIG_LIBS"; then pkg_cv_FONTCONFIG_LIBS="$FONTCONFIG_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5 ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fontconfig" 2>&1` else FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fontconfig" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FONTCONFIG_PKG_ERRORS" >&5 fontconfig_pkgconfig=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fontconfig_pkgconfig=no else FONTCONFIG_CFLAGS=$pkg_cv_FONTCONFIG_CFLAGS FONTCONFIG_LIBS=$pkg_cv_FONTCONFIG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fontconfig_pkgconfig=yes fi if test "x$FONTCONFIG" = "xno"; then # Extract the first word of "fontconfig-config", so it can be a program name with args. set dummy fontconfig-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FONTCONFIG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $FONTCONFIG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_FONTCONFIG_CONFIG="$FONTCONFIG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FONTCONFIG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FONTCONFIG_CONFIG" && ac_cv_path_FONTCONFIG_CONFIG="no" ;; esac fi FONTCONFIG_CONFIG=$ac_cv_path_FONTCONFIG_CONFIG if test -n "$FONTCONFIG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_CONFIG" >&5 $as_echo "$FONTCONFIG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$FONTCONFIG_CONFIG" = "xyes"; then FONTCONFIG_CFLAGS="`fontconfig-config --cflags`" FONTCONFIG_LIBS="`fontconfig-config --libs`" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcInit in -lfontconfig" >&5 $as_echo_n "checking for FcInit in -lfontconfig... " >&6; } if ${ac_cv_lib_fontconfig_FcInit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfontconfig $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char FcInit (); int main () { return FcInit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fontconfig_FcInit=yes else ac_cv_lib_fontconfig_FcInit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fontconfig_FcInit" >&5 $as_echo "$ac_cv_lib_fontconfig_FcInit" >&6; } if test "x$ac_cv_lib_fontconfig_FcInit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFONTCONFIG 1 _ACEOF LIBS="-lfontconfig $LIBS" fi for ac_func in FcFini do : ac_fn_c_check_func "$LINENO" "FcFini" "ac_cv_func_FcFini" if test "x$ac_cv_func_FcFini" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCFINI 1 _ACEOF fi done pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE2" >&5 $as_echo_n "checking for FREETYPE2... " >&6; } if test -n "$FREETYPE2_CFLAGS"; then pkg_cv_FREETYPE2_CFLAGS="$FREETYPE2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FREETYPE2_LIBS"; then pkg_cv_FREETYPE2_LIBS="$FREETYPE2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREETYPE2_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "freetype2" 2>&1` else FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "freetype2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FREETYPE2_PKG_ERRORS" >&5 freetype2_pkgconfig=no] elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } freetype2_pkgconfig=no] else FREETYPE2_CFLAGS=$pkg_cv_FREETYPE2_CFLAGS FREETYPE2_LIBS=$pkg_cv_FREETYPE2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } freetype2_pkgconfig=yes fi if test "x$FREETYPE2" = "xno"; then # Extract the first word of "freetype-config", so it can be a program name with args. set dummy freetype-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FREETYPE_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $FREETYPE_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FREETYPE_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FREETYPE_CONFIG" && ac_cv_path_FREETYPE_CONFIG="no" ;; esac fi FREETYPE_CONFIG=$ac_cv_path_FREETYPE_CONFIG if test -n "$FREETYPE_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_CONFIG" >&5 $as_echo "$FREETYPE_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$FREETYPE_CONFIG" = "xyes"; then FREETYPE2_CFLAGS="`freetype-config --cflags`" FREETYPE2_LIBS="`freetype-config --libs`" fi fi GDIPLUS_LIBS="$GDIPLUS_LIBS $FONTCONFIG_LIBS $FREETYPE2_LIBS" GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS $FONTCONFIG_CFLAGS $FREETYPE2_CFLAGS" for ac_header in byteswap.h do : ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" if test "x$ac_cv_header_byteswap_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BYTESWAP_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5 $as_echo_n "checking for library containing sqrt... " >&6; } if ${ac_cv_search_sqrt+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_sqrt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sqrt+:} false; then : break fi done if ${ac_cv_search_sqrt+:} false; then : else ac_cv_search_sqrt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5 $as_echo "$ac_cv_search_sqrt" >&6; } ac_res=$ac_cv_search_sqrt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking host threading settings" >&5 $as_echo_n "checking host threading settings... " >&6; } case "$host" in *-*-mingw*|*-*-cygwin*) cat >>confdefs.h <<_ACEOF #define CYGWIN 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 $as_echo_n "checking for gettext in -lintl... " >&6; } if ${ac_cv_lib_intl_gettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gettext (); int main () { return gettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_gettext=yes else ac_cv_lib_intl_gettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 $as_echo "$ac_cv_lib_intl_gettext" >&6; } if test "x$ac_cv_lib_intl_gettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" fi ;; *-*-*netbsd*) cat >>confdefs.h <<_ACEOF #define BSDOS 1 _ACEOF ;; *-*-*freebsd*) cat >>confdefs.h <<_ACEOF #define BSDOS 1 _ACEOF CFLAGS="-D_THREAD_SAFE $CFLAGS" ;; *-*-*openbsd*) cat >>confdefs.h <<_ACEOF #define BSDOS 1 _ACEOF CFLAGS="$CFLAGS" LIBS="$LIBS" ;; *-*-linux*) cat >>confdefs.h <<_ACEOF #define LINUX 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" fi ;; *-*-solaris*) cat >>confdefs.h <<_ACEOF #define SOLARIS 1 _ACEOF cat >>confdefs.h <<_ACEOF #define _REENTRANT 1 _ACEOF CFLAGS="-pthreads $CFLAGS" ;; *-*-aix*|*-*-os400) cat >>confdefs.h <<_ACEOF #define AIX 1 _ACEOF # Specify a 64-bit build via GCC, as Mono is always 64-bit on AIX/PASE CFLAGS="-D_THREAD_SAFE -maix64 $CFLAGS" LDFLAGS="-maix64 $LDFLAGS" # Like mono, don't use `OBJECT_MODE=64`, but specify 64-bit mode IBM binutils # explictly instead. AR="/usr/bin/ar -X64" NM="/usr/bin/nm -X64" ;; *-*-darwin*) cat >>confdefs.h <<_ACEOF #define OSX 1 _ACEOF no_libpng16=yes # workaround until we can upgrade the libpng used by bockbuild ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unrecognized host $host" >&5 $as_echo "Unrecognized host $host" >&6; } cat >>confdefs.h <<_ACEOF #define OTHEROS 1 _ACEOF ;; esac # Apparently for BSD special handling needs to happen # See http://archives/neohapsis.com/archives/openbsd/2001-11/2142.html # by Miod Vallat { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler recognizes -pthread" >&5 $as_echo_n "checking if compiler recognizes -pthread... " >&6; } if ${myapp_cv_gcc_pthread+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -pthread" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { void *p = pthread_create; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : myapp_cv_gcc_pthread=yes else myapp_cv_gcc_pthread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS=$ac_save_CFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $myapp_cv_gcc_pthread" >&5 $as_echo "$myapp_cv_gcc_pthread" >&6; } if test $myapp_cv_gcc_pthread = yes then myapp_threads="" CFLAGS="$CFLAGS -pthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : myapp_threads=-lpthread else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 $as_echo_n "checking for pthread_create in -lc_r... " >&6; } if ${ac_cv_lib_c_r_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_create=yes else ac_cv_lib_c_r_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then : myapp_threads=-lc_r fi fi fi # sigsetjmp is a macro on some platforms, so can't use AC_CHECK_FUNCS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 $as_echo_n "checking for sigsetjmp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { sigjmp_buf env; sigsetjmp(env, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gdip_ok=yes else gdip_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdip_ok" >&5 $as_echo "$gdip_ok" >&6; } if test "$gdip_ok" = "yes"; then $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h fi # when possible hide stuff we don't want to export { $as_echo "$as_me:${as_lineno-$LINENO}: checking for visibility __attribute__" >&5 $as_echo_n "checking for visibility __attribute__... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { void __attribute__ ((visibility ("hidden"))) doit (void) {} void main () { doit (); } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_visibility_hidden=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else have_visibility_hidden=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "$host" in i*86-*-*) case $host_os in solaris*) # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. have_visibility_hidden=no esac ;; powerpc-*-*) case $host_os in aix*|os400*) # XCOFF doesn't have this, but somehow it appears anyways have_visibility_hidden=no esac ;; esac if test "x$have_visibility_hidden" = "xyes"; then $as_echo "#define HAVE_VISIBILITY_HIDDEN 1" >>confdefs.h fi # Check whether --with-libexif was given. if test "${with_libexif+set}" = set; then : withval=$with_libexif; fi case $prefix in NONE) prefix=$ac_default_prefix ;; esac # Check whether --with-libjpeg was given. if test "${with_libjpeg+set}" = set; then : withval=$with_libjpeg; libjpeg_prefix="$withval" else libjpeg_prefix="${prefix}" fi if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then JPEG_CFLAGS="-I${libjpeg_prefix}/include" JPEG_LIBS="-L${libjpeg_prefix}/lib" save_cflags=$CFLAGS; CFLAGS=$JPEG_CFLAGS save_libs=$LIBS; LIBS=$JPEG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_decompress in -ljpeg" >&5 $as_echo_n "checking for jpeg_destroy_decompress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_destroy_decompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_destroy_decompress (); int main () { return jpeg_destroy_decompress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_destroy_decompress=yes else ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_destroy_decompress" = xyes; then : jpeg_ok=yes else jpeg_ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** JPEG loader will not be built (JPEG library not found) ***" >&5 $as_echo "$as_me: WARNING: *** JPEG loader will not be built (JPEG library not found) ***" >&2;} fi if test "$jpeg_ok" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeglib.h" >&5 $as_echo_n "checking for jpeglib.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : jpeg_ok=yes else jpeg_ok=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jpeg_ok" >&5 $as_echo "$jpeg_ok" >&6; } if test "$jpeg_ok" = yes; then JPEG='jpeg'; LIBJPEG="-ljpeg" if test "$libjpeg_prefix" != "NONE"; then LIBJPEG="$LIBJPEG -L$libjpeg_prefix" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** JPEG loader will not be built (JPEG header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** JPEG loader will not be built (JPEG header file not found) ***" >&2;} fi fi CFLAGS=$save_cflags LIBS=$save_libs fi if test x$JPEG != x; then GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBJPEG" $as_echo "#define HAVE_LIBJPEG 1" >>confdefs.h else jpeg_ok="no (Get it from http://freshmeat.net/projects/libjpeg)" fi # Check whether --with-libtiff was given. if test "${with_libtiff+set}" = set; then : withval=$with_libtiff; libtiff_prefix="$withval" else libtiff_prefix="${prefix}" fi if test x$with_libtiff != xno && test -z "$LIBTIFF"; then TIFF_CFLAGS="-I${libjpeg_prefix}/include -I${libtiff_prefix}/include" TIFF_LIBS="-L${libjpeg_prefix}/lib -L${libtiff_prefix}/lib" save_cflags=$CFLAGS; CFLAGS=$TIFF_CFLAGS save_libs=$LIBS; LIBS=$TIFF_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFReadScanline in -ltiff" >&5 $as_echo_n "checking for TIFFReadScanline in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFReadScanline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFReadScanline (); int main () { return TIFFReadScanline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFReadScanline=yes else ac_cv_lib_tiff_TIFFReadScanline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFReadScanline" >&5 $as_echo "$ac_cv_lib_tiff_TIFFReadScanline" >&6; } if test "x$ac_cv_lib_tiff_TIFFReadScanline" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : TIFF='tiff'; LIBTIFF='-ltiff'; tiff_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** TIFF loader will not be built (TIFF header files not found) ***" >&5 $as_echo "$as_me: WARNING: *** TIFF loader will not be built (TIFF header files not found) ***" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFWriteScanline in -ltiff" >&5 $as_echo_n "checking for TIFFWriteScanline in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFWriteScanline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -ljpeg -lz -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFWriteScanline (); int main () { return TIFFWriteScanline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFWriteScanline=yes else ac_cv_lib_tiff_TIFFWriteScanline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFWriteScanline" >&5 $as_echo "$ac_cv_lib_tiff_TIFFWriteScanline" >&6; } if test "x$ac_cv_lib_tiff_TIFFWriteScanline" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz'; tiff_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** TIFF loader will not be built (TIFF header files not found) ***" >&5 $as_echo "$as_me: WARNING: *** TIFF loader will not be built (TIFF header files not found) ***" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFFlushData in -ltiff34" >&5 $as_echo_n "checking for TIFFFlushData in -ltiff34... " >&6; } if ${ac_cv_lib_tiff34_TIFFFlushData+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff34 -lz -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFFlushData (); int main () { return TIFFFlushData (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tiff34_TIFFFlushData=yes else ac_cv_lib_tiff34_TIFFFlushData=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff34_TIFFFlushData" >&5 $as_echo "$ac_cv_lib_tiff34_TIFFFlushData" >&6; } if test "x$ac_cv_lib_tiff34_TIFFFlushData" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz'; tiff_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** TIFF loader will not be built (TIFF header files not found) ***" >&5 $as_echo "$as_me: WARNING: *** TIFF loader will not be built (TIFF header files not found) ***" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** TIFF plug-in will not be built (TIFF library not found) ***" >&5 $as_echo "$as_me: WARNING: *** TIFF plug-in will not be built (TIFF library not found) ***" >&2;} fi fi fi CFLAGS=$save_cflags LIBS=$save_libs fi if test x$TIFF != x; then GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBTIFF" $as_echo "#define HAVE_LIBTIFF 1" >>confdefs.h else tiff_ok="no (Get it from http://www.libtiff.org/)" fi # Check whether --with-libgif was given. if test "${with_libgif+set}" = set; then : withval=$with_libgif; libgif_prefix="$withval" else libgif_prefix="${prefix}" fi if test x$with_libgif != xno && test -z "$LIBGIF"; then GIF_CFLAGS="-I${libgif_prefix}/include" GIF_LIBS="-L${libgif_prefix}/lib" save_cflags=$CFLAGS; CFLAGS=$GIF_CFLAGS save_libs=$LIBS; LIBS=$GIF_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpenFileName in -lgif" >&5 $as_echo_n "checking for DGifOpenFileName in -lgif... " >&6; } if ${ac_cv_lib_gif_DGifOpenFileName+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifOpenFileName (); int main () { return DGifOpenFileName (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gif_DGifOpenFileName=yes else ac_cv_lib_gif_DGifOpenFileName=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifOpenFileName" >&5 $as_echo "$ac_cv_lib_gif_DGifOpenFileName" >&6; } if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" if test "x$ac_cv_header_gif_lib_h" = xyes; then : GIF='gif'; LIBGIF='-lgif'; gif_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** GIF loader will not be built (giflibrary not found) ***" >&5 $as_echo "$as_me: WARNING: *** GIF loader will not be built (giflibrary not found) ***" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** GIF loader will not be built (giflibrary not found) ***" >&5 $as_echo "$as_me: WARNING: *** GIF loader will not be built (giflibrary not found) ***" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpenFileName in -lungif" >&5 $as_echo_n "checking for DGifOpenFileName in -lungif... " >&6; } if ${ac_cv_lib_ungif_DGifOpenFileName+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifOpenFileName (); int main () { return DGifOpenFileName (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ungif_DGifOpenFileName=yes else ac_cv_lib_ungif_DGifOpenFileName=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifOpenFileName" >&5 $as_echo "$ac_cv_lib_ungif_DGifOpenFileName" >&6; } if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" if test "x$ac_cv_header_gif_lib_h" = xyes; then : GIF='ungif'; LIBGIF='-lungif'; gif_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** GIF loader will not be built (ungiflibrary not found) ***" >&5 $as_echo "$as_me: WARNING: *** GIF loader will not be built (ungiflibrary not found) ***" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** GIF loader will not be built (ungiflibrary not found) ***" >&5 $as_echo "$as_me: WARNING: *** GIF loader will not be built (ungiflibrary not found) ***" >&2;} fi CFLAGS=$save_cflags LIBS=$save_libs fi if test x$GIF != x; then GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBGIF" $as_echo "#define HAVE_LIBGIF 1" >>confdefs.h else gif_ok="no (See http://sourceforge.net/projects/libgif)" fi libpng_found=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng16" >&5 $as_echo_n "checking for libpng16... " >&6; } if test "x$no_libpng16" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipped" >&5 $as_echo "skipped" >&6; } elif $PKG_CONFIG --exists libpng16 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PNG='png' PNG_DEP_CFLAGS_PACKAGES=libpng16 LIBPNG=`$PKG_CONFIG --libs libpng16` libpng_found=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$libpng_found" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng14" >&5 $as_echo_n "checking for libpng14... " >&6; } if $PKG_CONFIG --exists libpng14 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PNG='png' PNG_DEP_CFLAGS_PACKAGES=libpng14 LIBPNG=`$PKG_CONFIG --libs libpng14` libpng_found=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$libpng_found" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng12" >&5 $as_echo_n "checking for libpng12... " >&6; } if $PKG_CONFIG --exists libpng12 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PNG='png' PNG_DEP_CFLAGS_PACKAGES=libpng12 LIBPNG=`$PKG_CONFIG --libs libpng12` libpng_found=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$libpng_found" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png" >&5 $as_echo_n "checking for png... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_read_info in -lpng" >&5 $as_echo_n "checking for png_read_info in -lpng... " >&6; } if ${ac_cv_lib_png_png_read_info+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng -lz -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_read_info (); int main () { return png_read_info (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_png_read_info=yes else ac_cv_lib_png_png_read_info=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_read_info" >&5 $as_echo "$ac_cv_lib_png_png_read_info" >&6; } if test "x$ac_cv_lib_png_png_read_info" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : png_ok=yes else png_ok=no fi else as_fn_error $? "*** libpng12 not found. See http://www.libpng.org/pub/png/libpng.html." "$LINENO" 5 fi if test "$png_ok" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_structp in png.h" >&5 $as_echo_n "checking for png_structp in png.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : png_ok=yes else png_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $png_ok" >&5 $as_echo "$png_ok" >&6; } if test "$png_ok" = yes; then PNG='png'; LIBPNG='-lpng -lz' else as_fn_error but it is too old. See http://www.libpng.org/pub/png/libpng.html. "*** libpng12 found" "$LINENO" 5 fi else as_fn_error $? "*** libpng12 not found. See http://www.libpng.org/pub/png/libpng.html." "$LINENO" 5 fi fi GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBPNG" $as_echo "#define HAVE_LIBPNG 1" >>confdefs.h # Check whether --with-x11 was given. if test "${with_x11+set}" = set; then : withval=$with_x11; disable_x11=yes fi if test x$disable_x11 != xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking X11 support" >&5 $as_echo_n "checking X11 support... " >&6; } if $PKG_CONFIG --exists x11 ; then GDIPLUS_LIBS="$GDIPLUS_LIBS `$PKG_CONFIG --libs x11`" GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS `$PKG_CONFIG --cflags x11`" x11_available=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : x11_available=yes else x11_available=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$x11_available" != "xyes"; then as_fn_error $? " Failed to compile with X11/Xlib.h include. You must fix your compiler paths " "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else x11_available=no fi if test x$x11_available = xyes; then $as_echo "#define HAVE_X11 1" >>confdefs.h fi if test x$x11_available = xyes; then HAVE_X11_TRUE= HAVE_X11_FALSE='#' else HAVE_X11_TRUE='#' HAVE_X11_FALSE= fi if test x$with_libexif != xno && test -z "$LIBEXIF"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEXIF" >&5 $as_echo_n "checking for LIBEXIF... " >&6; } if test -n "$LIBEXIF_CFLAGS"; then pkg_cv_LIBEXIF_CFLAGS="$LIBEXIF_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libexif\""; } >&5 ($PKG_CONFIG --exists --print-errors "libexif") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBEXIF_CFLAGS=`$PKG_CONFIG --cflags "libexif" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBEXIF_LIBS"; then pkg_cv_LIBEXIF_LIBS="$LIBEXIF_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libexif\""; } >&5 ($PKG_CONFIG --exists --print-errors "libexif") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBEXIF_LIBS=`$PKG_CONFIG --libs "libexif" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBEXIF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libexif" 2>&1` else LIBEXIF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libexif" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBEXIF_PKG_ERRORS" >&5 libexif_pkgconfig=no] elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } libexif_pkgconfig=no] else LIBEXIF_CFLAGS=$pkg_cv_LIBEXIF_CFLAGS LIBEXIF_LIBS=$pkg_cv_LIBEXIF_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } libexif_pkgconfig=yes fi if test x$libexif_pkgconfig = xyes ; then GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS $LIBEXIF_CFLAGS" GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBEXIF_LIBS" $as_echo "#define HAVE_LIBEXIF 1" >>confdefs.h else libexif_pkgconfig="No. Get it from http://libexif.sourceforge.net/" fi else libexif_pkgconfig="No. You disabled it." fi if test x$libexif_pkgconfig = xyes; then HAVE_LIBEXIF_TRUE= HAVE_LIBEXIF_FALSE='#' else HAVE_LIBEXIF_TRUE='#' HAVE_LIBEXIF_FALSE= fi GDIPLUS_PKG_LIBS="$GDIPLUS_LIBS" GDIPLUS_PKG_CFLAGS="$GDIPLUS_CFLAGS" ac_config_files="$ac_config_files Makefile libgdiplus.pc libgdiplus0.spec src/Makefile tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PANGO_RENDERING_TRUE}" && test -z "${USE_PANGO_RENDERING_FALSE}"; then as_fn_error $? "conditional \"USE_PANGO_RENDERING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_X11_TRUE}" && test -z "${HAVE_X11_FALSE}"; then as_fn_error $? "conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBEXIF_TRUE}" && test -z "${HAVE_LIBEXIF_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBEXIF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libgdiplus $as_me 6.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libgdiplus config.status 6.0.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libgdiplus.pc") CONFIG_FILES="$CONFIG_FILES libgdiplus.pc" ;; "libgdiplus0.spec") CONFIG_FILES="$CONFIG_FILES libgdiplus0.spec" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "---" echo "Configuration summary" echo "" echo " * Installation prefix = $prefix" echo " * Cairo = $cairo_info" echo " * Text = $text_v" echo " * EXIF tags = $libexif_pkgconfig" echo " * X11 = $x11_available" echo " * Codecs supported:" echo "" echo " - TIFF: $tiff_ok" echo " - JPEG: $jpeg_ok" echo " - GIF: $gif_ok" echo " - PNG: yes" echo "" echo " NOTE: if any of the above say 'no' you may install the" echo " corresponding development packages for them, rerun" echo " autogen.sh to include them in the build." echo "" echo "---" libgdiplus-6.0.4+dfsg/README.md0000644000175000017500000000613713545154623016614 0ustar directhexdirecthex## libgdiplus: An Open Source implementation of the GDI+ API. This is part of the [Mono project](http://www.mono-project.com/). Build status: | | | |----|---| | Travis (Linux/OSX) | [![Travis Build Status](https://travis-ci.org/mono/libgdiplus.svg?branch=master)](https://travis-ci.org/mono/libgdiplus)| | Jenkins (Linux) | [![Jenkins Linux Build Status](https://jenkins.mono-project.com/job/test-libgdiplus-mainline/badge/icon)](https://jenkins.mono-project.com/job/test-libgdiplus-mainline) | | Jenkins (Windows) | [![Jenkins Windows Build Status](https://jenkins.mono-project.com/job/test-libgdiplus-mainline-windows/badge/icon)](https://jenkins.mono-project.com/job/test-libgdiplus-mainline-windows) | ### Requirements: This requires the libraries used by the Cairo vector graphics library to build (freetype2, fontconfig, Xft2 and libpng). On **OSX** you can use [Homebrew](https://brew.sh/) to install the dependencies: brew install glib cairo libexif libjpeg giflib libtiff autoconf libtool automake pango pkg-config brew link gettext --force On **Debian-based Linux distributions** you can use `apt-get` to install the dependencies: sudo apt-get install libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev On **Windows** you can use [Vcpkg](https://github.com/Microsoft/vcpkg) to install the dependencies. Run the following commands from the root of the repository from an admin command prompt: bootstrap-vcpkg.bat vcpkg.exe integrate install vcpkg.exe install giflib libjpeg-turbo libpng cairo glib tiff libexif glib pango --triplet x86-windows vcpkg.exe install giflib libjpeg-turbo libpng cairo glib tiff libexif glib pango --triplet x64-windows ### Build instructions To build on **OSX** without X11: ./autogen.sh --without-x11 --prefix=YOUR_PREFIX make To build on **OSX with X11** (e.g. from XQuartz): PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig ./autogen.sh --prefix=YOUR_PREFIX make To build on **Linux**: ./autogen.sh --prefix=YOUR_PREFIX make To build on **Windows**, open `libgdiplus.sln`. ### Running the unit tests Run the following command from the root of the repository: make check To run the tests with Clang sanitizers, run the following command from the root of the repository: ./autogen.sh --enable-asan make check ### Code coverage Code coverage stats are generated with `lcov`. You can use [Homebrew](https://brew.sh/) on **OSX** to install the dependencies: brew install lcov To run the tests with code coverage, run the following commands from the root of the repository: ./autogen.sh --enable-coverage make check lcov --capture --directory src --output-file coverage.info genhtml coverage.info --output-directory coverage To view the coverage report, navigate to the `coverage` directory in the root of the repository and open `index.html`. ### Installing libgdiplus Run the following command from the root of the repository: make install ### Optional build options --with-pango This builds libgdiplus using Pango to render (measure and draw) all of it's text. This requires Pango version 1.38 (or later).